forked from extern/nix-config
sxhkd: Add separate kitty launch script
This made it possible to control the opacity of the terminal with sxhkd keybinds.
This commit is contained in:
parent
ba5675586a
commit
7833b3712f
23
sxhkd/.config/sxhkd/kitty-next.sh
Executable file
23
sxhkd/.config/sxhkd/kitty-next.sh
Executable file
@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
SOCK=$(fd kitty --base-directory /tmp -d 1)
|
||||
KITTY=$(xdotool search --class kitty)
|
||||
|
||||
[ -e "/tmp/opacity-of-terminal" ] || echo 0.9 > /tmp/opacity-of-terminal
|
||||
|
||||
[ "$1" == "up" ] && \
|
||||
NEXT=$(fish -N -c "math (cat /tmp/opacity-of-terminal) + 0.02") ||
|
||||
NEXT=$(fish -N -c "math (cat /tmp/opacity-of-terminal) - 0.02")
|
||||
|
||||
[ "$1" == "up" ] && [ "$(cat /tmp/opacity-of-terminal)" == "1" ] && NEXT=1
|
||||
[ "$1" == "down" ] && [ "$(cat /tmp/opacity-of-terminal)" == "0" ] && NEXT=0
|
||||
|
||||
echo "$NEXT" > /tmp/opacity-of-terminal
|
||||
|
||||
[ "$1" == "up" ] && \
|
||||
notify-send -t 1000 "kitty" "Increased opacity to $NEXT" ||
|
||||
notify-send -t 1000 "kitty" "Decreased opacity to $NEXT"
|
||||
|
||||
[ -n "$KITTY" ] && \
|
||||
([ -e "/tmp/$SOCK" ] && \
|
||||
(kitty @ --to "unix:/tmp/$SOCK" set-background-opacity "$NEXT"))
|
10
sxhkd/.config/sxhkd/kitty.sh
Executable file
10
sxhkd/.config/sxhkd/kitty.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
SOCK=$(fd kitty --base-directory /tmp -d 1)
|
||||
KITTY=$(xdotool search --class kitty)
|
||||
|
||||
[ -n "$KITTY" ] && \
|
||||
([ -e "/tmp/$SOCK" ] && \
|
||||
(kitty @ --to "unix:/tmp/$SOCK" launch --type=tab && \
|
||||
bspc node $KITTY -f)) \
|
||||
|| kitty --single-instance --start-as maximized
|
Loading…
Reference in New Issue
Block a user