fix nvim config
This commit is contained in:
30
roles/hyprland/files/hypr/scripts/close-monokai-popup.sh
Executable file
30
roles/hyprland/files/hypr/scripts/close-monokai-popup.sh
Executable file
@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SOCKET="/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock"
|
||||
|
||||
handle_line() {
|
||||
local line="$1"
|
||||
|
||||
# Split into EVENT and DATA (EVENT>>DATA)
|
||||
local event="${line%%>>*}"
|
||||
local data="${line#*>>}"
|
||||
|
||||
case "$event" in
|
||||
openwindow)
|
||||
# Data format:
|
||||
# WINDOWADDRESS,WORKSPACENAME,WINDOWCLASS,WINDOWTITLE
|
||||
local addr ws class title
|
||||
|
||||
IFS=, read -r addr ws class title <<< "$data"
|
||||
|
||||
if [[ "$class" == "jetbrains-webstorm" && "$title" == "Monokai Pro Trial" ]]; then
|
||||
# closewindow expects address with 0x prefix
|
||||
hyprctl dispatch closewindow "address:0x$addr"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
socat -U - "UNIX-CONNECT:$SOCKET" | while read -r line; do
|
||||
handle_line "$line"
|
||||
done
|
||||
Reference in New Issue
Block a user