Add picom inactive window opacity automatic toggle
Whenever i3 is using gapless mode, all windows will be opaque. When gaps are shown inactive windows will have some transparency and blur behind them. Script can be invoked manually with `picom_toggle_inactive_opacity` to toggle, `picom_toggle_inactive_opacity on` or `picom_toggle_inactive_opacity off` to set it respectively.
This commit is contained in:
parent
717b9d9096
commit
3d1438f657
4 changed files with 47 additions and 14 deletions
27
.local/bin/picom_toggle_inactive_opacity
Executable file
27
.local/bin/picom_toggle_inactive_opacity
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/bash
|
||||
# toggle the translucency of inactive windows in the picom compositor
|
||||
# by substituting the true/false setting in the picom config file.
|
||||
# picom will automatically reload its settings on any config file changes.
|
||||
#
|
||||
# scipt can be called without arguments to toggle the value;
|
||||
# or with on / off to set it to translucent / opaque, respectively.
|
||||
|
||||
piconf="$XDG_CONFIG_HOME"/picom/picom.conf
|
||||
|
||||
line=$(grep -n "inactive-opacity-override" "$piconf")
|
||||
|
||||
IFS=: read -r line text < <(grep -n "inactive-opacity-override" "$piconf")
|
||||
|
||||
_replace() { # line file old new
|
||||
sed -i "$1 s/$3/$4/" "$2"
|
||||
}
|
||||
|
||||
if [ "$1" = "off" ]; then
|
||||
_replace "$line" "$piconf" "true" "false"
|
||||
elif [ "$1" = "on" ]; then
|
||||
_replace "$line" "$piconf" "false" "true"
|
||||
elif echo "$text" | grep -q "true"; then
|
||||
_replace "$line" "$piconf" "true" "false"
|
||||
elif echo "$text" | grep -q "false"; then
|
||||
_replace "$line" "$piconf" "false" "true"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue