mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 10:11:43 -05:00
60 lines
1.5 KiB
Bash
Executable file
60 lines
1.5 KiB
Bash
Executable file
#! /bin/sh
|
|
#
|
|
# Example panel for LemonBoy's bar
|
|
|
|
. panel_colors-bar
|
|
|
|
while read -r line ; do
|
|
case $line in
|
|
S*)
|
|
# clock output
|
|
sys_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}"
|
|
;;
|
|
T*)
|
|
# xtitle output
|
|
title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG}${line#?}"
|
|
;;
|
|
W*)
|
|
# bspwm internal state
|
|
wm_infos=""
|
|
IFS=':'
|
|
set -- ${line#?}
|
|
while [ $# -gt 0 ] ; do
|
|
item=$1
|
|
name=${item#?}
|
|
case $item in
|
|
O*)
|
|
# focused occupied desktop
|
|
wm_infos="$wm_infos %{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{B-}%{-u}"
|
|
;;
|
|
F*)
|
|
# focused free desktop
|
|
wm_infos="$wm_infos %{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
|
|
;;
|
|
U*)
|
|
# focused urgent desktop
|
|
wm_infos="$wm_infos %{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}"
|
|
;;
|
|
o*)
|
|
# occupied desktop
|
|
wm_infos="$wm_infos %{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}${name}"
|
|
;;
|
|
f*)
|
|
# free desktop
|
|
wm_infos="$wm_infos %{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}${name}"
|
|
;;
|
|
u*)
|
|
# urgent desktop
|
|
wm_infos="$wm_infos %{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}${name}"
|
|
;;
|
|
L*)
|
|
# layout
|
|
wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}${name}"
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
;;
|
|
esac
|
|
printf "%s\n" "%{l} $wm_infos %{c} $title %{r} $sys_infos "
|
|
done
|