mirror of
https://github.com/donovanglover/nix-config.git
synced 2025-05-30 22:46:10 +02:00
yambar: Add title script
This commit is contained in:
parent
6da8592a15
commit
971ce5fb63
@ -23,13 +23,17 @@ bar:
|
|||||||
left-margin: *BMARGIN
|
left-margin: *BMARGIN
|
||||||
center:
|
center:
|
||||||
-
|
-
|
||||||
foreign-toplevel:
|
script:
|
||||||
|
path: /home/donovan/.config/yambar/title.sh
|
||||||
|
args: []
|
||||||
content:
|
content:
|
||||||
map:
|
string:
|
||||||
conditions:
|
on-click:
|
||||||
~activated: {empty: {}}
|
left: sh -c '~/.config/hypr/swapmaster.sh'
|
||||||
activated:
|
right: sh -c 'hyprctl dispatch movetoworkspace special'
|
||||||
- string: {text: "{title}", max: 90, on-click: 'notify-send "app-id" "{app-id}"'}
|
middle: sh -c 'hyprctl dispatch killactive'
|
||||||
|
text: "{title}"
|
||||||
|
max: 90
|
||||||
right:
|
right:
|
||||||
-
|
-
|
||||||
battery:
|
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…
x
Reference in New Issue
Block a user