summary refs log tree commit diff
path: root/.config/sway
diff options
context:
space:
mode:
authorRobert Günzler <r@gnzler.io>2020-01-26 17:16:07 +0100
committerRobert Günzler <r@gnzler.io>2020-01-26 18:00:59 +0100
commitf5d56602df70950de6b7d40966b00c9939c81763 (patch)
treeb50ffeb5496fe3525cc1bab2629389ced95435b7 /.config/sway
Intial commit of v2
See https://drewdevault.com/2019/12/30/dotfiles.html
Diffstat (limited to '.config/sway')
-rw-r--r--.config/sway/auto.conf60
-rw-r--r--.config/sway/binds.conf215
-rw-r--r--.config/sway/config71
-rw-r--r--.config/sway/contrib/swayidle.confd8
-rwxr-xr-x.config/sway/contrib/swayidle.initd6
-rw-r--r--.config/sway/env22
-rw-r--r--.config/sway/hibiki39
-rw-r--r--.config/sway/input.conf35
-rw-r--r--.config/sway/simple.conf26
9 files changed, 482 insertions, 0 deletions
diff --git a/.config/sway/auto.conf b/.config/sway/auto.conf
new file mode 100644
index 0000000..725900c
--- /dev/null
+++ b/.config/sway/auto.conf
@@ -0,0 +1,60 @@
+# vim: ft=i3
+# NOTE: never use assign, it crashes sway for some reason...
+
+
+for_window [class="nnn"] border pixel
+for_window [app_id="mpv"] floating enable; border pixel; inhibit_idle open
+for_window [app_id="Alacritty"] border pixel
+for_window [app_id="^__floating-.*"] floating enable
+for_window [class="pinentry"] floating enable; border normal
+for_window [class="zoom" title="Zoom - Free Account"] floating enable
+for_window [class="zoom" title="Settings"] floating enable
+for_window [class="zoom"] move workspace 9; move workspace to output eDP-1
+for_window [title="tridactyledit"] floating enable
+for_window [class="feh"] floating enable; urgent enable
+for_window [class="Sxiv"] floating enable; urgent enable
+for_window [title="Volume Control"] floating enable
+for_window [title="Calculator"] floating enable
+for_window [title="wpgtk 6.0.1"] floating enable; border normal
+for_window [app_id="launcher"] floating enable; border pixel
+for_window [app_id="nm-connection-editor"] floating enable; border normal
+for_window [class="balena-etcher-electron"] floating enable; border normal
+for_window [app_id="imv"] border pixel
+for_window [app_id="firefox" title="Picture-in-Picture"] \
+    floating enable, sticky enable, border none
+
+# Tag windows
+for_window [class="zoom"] mark work
+
+for_window [app_id="firefox"] mark browser
+for_window [class="Nightly"] mark browser
+for_window [class="Chromium-browser"] mark work; mark browser
+for_window [class="Mail"] mark mail
+for_window [class="Thunderbird"] mark mail
+for_window [class="discord"] mark mail
+for_window [class="TelegramDesktop"] mark mail
+for_window [app_id="firefox" title="^web.whatsapp.com"] mark mail
+
+for_window [con_mark="browser"] \
+    border pixel, inhibit_idle fullscreen
+
+# Move around
+
+set $outputSide eDP-1
+set $wsWork 3
+set $wsMail 2
+for_window [con_mark="work"] move workspace $wsWork
+for_window [con_mark="mail"] move workspace $wsMail, move workspace to output $outputSide, layout tabbed
+
+for_window [class="Spotify"] \
+    move workspace $wsMusic, move workspace to output $outputSide, layout tabbed, inhibit_idle open
+
+for_window [app_id="spotify-tui"] \
+    move workspace $wsMusic, move workspace to output $outputSide, layout tabbed, inhibit_idle open
+
+# for_window [class="osu!"] \
+#   move workspace $wsGame, layout tabbed
+# for_window [class="^.inecraft.*"] \
+#   move workspace $wsGame, layout tabbed
+
+for_window [class="KeePassXC"] move scratchpad; scratchpad show
diff --git a/.config/sway/binds.conf b/.config/sway/binds.conf
new file mode 100644
index 0000000..4ee9ce0
--- /dev/null
+++ b/.config/sway/binds.conf
@@ -0,0 +1,215 @@
+# vim: ft=i3
+
+# Basics {{{
+# start a terminal
+bindsym $mod+Return exec $term
+bindsym $mod+Shift+Return exec $floating_term
+
+# kill focused window
+bindsym $mod+Shift+q kill
+
+# start your launcher
+bindsym $mod+d exec $menu
+bindsym $mod+o exec $run_menu
+
+# Drag floating windows by holding down $mod and left mouse button.
+# Resize them with right mouse button + $mod.
+# Despite the name, also works for non-floating windows.
+# Change normal to inverse to use left mouse button for resizing and right
+# mouse button for dragging.
+floating_modifier $mod normal
+
+# reload the configuration file
+bindsym $mod+Shift+c reload
+
+# exit sway (logs you out of your wayland session)
+bindsym $mod+Shift+e exit
+bindsym $mod+Shift+p exec $HOME/.dotfiles/bin/lock
+
+bindsym $mod+Shift+s mode "screengrab"
+mode "screengrab" {
+bindsym f exec grimshot save screen; mode "default"
+bindsym s exec grimshot save area; mode "default"
+bindsym c exec grimshot copy area; mode "default"
+bindsym r exec grimshot rec screen; mode "default"
+bindsym p exec colorpick; mode "default"
+bindsym Shift+r exec grimshot rec area; mode "default"
+bindsym Escape mode "default"
+}
+
+bindsym $mod+Shift+b border toggle
+
+bindsym $mod+a exec soundswitch_dmenu
+bindsym $mod+Shift+a exec soundswitch_dmenu global
+bindsym $mod+n exec networkmanager_dmenu
+# }}}
+
+# Moving around {{{
+# Move your focus around
+bindsym $mod+$left focus left
+bindsym $mod+$down focus down
+bindsym $mod+$up focus up
+bindsym $mod+$right focus right
+# or use $mod+[up|down|left|right]
+
+# _move_ the focused window with the same, but add Shift
+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+Next focus child
+bindsym $mod+Prior focus parent
+
+bindsym $mod+Escape [urgent="latest"] focus
+# }}}
+
+# Workspaces {{{
+# Note: workspaces can have any name you want, not just numbers.
+# We just use 1-10 as the default.
+bindsym $mod+Shift+comma workspace prev
+bindsym $mod+Shift+period workspace next
+# switch to workspace
+bindsym $mod+1 workspace $ws1
+bindsym $mod+2 workspace $ws2
+bindsym $mod+3 workspace $ws3
+bindsym $mod+4 workspace $ws4
+bindsym $mod+5 workspace $ws5
+bindsym $mod+6 workspace $ws6
+bindsym $mod+7 workspace $ws7
+bindsym $mod+8 workspace $ws8
+bindsym $mod+9 workspace $ws9
+
+bindsym $mod+Ctrl+m workspace $wsMusic
+bindsym $mod+Ctrl+v workspace $wsVideo
+bindsym $mod+Ctrl+g workspace $wsGame
+bindsym $mod+Tab workspace back_and_forth
+
+# move focused container to workspace
+bindsym $mod+Shift+1 move container to workspace $ws1
+bindsym $mod+Shift+2 move container to workspace $ws2
+bindsym $mod+Shift+3 move container to workspace $ws3
+bindsym $mod+Shift+4 move container to workspace $ws4
+bindsym $mod+Shift+5 move container to workspace $ws5
+bindsym $mod+Shift+6 move container to workspace $ws6
+bindsym $mod+Shift+7 move container to workspace $ws7
+bindsym $mod+Shift+8 move container to workspace $ws8
+bindsym $mod+Shift+9 move container to workspace $ws9
+
+# move focused workspce to output
+bindsym $mod+Ctrl+$left move workspace to output left
+bindsym $mod+Ctrl+$down move workspace to output down
+bindsym $mod+Ctrl+$up move workspace to output up
+bindsym $mod+Ctrl+$right move workspace to output right
+# }}}
+
+# Layout stuff {{{
+bindsym $mod+Alt+v splith
+bindsym $mod+Alt+h splitv
+
+# Make the current focus fullscreen
+bindsym $mod+f fullscreen
+# Hide the topbar (also gets you more space)
+bindsym $mod+Shift+t bar mode toggle topbar; default_border pixel
+
+# Swap focus between the tiling area and the floating area
+bindsym $mod+space focus mode_toggle
+# Toggle the current focus between tiling and floating mode
+bindsym $mod+Ctrl+space floating toggle
+
+mode "layout" {
+    # Switch the current container between different layout styles
+    bindsym s layout stacking; mode "default"
+    bindsym w layout tabbed; mode "default"
+    bindsym e layout toggle split; mode "default"
+
+    # move focus to the parent container
+    bindsym p focus parent
+    bindsym Shift+p focus child
+    
+    # make a sticky container
+    bindsym t sticky toggle; mode "default"; exec notify-send "container sticky'd"
+
+    # return to default mode
+    bindsym Return mode "default"
+    bindsym Escape mode "default"
+}
+bindsym $mod+y mode "layout"
+# }}}
+
+# Scratchpad {{{
+# Sway has a "scratchpad", which is a bag of holding for windows.
+# You can send windows there and get them back later.
+
+# Move the currently focused window to the scratchpad
+bindsym $mod+Ctrl+backspace move scratchpad
+
+# Show the next scratchpad window or hide the focused scratchpad window.
+# If there are multiple scratchpad windows, this command cycles through them.
+bindsym $mod+backspace scratchpad show
+# }}}
+
+# Resizing containers {{{
+mode "resize" {
+    # 1x
+    set $resizeRate1x 50
+    bindsym $left resize shrink width $resizeRate1x px
+    bindsym $down resize grow height $resizeRate1x px
+    bindsym $up resize shrink height $resizeRate1x px
+    bindsym $right resize grow width $resizeRate1x px
+    bindsym Shift+$down resize shrink width $resizeRate1x px ; resize shrink height $resizeRate1x px
+    bindsym Shift+$up resize grow width $resizeRate1x px ; resize grow height $resizeRate1x px
+
+    # 2x
+    set $resizeRate2x 100
+    bindsym Left resize shrink width $resizeRate1x px
+    bindsym Down resize grow height $resizeRate1x px
+    bindsym Up resize shrink height $resizeRate1x px
+    bindsym Right resize grow width $resizeRate1x px
+    bindsym Shift+Down resize shrink width $resizeRate2x px ; resize shrink height $resizeRate2x px
+    bindsym Shift+Up resize grow width $resizeRate2x px ; resize grow height $resizeRate2x px
+
+    # return to default mode
+    bindsym Return mode "default"
+    bindsym Escape mode "default"
+}
+bindsym $mod+r mode "resize"
+# }}}
+
+# Gaps {{{
+mode "gaps" {
+    bindsym r gaps outer all set 0; gaps inner all set 0
+
+    set $gapRate 5
+    bindsym $up gaps inner all plus $gapRate
+    bindsym $down gaps inner all minus $gapRate
+
+    # return to default mode
+    bindsym Return mode "default"
+    bindsym Escape mode "default"
+}
+bindsym $mod+Alt+g mode "gaps"
+# }}}
+
+# Misc {{{
+bindsym $mod+Shift+x mark --toggle "x"
+bindsym $mod+x [con_mark="x"] focus
+bindsym $mod+Ctrl+x swap container with mark "x"
+
+# Media volume controls
+bindsym XF86AudioMute exec pactl set-sink-mute '@DEFAULT_SINK@' toggle
+bindsym XF86AudioMicMute exec pactl set-input-mute '@DEFAULT_INPUT@' toggle
+bindsym XF86AudioLowerVolume exec pactl set-sink-volume '@DEFAULT_SINK@' -5%
+bindsym XF86AudioRaiseVolume exec pactl set-sink-volume '@DEFAULT_SINK@' +5%
+
+# Sreen brightness controls
+bindsym XF86MonBrightnessUp exec light -A 5
+bindsym XF86MonBrightnessDown exec light -U 5
+
+# Media player controls
+bindsym XF86AudioPlay exec playerctl play-pause
+# bindsym XF86AudioForward exec playerctl next
+# bindsym XF86AudioRewind exec playerctl previous
+bindsym XF86AudioNext exec playerctl next
+bindsym XF86AudioPrev exec playerctl previous
+# }}}
diff --git a/.config/sway/config b/.config/sway/config
new file mode 100644
index 0000000..97424b1
--- /dev/null
+++ b/.config/sway/config
@@ -0,0 +1,71 @@
+# vim: ft=i3 fdm=marker
+
+set $mod Mod4
+set $alt Mod1
+
+set $left h
+set $down j
+set $up k
+set $right l
+
+set $term alacritty
+set $floating_term $term --config-file $HOME/.config/alacritty/launcher.yml --class '__floating-Alacritty'
+set $menu wofi -k /dev/null --terminal $term --show drun
+set $run_menu menu -run
+
+# workspaces {{{
+set $ws1 1
+set $ws2 2
+set $ws3 3
+set $ws4 4
+set $ws5 5
+set $ws6 6
+set $ws7 7
+set $ws8 8
+set $ws9 9
+set $wsMusic m
+set $wsVideo v
+set $wsGame g
+# }}}
+
+# gaps inner 5
+show_marks yes
+
+# default keyboard
+input * {
+    xkb_layout us
+    xkb_variant mac
+    xkb_options 'caps:hyper,lvl3:ralt_switch_multikey'
+    repeat_rate 70
+}
+
+# default pointer
+input * {
+    accel_profile adaptive
+}
+
+# TODO
+include input.conf
+include binds.conf
+include auto.conf
+
+# style {{{
+set $text #FCFAF2
+set $text2 #BDC0BA
+set $bg #1C1C1C
+set $bg2 #434343
+set $main  #0B346F
+set $main2 #005CAF
+set $urgent #DB4D6D
+set $urgent2 #CB1B45
+set $indicator #FAD689
+set $indicator2 #C18A26
+
+client.focused $main2 $main $text $indicator $main
+client.focused_inactive $bg2 $bg $text2 $indicator2 $bg
+client.unfocused $bg2 $bg $text2 $indicator2 $bg
+client.urgent $urgent2 $urgent $text $indicator $urgent
+# }}}
+
+include config.d/*
+include "`uname -n`"
diff --git a/.config/sway/contrib/swayidle.confd b/.config/sway/contrib/swayidle.confd
new file mode 100644
index 0000000..405cdbe
--- /dev/null
+++ b/.config/sway/contrib/swayidle.confd
@@ -0,0 +1,8 @@
+
+SWAYIDLE_COMMAND=<<EOF
+timeout 540 'notify-send swayidle "screen off in 60s"'
+timeout 600 'sway output * dpms off'
+	resume 'sway output * dpms on'
+timeout 800 suspend
+before-sleep lock
+EOF
diff --git a/.config/sway/contrib/swayidle.initd b/.config/sway/contrib/swayidle.initd
new file mode 100755
index 0000000..169e5cf
--- /dev/null
+++ b/.config/sway/contrib/swayidle.initd
@@ -0,0 +1,6 @@
+#!/sbin/openrc-run
+
+command=swayidle
+command_args="${SWAYIDLE_COMMAND}"
+
+pidfile=/var/run/swayidle.pid
diff --git a/.config/sway/env b/.config/sway/env
new file mode 100644
index 0000000..c7eb252
--- /dev/null
+++ b/.config/sway/env
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+# export XDG_RUNTIME_DIR=/run/user/1000
+
+export DESKTOP_SESSION=gnome
+export GDK_BACKEND=wayland
+export CLUTTER_BACKEND=wayland
+
+# export QT_QPA_PLATFORM=wayland-egl
+export QT_QPA_PLATFORM=
+# export QT_AUTO_SCREEN_SCALE_FACTOR=0
+# export QT_SCREEN_SCALE_FACTORS='1.5;1'
+export QT_QPA_PLATFORMTHEME=qgnomeplatform
+export QT_STYLE_OVERRIDE=adwaita
+
+export _JAVA_AWT_WM_NONREPARENTING=1
+
+export XMODIFIERS=@im=ibus
+export QT_IM_MODULE=ibus
+export GTK_IM_MODULE=xim
+
+export TERM=alacritty
diff --git a/.config/sway/hibiki b/.config/sway/hibiki
new file mode 100644
index 0000000..033ba39
--- /dev/null
+++ b/.config/sway/hibiki
@@ -0,0 +1,39 @@
+# vim: ft=i3
+
+output * scale 1
+output * bg $HOME/.background fill
+
+font pango:Iosevka Sparkle 12
+
+output * max_render_time 1
+# for_window [app_id=Alacritty] max_render_time 2
+for_window [app_id=firefox] max_render_time 3
+
+input "1:1:AT_Translated_Set_2_keyboard" {
+    xkb_options 'caps:hyper,lvl3:ralt_switch_multikey,grp:alt_space_toggle,eurosign:5'
+}
+input "2:7:SynPS/2_Synaptics_TouchPad" {
+    natural_scroll enabled
+    dwt enabled
+    tap enabled
+    click_method clickfinger
+    scroll_method two_finger
+    # pointer_accel 1
+}
+input "2:10:TPPS/2_Elan_TrackPoint" {
+    dwt enabled
+    natural_scroll enabled
+}
+
+bar {
+	swaybar_command waybar
+}
+
+exec mako
+exec kanshi
+exec swayidle \
+	timeout 540 'notify-send swayidle "screen off in 60s"' \
+	timeout 600 'sway output * dpms off' \
+		resume 'sway output * dpms on' \
+	timeout 800 suspend \
+	before-sleep lock
diff --git a/.config/sway/input.conf b/.config/sway/input.conf
new file mode 100644
index 0000000..42b959b
--- /dev/null
+++ b/.config/sway/input.conf
@@ -0,0 +1,35 @@
+# vim: ft=i3
+
+# input club kbd
+input "65261:25700:Input_Club_Infinity_keyboard/QMK" {
+    # intentionally left blank
+}
+
+# planck ez
+input "65261:24672:OLKB_Planck" {
+    xkb_options 'eurosign:5,lvl3:ralt_switch_multikey'
+}
+
+# trackball
+input "1149:8264:Primax_Kensington_Eagle_Trackball" {
+    # intentionally left blank
+}
+
+# pen + tablet
+input "10429:148:XP-PEN_STAR_G640_Pen" {
+    click_method clickfinger
+    middle_emulation disabled
+    accel_profile flat
+    drag enabled
+    tap enabled
+
+    # 331 lower pen button
+    # 332 upper pen button
+    scroll_method on_button_down
+    scroll_button 274
+
+    map_to_output HDMI-A-1
+    map_from_region 0.0x0.0 0.3x0.3
+}
+input "10429:148:XP-PEN_STAR_G640_Mouse" events disabled
+input "10429:148:XP-PEN_STAR_G640_Keyboard" events disabled
diff --git a/.config/sway/simple.conf b/.config/sway/simple.conf
new file mode 100644
index 0000000..435f235
--- /dev/null
+++ b/.config/sway/simple.conf
@@ -0,0 +1,26 @@
+set $mod Mod4
+set $left h
+set $right l
+set $up k
+set $down j
+set $term alacritty
+set $menu wofi -terminal $term -show drun
+
+bindsym $mod+Return exec $term
+bindsym $mod+Shift+q kill
+bindsym $mod+d exec $menu
+bindsym $mod+Shift+c reload
+bindsym $mod+Shift+e exit
+bindsym $mod+$left focus left
+bindsym $mod+$down focus down
+bindsym $mod+$up focus up
+bindsym $mod+$right focus 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
+bindsym $mod+f fullscreen
+bindsym $mod+Backspace seat - pointer_constraint disable
+bindsym $mod+0 seat - pointer_constraint escape
+
+exec swaynag -m $(sway --get-socketpath)