forked from extern/nix-config
yambar: Add title script
This commit is contained in:
parent
6da8592a15
commit
971ce5fb63
@ -23,13 +23,17 @@ bar:
|
||||
left-margin: *BMARGIN
|
||||
center:
|
||||
-
|
||||
foreign-toplevel:
|
||||
script:
|
||||
path: /home/donovan/.config/yambar/title.sh
|
||||
args: []
|
||||
content:
|
||||
map:
|
||||
conditions:
|
||||
~activated: {empty: {}}
|
||||
activated:
|
||||
- string: {text: "{title}", max: 90, on-click: 'notify-send "app-id" "{app-id}"'}
|
||||
string:
|
||||
on-click:
|
||||
left: sh -c '~/.config/hypr/swapmaster.sh'
|
||||
right: sh -c 'hyprctl dispatch movetoworkspace special'
|
||||
middle: sh -c 'hyprctl dispatch killactive'
|
||||
text: "{title}"
|
||||
max: 90
|
||||
right:
|
||||
-
|
||||
battery:
|
||||
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.5 KiB |
19
yambar/.config/yambar/title.sh
Executable file
19
yambar/.config/yambar/title.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare title
|
||||
|
||||
# LATER: Use hyprevents instead of while true
|
||||
while true; do
|
||||
title="$(hyprctl activewindow -j | jq -r '.title')"
|
||||
|
||||
if [[ "$title" == "null" ]]; then
|
||||
title="♫ $(mpc status | head -n 1)"
|
||||
fi
|
||||
|
||||
printf -- '%s\n' "title|string|${title}"
|
||||
printf -- '%s\n' ""
|
||||
|
||||
sleep 0.1
|
||||
done
|
||||
|
||||
unset title
|
Loading…
Reference in New Issue
Block a user