summaryrefslogtreecommitdiff
path: root/.config/sway/config
blob: 69c27274040747d6fa608c5a95c34ff9b50d7664 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
include ./defaults

### Variables
set $mod Mod4
set $menu rofi -show run
#bemenu-run
set $term alacritty

### Key Bindings
# I repeat them here to add `--to-code --no-warn` flag to make the bindings layout agnostic.
bindsym --to-code --no-warn {
  $mod+$left focus left
  $mod+$down focus down
  $mod+$up focus up
  $mod+$right focus right
}
bindsym --to-code --no-warn $mod+Return exec $term
bindsym --to-code --no-warn $mod+Shift+q kill
bindsym --to-code --no-warn $mod+d exec $menu
bindsym --to-code --no-warn $mod+Shift+c reload

input * {
    xkb_layout "de,ir"
    xkb_options "lv3:caps_switch,grp:lctrl_lwin_toggle,shift:both_shiftlock"
}

input type:touchpad {
    tap disabled
    natural_scroll enabled
}

bar {
  status_command i3status
}

# Enable fzf-based floating app menu
#for_window [app_id="^launcher$"] floating enable, sticky enable, resize set 30 ppt 60 ppt, border pixel 10
#set $menu exec $term --class=launcher -e sway-launcher-desktop
#bindsym --to-code --no-warn $mod+tab exec $menu

#
# Multimedia keys - Courtesy of great Arch Linux wiki and its awesome users.
#
bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
bindsym XF86MonBrightnessUp exec brightnessctl set +5%
bindsym XF86AudioPlay exec playerctl play-pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
bindsym XF86Search exec bemenu-run

#
# Screen capture
# Thanks to Gentoo wiki at https://wiki.gentoo.org/wiki/Sway
#
set $ps1 Print
set $ps2 Control+Print
set $ps3 Alt+Print
set $ps4 Alt+Control+Print
 
bindsym $ps1 exec grim - | wl-copy
bindsym $ps2 exec grim -g "$(slurp)" - | wl-copy
bindsym $ps3 exec grim $(xdg-user-dir PICTURES)/Screenshots/ps_$(date +"%Y%m%d%H%M%S").png
bindsym $ps4 exec grim -g "$(slurp)" $(xdg-user-dir PICTURES)/Screenshots/ps_$(date +"%Y%m%d%H%M%S").png

include ~/.config/sway/`hostname`