diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-10-05 13:25:34 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-10-05 13:25:34 -0500 |
commit | 49af7de8ce8d83bd0d8766cb91bd83f4117cb340 (patch) | |
tree | 45d8f8663f47ade9bc9792be66ed7e25bdc818e6 /sway | |
parent | 23c03cd2fde16eeaac9a0647f70d89f1f9661fcc (diff) |
fix(sway): import env vars and add vrr script
Diffstat (limited to 'sway')
-rw-r--r-- | sway/.config/sway/config | 30 | ||||
-rwxr-xr-x | sway/.local/bin/import-gsettings (renamed from sway/.local/lib/sway/import-gsettings) | 0 | ||||
-rwxr-xr-x | sway/.local/bin/sway-vrr | 24 |
3 files changed, 32 insertions, 22 deletions
diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 1446fc5..8746211 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -5,9 +5,6 @@ set $down j set $up k set $right l -set $out1 - -set $out2 - - set $ws01 1 set $ws02 2 set $ws03 3 @@ -36,8 +33,6 @@ set $base0D #83a598 set $base0E #d3869b set $base0F #d65d0e -include ~/.config/sway/config.d/* - set $menu $HOME/.local/bin/wmenu set $j4_sock $XDG_RUNTIME_DIR/j4-dmenu-desktop.sock @@ -57,17 +52,6 @@ force_display_urgency_hint 1000 ms default_border pixel hide_edge_borders --i3 smart -workspace $ws01 output $out1 $out2 -workspace $ws02 output $out1 $out2 -workspace $ws03 output $out1 $out2 -workspace $ws04 output $out1 $out2 -workspace $ws05 output $out1 $out2 -workspace $ws06 output $out2 $out1 -workspace $ws07 output $out2 $out1 -workspace $ws08 output $out2 $out1 -workspace $ws09 output $out2 $out1 -workspace $ws10 output $out2 $out1 - output * bg ~/.local/share/gruvbox/sway.png fill for_window [shell=".*"] inhibit_idle fullscreen @@ -266,12 +250,14 @@ bar { } } +include ~/.config/sway/config.d/* include /etc/sway/config.d/* -exec_always pgrep -x j4-dmenu-deskto || j4-dmenu-desktop --dmenu="$menu" --term-mode=$TERMINAL -I --wait-on=$j4_sock +exec j4-dmenu-desktop --dmenu="$menu" --term-mode=$TERMINAL -I --wait-on=$j4_sock -exec { - import-gsettings - systemctl --user start sway-session.target - swaymsg "workspace $ws06; workspace $ws01" -} +exec import-gsettings + +exec systemctl --user import-environment +exec systemctl --user start sway-session.target + +exec swaymsg "workspace $ws06; workspace $ws01" diff --git a/sway/.local/lib/sway/import-gsettings b/sway/.local/bin/import-gsettings index 93cd75b..93cd75b 100755 --- a/sway/.local/lib/sway/import-gsettings +++ b/sway/.local/bin/import-gsettings diff --git a/sway/.local/bin/sway-vrr b/sway/.local/bin/sway-vrr new file mode 100755 index 0000000..e989ce9 --- /dev/null +++ b/sway/.local/bin/sway-vrr @@ -0,0 +1,24 @@ +#!/bin/sh + +swaymsg -t subscribe -m '[ "window" ]' | + jq -c --unbuffered 'select(.change == "focus" or .change == "fullscreen_mode") | .container | + if .fullscreen_mode == 1 then + { "id": .id, "sync": "enabled", "rt": 1 } + else + { "id": .id, "sync": "disabled", "rt": 0 } + end' | + while read -r vals; do + swaymsg -t get_tree | jq -r --argjson vals "$vals" --arg regex "$1" '.nodes[] | + select((.. | .nodes?[]?.nodes?[]?.id == $vals.id) and (.name | test($regex))) | + if .adaptive_sync_status != $vals.sync then + [ .name, "adaptive_sync", $vals.sync ] | @sh + else + empty + end, + if .max_render_time != $vals.rt then + [ .name, "max_render_time", ($vals.rt | if . == 0 then "off" else . end) ] | @sh + else + empty + end' + done | + xargs -l1 swaymsg output |