mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-09 10:48:01 -08:00
update
This commit is contained in:
42
.config/rofi/scripts/rofi-picom.sh
Executable file
42
.config/rofi/scripts/rofi-picom.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BASE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/picom"
|
||||
HIGH_TRANSPARENCY=picom-hightransparency.conf
|
||||
NO_TRANSPARENCY=picom-notransparency.conf
|
||||
|
||||
ARGS=(
|
||||
"1. High Transparency"
|
||||
"2. No Transparency"
|
||||
"3. No Picom"
|
||||
"4. Quit"
|
||||
)
|
||||
|
||||
CHOICE=$(printf "%s\n" "${ARGS[@]}" | rofi -theme-str 'window {width: 45%;}' -config ~/.config/rofi/aniwrapper-dracula.rasi -dmenu -l 5 -i -p "Picom Options")
|
||||
SELECTION=$(awk '{print $1}' <<< "$CHOICE")
|
||||
conf=""
|
||||
case "$SELECTION" in
|
||||
1.)
|
||||
conf="$BASE_DIR/$HIGH_TRANSPARENCY"
|
||||
;;
|
||||
2.)
|
||||
conf="$BASE_DIR/$NO_TRANSPARENCY"
|
||||
;;
|
||||
3.)
|
||||
killall -q picom
|
||||
exit $?
|
||||
;;
|
||||
4.)
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -z "$conf" ] && conf="$BASE_DIR/picom.conf"
|
||||
|
||||
if pgrep 'picom' > /dev/null; then
|
||||
killall -q picom && sleep 0.1
|
||||
fi
|
||||
|
||||
picom --config="$conf" > /dev/null 2>&1 &
|
||||
Reference in New Issue
Block a user