i3: Sort workspaces on dock

This commit is contained in:
Tobias Manske 2022-06-01 19:06:16 +02:00
parent abf0916002
commit 2906eb5bec
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG Key ID: 202689A59D645C1C
2 changed files with 51 additions and 1 deletions

View File

@ -10,12 +10,13 @@ execute_after:
# run these commands before exiting
on_failure:
- xrandr --auto
- xset s on
# These are the rules grobi tries to match to the current output configuration.
# The rules are evaluated top to bottom, the first matching rule is applied and
# processing stops.
#
# The rules belowe are written for a typical Laptop in mind, which hase several
# The rules below are written for a typical Laptop in mind, which hase several
# external connectors (HDMI2, HDMI3) in addition to the internal display
# (LVDS1). It may even be placed in a Docking Station, which adds more outputs
# that aren't present outside it.
@ -45,6 +46,7 @@ rules:
- xrandr --output DP1-1 --set "Broadcast RGB" "Full"
- xrandr --output DP1-2 --set "Broadcast RGB" "Full"
- systemctl --user start redshift-gtk.service
- /home/rad4day/.config/i3/scripts/ws-dock.sh
- name: "KIT 50.34 -118"
outputs_connected:
@ -116,6 +118,7 @@ rules:
primary: eDP1
execute_after:
- rfkill unblock wifi
- xset s on
- systemctl --user start redshift-gtk.service
# If none of the rules above match, it's a good idea to have a fallback rule
@ -126,4 +129,5 @@ rules:
primary: eDP1
execute_after:
- rfkill unblock wifi
- xset s on
- systemctl --user start redshift-gtk.service

46
i3/scripts/ws-dock.sh Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
exec &>/dev/null
# This script moves all ws where they are supposed to be when my Framework is docked.
# It is called by Grobi execute_after
center() {
i3-msg "workspace $1"
i3-msg "move workspace to output DP1"
}
left() {
i3-msg "workspace $1"
i3-msg "move workspace to output DP3-2"
}
right() {
i3-msg "workspace $1"
i3-msg "move workspace to output DP3-1"
}
FOCUS="$(i3-msg -t get_workspaces | jq '.[] | select(.focused==true).name' | cut -d"\"" -f2)"
center 1
center 2
center 3
center 4
center 5
center 6
center 7
center 8
center 9
center 10
center F3
center F4
center F5
center F6
center F7
center F8
center F9
center F10
left F1
right F2
i3-msg "workspace $FOCUS"