Sway : Dim inactive windows.

This commit is contained in:
Dmitry Voronin 2024-03-31 01:37:15 +03:00
parent b8d8147cb9
commit 11ab47ba94
3 changed files with 9 additions and 1 deletions

View file

@ -16,6 +16,7 @@
mako # Notification system.
networkmanagerapplet # Internet configuration.
pamixer pavucontrol pulseaudio # Audio.
sway-contrib.inactive-windows-transparency
wl-clipboard # Clipboard.
];
@ -34,6 +35,7 @@
variables = {
FOOT_CONFIG = ./foot/Foot.ini;
SWAY_CONFIG = ./sway/module;
SWAY_SCRIPT_IWT = "${pkgs.sway-contrib.inactive-windows-transparency}/bin/inactive-windows-transparency.py";
# PATH = [ "/etc/swaybin" ]; # NOTE: Kept as an example on PATH modification.
};
};

View file

@ -146,7 +146,10 @@ function _twice() {
local period=${1}
local command="${@:2}"
[[ "$(cat ${file} 2> /dev/null)" = "${command}" ]] && ${command}
if [[ "$(cat ${file} 2> /dev/null)" = "${command}" ]]; then
${command}
return 0
fi
echo "${command}" > "${file}"
sleep ${period}
rm "${file}" 2> /dev/null

View file

@ -16,3 +16,6 @@ bindsym $mod+c layout toggle split tabbed
# Fullscreen.
bindsym $mod+f fullscreen
# Dim inactive windows.
exec $SWAY_SCRIPT_IWT --opacity 0.85