dotfiles/sway/config

317 lines
11 KiB
Text
Raw Normal View History

2019-04-27 16:35:17 +02:00
set $mod Mod4
floating_modifier $mod
# Home row direction keys, like vim
set $left h
set $down j
set $up k
set $right l
# Your preferred terminal emulator
set $term "alacritty"
# keyboard layout
input * {
2019-12-23 18:23:22 +01:00
xkb_layout "gb,de"
xkb_variant altgr-intl
xkb_options "caps:escape,grp:win_space_toggle,compose:ralt"
2019-04-27 16:35:17 +02:00
xkb_numlock enabled
}
# hide cursor after 10 sec
2019-04-27 16:35:17 +02:00
seat * hide_cursor 10000
# background
2019-10-30 11:45:56 +01:00
output * bg #0C0C0D solid_color
2019-04-27 16:35:17 +02:00
#output * bg wallpaper.png fit
# startup programs
exec /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
2019-07-26 22:15:34 +02:00
exec nm-applet --indicator
2019-04-27 16:35:17 +02:00
exec gnome-keyring-daemon --start --components secrets
exec swayidle -w \
timeout 285 'notify-send -a lockscreen -c lock-warn -u critical -t 14900 -i system-lock-screen "Locking Screen" "Will Lock Screen in 15s"' \
timeout 300 '~/.dotfiles/sway/lock.sh' \
timeout 600 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
before-sleep '~/.dotfiles/sway/lock.sh'
exec mako
exec sleep 2 && QSyncthingTray
2019-04-27 16:35:17 +02:00
exec telegram-desktop -startintray
exec /usr/lib/geoclue-2.0/demos/agent
exec redshift-gtk -m wayland
exec nextcloud
exec newsflash
2019-04-27 16:35:17 +02:00
# mute microfone
exec amixer set Capture nocap
# prevent locking when fullscreen
for_window [app_id="firefox"] inhibit_idle fullscreen
for_window [class="Firefox"] inhibit_idle fullscreen
for_window [title="VLC media player"] inhibit_idle fullscreen
for_window [app_id="evince"] inhibit_idle fullscreen
for_window [class="mpv"] inhibit_idle fullscreen
2019-04-27 16:35:17 +02:00
# font
font pango:Fira Sans Mono 12
2019-04-27 16:35:17 +02:00
# default floating
for_window [window_role="pop-up"] floating enable
for_window [window_role="bubble"] floating enable
for_window [window_role="task_dialog"] floating enable
for_window [window_role="Preferences"] floating enable
for_window [window_type="dialog"] floating enable
for_window [window_type="menu"] floating enable
for_window [instance="update_installer"] floating enable
# custom floating
2019-06-04 13:05:03 +02:00
for_window [app_id="firefox" title="About Mozilla Firefox"] floating enable
for_window [app_id="firefox" title="Picture-in-Picture"] floating enable
for_window [app_id="firefox" title="Firefox - Sharing Indicator"] floating enable
2019-06-04 13:05:03 +02:00
for_window [app_id="firefox-developer-edition" title="About Firefox Developer Edition"] floating enable
for_window [app_id="gnome-calculator"] floating enable
2019-11-21 22:46:59 +01:00
for_window [app_id="org.gnome.NautilusPreviewer"] floating enable
2019-04-27 16:35:17 +02:00
# Stick windows to workspaces
assign [app_id="NewsFlashGTK"] 8
2019-04-27 16:35:17 +02:00
assign [class="Thunderbird"] 9
assign [app_id="evolution"] 9
assign [app_id="rhythmbox"] 10
hide_edge_borders both
focus_follows_mouse no
# to switch workspace-tabs
bindsym $mod+Tab workspace next
bindsym Shift+$mod+Tab workspace prev
bindsym $mod+m exec . ~/.profile.d/90-keychain.sh && keepassxc
2019-04-27 16:35:17 +02:00
bindsym $mod+e exec subl3
bindsym $mod+w exec firefox
bindsym $mod+u exec newsflash
2019-04-27 16:35:17 +02:00
# mako
bindsym $mod+dead_circumflex exec makoctl dismiss
bindsym $mod+Shift+dead_circumflex exec makoctl dismiss --all
bindsym $mod+grave exec makoctl dismiss
bindsym $mod+Shift+grave exec makoctl dismiss --all
bindsym $mod+minus exec makoctl list
bindsym $mod+plus exec makoctl invoke
2019-04-27 16:35:17 +02:00
# to prevent gnome-help
bindsym F1 exec :
# script shortcuts
set $keyboard ~/.local/bin/keyboard
bindsym $mod+F1 exec $keyboard-f1
bindsym $mod+Shift+F1 exec $keyboard-shift-f1
bindsym $mod+F2 exec $keyboard-f2
bindsym $mod+Shift+F2 exec $keyboard-shift-f2
bindsym $mod+F3 exec $keyboard-f3
bindsym $mod+Shift+F3 exec $keyboard-shift-f3
bindsym $mod+F4 exec $keyboard-f4
bindsym $mod+Shift+F4 exec $keyboard-shift-f4
2019-04-27 16:35:17 +02:00
# Screenshot
bindsym Print exec grim ~/Downloads/Screenshot-$(date +'%Y-%m-%d_%H%M%S.png')
bindsym $mod+Print exec slurp | grim -g - ~/Downloads/Screenshot-$(date +'%Y-%m-%d_%H%M%S.png')
bindsym $mod+Shift+Print exec swaymsg -t get_tree | jq -r '.. | (.nodes? // empty , .floating_nodes? // empty)[] | select(.focused) | "\(.rect.x),\(.rect.y) \(.rect.width)x\(.rect.height)"' | grim -g - ~/Downloads/Screenshot-$(date +'%Y-%m-%d_%H%M%S.png')
2019-04-27 16:35:17 +02:00
# forward an backward at arrow-keys
#bindsym --release XF86Back exec
#bindsym --release XF86Forward exec
# Sreen brightness controls
bindsym --locked XF86MonBrightnessUp exec brightnessctl set +5%
bindsym --locked XF86MonBrightnessDown exec brightnessctl set -5%
# Pulse Audio controls
bindsym --locked XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
# Microphone
bindsym --locked XF86AudioMicMute exec pactl set-source-mute @DEFAULT_SOURCE@ toggle
bindsym --locked $mod+XF86AudioRaiseVolume exec pactl set-source-volume @DEFAULT_SOURCE@ +5%
bindsym --locked $mod+XF86AudioLowerVolume exec pactl set-source-volume @DEFAULT_SOURCE@ -5%
# Media player controls
bindsym --locked XF86AudioPlay exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
bindsym --locked XF86AudioPause exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
bindsym --locked XF86AudioNext exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
bindsym --locked XF86AudioPrev exec dbus-send --type=method_call --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
# main commands
bindsym $mod+Shift+c reload
bindsym $mod+Shift+e exit
# start a terminal
bindsym $mod+Return exec $term
# screensaver
bindsym $mod+z exec ~/.dotfiles/sway/lock.sh
bindsym $mod+y exec ~/.dotfiles/sway/lock.sh
2019-05-01 23:35:01 +02:00
bindsym Scroll_Lock exec ~/.dotfiles/sway/lock.sh
2019-04-27 16:35:17 +02:00
# start dmenu (a program launcher)
2020-02-23 17:53:28 +01:00
bindsym $mod+d exec wofi --show drun
bindsym $mod+Shift+d exec ~/.dotfiles/wofi/system.sh
bindsym Alt+Space exec wofi --show drun
2019-04-27 16:35:17 +02:00
2019-06-08 12:46:10 +02:00
# gtk3
set $gnome-schema org.gnome.desktop.interface
exec_always {
gsettings set $gnome-schema gtk-theme 'Arc-Darker'
gsettings set $gnome-schema icon-theme 'Numix-Circle'
gsettings set $gnome-schema cursor-theme 'Adwaita'
}
2019-04-27 16:35:17 +02:00
# kill focused window
bindsym $mod+Shift+q kill
# enter fullscreen mode for the focused container
bindsym $mod+f fullscreen toggle
bindsym $mod+g fullscreen global
# change layouts
bindsym $mod+b split h
bindsym $mod+v split v
bindsym $mod+c layout toggle split
#bindsym $mod+z layout stacking
#bindsym $mod+t layout tabbed
# toggle tiling / floating
bindsym $mod+Shift+space floating toggle
# focus the child container
bindsym $mod+s focus child
# focus the parent container
bindsym $mod+a focus parent
bindsym Alt+Left move workspace to output left
bindsym Alt+Right move workspace to output right
bindsym Alt+Up move workspace to output up
bindsym Alt+Down move workspace to output down
2019-04-27 16:35:17 +02:00
# switch to workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6
bindsym $mod+7 workspace 7
bindsym $mod+8 workspace 8
bindsym $mod+9 workspace 9
bindsym $mod+0 workspace 10
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6
bindsym $mod+Shift+7 move container to workspace 7
bindsym $mod+Shift+8 move container to workspace 8
bindsym $mod+Shift+9 move container to workspace 9
bindsym $mod+Shift+0 move container to workspace 10
# move windows to workspace and switch to it
bindsym Ctrl+1 move container to workspace 1; workspace 1
bindsym Ctrl+2 move container to workspace 2; workspace 2
bindsym Ctrl+3 move container to workspace 3; workspace 3
bindsym Ctrl+4 move container to workspace 4; workspace 4
bindsym Ctrl+5 move container to workspace 5; workspace 5
bindsym Ctrl+6 move container to workspace 6; workspace 6
bindsym Ctrl+7 move container to workspace 7; workspace 7
bindsym Ctrl+8 move container to workspace 8; workspace 8
bindsym Ctrl+9 move container to workspace 9; workspace 9
# for settings the zoom-level back to default in firefox
#bindsym Ctrl+0 move container to workspace 10; workspace 10
bindsym $mod+n exec i3-input -F 'rename workspace to "%s"' -P 'New name: '
#FOCUS
2019-05-01 23:35:01 +02:00
bindsym $mod+$left focus left
bindsym $mod+$down focus down
bindsym $mod+$up focus up
2019-04-27 16:35:17 +02:00
bindsym $mod+$right focus right
2019-05-01 23:35:01 +02:00
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right
2019-04-27 16:35:17 +02:00
# move focused window
2019-05-01 23:35:01 +02:00
bindsym $mod+Shift+$left move left
bindsym $mod+Shift+$down move down
bindsym $mod+Shift+$up move up
bindsym $mod+Shift+$right move right
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right
2019-04-27 16:35:17 +02:00
# resize window (you can also use the mouse for that)
mode "resize" {
2019-05-01 23:35:01 +02:00
bindsym $left resize shrink width 10 px or 10 ppt
bindsym $down resize shrink height 10 px or 10 ppt
bindsym $up resize grow height 10 px or 10 ppt
bindsym $right resize grow width 10 px or 10 ppt
2019-04-27 16:35:17 +02:00
2019-05-01 23:35:01 +02:00
bindsym Left resize shrink width 10 px or 10 ppt
bindsym Up resize grow height 10 px or 10 ppt
bindsym Down resize shrink height 10 px or 10 ppt
bindsym Right resize grow width 10 px or 10 ppt
2019-04-27 16:35:17 +02:00
bindsym Return mode "default"
bindsym Escape mode "default"
bindsym $mod+r mode "default"
}
bindsym $mod+r mode "resize"
mode "passthrough" {
bindsym $mod+Escape mode "default"
}
bindsym $mod+Escape mode "passthrough"
# colors
2019-10-30 11:45:56 +01:00
set $color_bg #0C0C0D
set $color_bg_inactive #0C0C0D
2019-04-27 16:35:17 +02:00
set $color_text #F3F4F5
set $color_text_inactive #676E7D
set $color_bg_urgent #E53935
set $color_indicator #00FF00
set $color_separator #666666
set $color_ws #5294E2
2019-10-30 11:45:56 +01:00
set $color_ws_inactive #0C0C0D
2019-04-27 16:35:17 +02:00
set $color_ws_text #FFFFFF
set $color_ws_text_inactive #D3DAE3
# window colors
# border background text indicator child_border
client.focused $color_bg $color_bg $color_text $color_indicator $color_bg
client.unfocused $color_bg_inactive $color_bg_inactive $color_text_inactive $color_indicator $color_bg
client.focused_inactive $color_bg_inactive $color_bg_inactive $color_text_inactive $color_indicator $color_bg
client.urgent $color_bg_urgent $color_bg_urgent $color_text $color_indicator $color_bg
bar {
status_command i3status
position top
workspace_buttons yes
2019-07-27 17:58:26 +02:00
icon_theme Numix
2019-04-27 16:35:17 +02:00
colors {
background $color_bg
statusline $color_ws_text_inactive
separator $color_separator
focused_workspace $color_ws $color_ws $color_ws_text
active_workspace $color_ws_inactive $color_ws_inactive $color_ws_text_inactive
inactive_workspace $color_ws_inactive $color_ws_inactive $color_ws_text_inactive
urgent_workspace $color_bg_urgent $color_bg_urgent $color_ws_text
}
}
include ~/.config/sway/`hostname`
2019-05-01 23:35:01 +02:00
include /etc/sway/config.d/*