Sway : Use toggles for vrr and monitor.

This commit is contained in:
Dmitry Voronin 2024-03-29 06:55:26 +03:00
parent 07eaa788ec
commit e310f16479
10 changed files with 41 additions and 26 deletions

View file

@ -44,10 +44,8 @@
variables = {
FOOT_CONFIG = ./foot/Foot.ini;
SWAY_CONFIG = ./sway/module;
PATH = [ "/etc/swaybin" ];
};
etc.swaybin.source = ./sway/bin;
extraInit = ''
export PATH="/etc/swaybin:$PATH"
'';
};
}

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power off'

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165" power on'

17
module/sway/bin/montoggle Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
IFS=$'\n'
monitors=(
"ASUSTek COMPUTER INC ASUS VA24E R2LMTF127165"
)
disabled="$(swaymsg -t get_outputs | grep power.*false)"
if [[ "${disabled}" = "" ]]; then
action="off"
else
action="on"
fi
for monitor in ${monitors[@]}; do
swaymsg "output \"${monitor}\" power ${action}"
done

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync off'

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
swaymsg 'output "Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622" adaptive_sync on'

17
module/sway/bin/vrrtoggle Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
IFS=$'\n'
monitors=(
"Huawei Technologies Co., Inc. ZQE-CBA 0xC080F622"
)
enabled="$(swaymsg -t get_outputs | grep adaptive_sync_status.*enabled)"
if [[ "${enabled}" = "" ]]; then
action="on"
else
action="off"
fi
for monitor in ${monitors[@]}; do
swaymsg "output \"${monitor}\" adaptive_sync ${action}"
done

View file

@ -21,14 +21,8 @@ bindsym $mod+Shift+c reload
bindsym $mod+Shift+z exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
# Show last notification.
bindsym $mod+m exec makoctl restore
bindsym $mod+shift+m exec makoctl dismiss --all
# Bluetooth.
bindsym $mod+b exec 'blueman-manager'
# NetworkManager.
bindsym $mod+n exec 'nm-connection-editor'
bindsym $mod+n exec makoctl restore
bindsym $mod+shift+n exec makoctl dismiss --all
# Brightness
bindsym XF86MonBrightnessDown exec light -U 10
@ -38,6 +32,3 @@ bindsym XF86MonBrightnessUp exec light -A 10
bindsym XF86AudioRaiseVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ +1%'
bindsym XF86AudioLowerVolume exec 'pactl set-sink-volume @DEFAULT_SINK@ -1%'
bindsym XF86AudioMute exec 'pactl set-sink-mute @DEFAULT_SINK@ toggle'
# Open sound control. # NOTE: Get id with `swaymsg -t get_tree`.
bindsym $mod+p exec 'pavucontrol'

View file

@ -1,5 +1,6 @@
# Sway has a "scratchpad", which is a bag of holding for windows.
# You can send windows there and get them back later.
# NOTE: Get id with `swaymsg -t get_tree`.
# Move the currently focused window to the scratchpad
bindsym $mod+shift+return move scratchpad

View file

@ -4,3 +4,6 @@ background-color=#282828
text-color=#ffffff
border-color=#000000
default-timeout=5000
width=480
height=120
margin=16