diff --git a/i3/desktop.conf b/i3/desktop.conf index 8f8a703..ec7a7e9 100644 --- a/i3/desktop.conf +++ b/i3/desktop.conf @@ -13,7 +13,7 @@ workspace $ws10 output HDMI-0 mode "$g13" { bindsym 1 exec --no-startup-id cat ~/.config/g13/overwatch.bind > /tmp/g13-0 && sleep .1 && cat ~/.config/g13/overwatch.lpbm > /tmp/g13-0; mode "default" bindsym 2 exec --no-startup-id cat ~/.config/g13/resolve.bind > /tmp/g13-0 && sleep .1 && cat ~/.config/g13/resolve.lpbm > /tmp/g13-0; mode "default" - + bindsym 3 exec --no-startup-id python3 ~/.config/scripts/i3-toggle.sh up; mode "default" bindsym Escape mode "default" bindsym Return mode "default" } @@ -34,7 +34,7 @@ for_window [title="Google Play Music Desktop Player"] move to workspace $ws10 for_window [class="Wine" title="Overwatch"] move to workspace $ws4 for_window [class="Wine" title="Overwatch"] exec --no-startup-id cat ~/.config/g13/overwatch.bind > /tmp/g13-0 && sleep .1 && cat ~/.config/g13/overwatch.lpbm > /tmp/g13-0 for_window [class="Wine" title="Blizzard Battle.net"] move to workspace $ws4 -for_window [class="Lutris"] move to workspace $ws8 +for_window [class="Lutris"] move to workspace $ws4 # Starting DaVinci Resolve for_window [class="resolve"] move to workspace $ws1 @@ -58,4 +58,9 @@ for_window [title="^Steam Keyboard$"] floating enable # Jetbrains for_window [class="^com-intellij-updater-Runner$" title="^Update$"] floating enable -for_window [instance="^sun-awt-X11-XDialogPeer$" title="^Complete Installation$"] floating enable \ No newline at end of file +for_window [instance="^sun-awt-X11-XDialogPeer$" title="^Complete Installation$"] floating enable + +# The side buttons move the window around +bindsym --whole-window button9 exec python3 ~/.config/scripts/i3-mouse.py back +bindsym --whole-window button8 exec python3 ~/.config/scripts/i3-mouse.py forward + diff --git a/scripts/i3-mouse.py b/scripts/i3-mouse.py new file mode 100644 index 0000000..d1b575a --- /dev/null +++ b/scripts/i3-mouse.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import i3ipc +import sys +import os + + +up = sys.argv[1] == 'up' + +i3 = i3ipc.Connection() +focused = i3.get_tree().find_focused() +if focused.window_instance not in ['overwatch.exe']: + if sys.argv[1] == 'forward': + os.system('i3-msg workspace prev_on_output') + else: + os.system('i3-msg workspace next_on_output')