aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-12-20 23:55:49 +0200
committersrdusr <trevorgray@srdusr.com>2023-12-20 23:55:49 +0200
commit6cbcdfbd8705d1ee516219bc77969de08ee6785e (patch)
tree48b5eff21791e45f38ad96325a7e0d0e63cefad7
parent8531b174f8aa642d7fbc3cde6cf85cf90943b07c (diff)
downloaddotfiles-6cbcdfbd8705d1ee516219bc77969de08ee6785e.tar.gz
dotfiles-6cbcdfbd8705d1ee516219bc77969de08ee6785e.zip
Add update-title
-rwxr-xr-xupdate-title21
1 files changed, 21 insertions, 0 deletions
diff --git a/update-title b/update-title
new file mode 100755
index 0000000..60efe12
--- /dev/null
+++ b/update-title
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+while true; do
+ bg_color="#000000" # Initial background color
+ text_color="#979286"
+ font="%{T1}"
+
+ active_node=$(xdotool getactivewindow)
+
+ if [[ "$1" -eq "$active_node" ]]; then
+ bg_color="#000000" # Change the background color when the window is active
+ text_color="#FFFFFF"
+ font="%{T2}"
+ fi
+
+ title=$(xtitle "$1")
+
+ echo -e "%{B$bg_color}%{F$text_color}$font%{c}%{A1:bspc node $1 -f:}%{A2:bspc node $1 -c:}%{A5:bspc node $1 -d last:}%{A4:bspc node $1 -s biggest && ~/.scripts/title-bar:}$title%{A}%{A}%{A}%{A}%{F#909090}%{r}%{A:bspc node $1 -c:}x %{A}"
+
+ sleep 0.5
+done