add bitwarden floating script
This commit is contained in:
parent
599e893e97
commit
653676880e
2 changed files with 37 additions and 0 deletions
|
@ -22,6 +22,9 @@ exec-once = blueman-applet &
|
|||
exec-once = waybar & hyprpaper & firefox
|
||||
exec-once = hypridle
|
||||
|
||||
# Bitwarden Window Floating
|
||||
exec-once = ~/.config/hypr/scripts/bitwarden.sh
|
||||
|
||||
# Clipboard Manager
|
||||
|
||||
exec-once = wl-paste --type text --watch cliphist store # Stores only text data
|
||||
|
|
34
dot_config/hypr/scripts/executable_bitwarden.sh
Normal file
34
dot_config/hypr/scripts/executable_bitwarden.sh
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
handle_windowtitlev2 () {
|
||||
# Description: emitted when a window title changes.
|
||||
# Format: `WINDOWADDRESS,WINDOWTITLE`
|
||||
windowaddress=${1%,*}
|
||||
windowtitle=${1#*,}
|
||||
|
||||
case $windowtitle in
|
||||
*"(Bitwarden"*"manager) - Bitwarden"*)
|
||||
hyprctl --batch \
|
||||
"dispatch togglefloating address:0x$windowaddress;"\
|
||||
"dispatch resizewindowpixel exact 20% 54%,address:0x$windowaddress;"\
|
||||
"dispatch centerwindow"
|
||||
;;
|
||||
# specificwindowtitle) commands;;
|
||||
esac
|
||||
}
|
||||
|
||||
handle() {
|
||||
# $1 Format: `EVENT>>DATA`
|
||||
# example: `workspace>>2`
|
||||
|
||||
event=${1%>>*}
|
||||
data=${1#*>>}
|
||||
|
||||
case $event in
|
||||
windowtitlev2) handle_windowtitlev2 "$data";;
|
||||
# anyotherevent) handle_otherevent "$data";;
|
||||
*) echo "unhandled event: $event" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
socat -U - UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read -r line; do handle "$line"; done
|
Loading…
Add table
Reference in a new issue