Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mein Dzen-Panel für BSPWM
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Kutus
n00b
n00b


Joined: 11 Aug 2018
Posts: 26

PostPosted: Fri Apr 22, 2022 7:32 pm    Post subject: Mein Dzen-Panel für BSPWM Reply with quote

Hi. Kennt sich hier jemand mit Dzen2 aus? Habe BSPWM im Einsatz und die Beispiel-Scripts etwas modifiziert, da diese Lemonbar nutzen.
Aktuell will ich nur die Workspaces anzeigen lassen, aber diese wenn möglich links ausrichten. Dzen bietet dafür die Option ta -l.
Hat einer ne Idee an welcher Stelle ich die Option einfügen muss, damit die ganzen Workspaces ganz links anliegen und nicht mittig?
Weil jedes Mal, wenn ich von einem leeren Workspace auf einen mit Apps wechsle, springen die Workspaces etwas, wegen dem State-Flag, was etwas störend ist.

Hier meine beiden Scripte:

panel:

Code:

#!/bin/sh

PANEL_FIFO=/home/your-user/bin/fifo/panel-fifo
PANEL_HEIGHT=24
PANEL_FONT="-*-fixed-*-*-*-*-10-*-*-*-*-*-*-*"
PANEL_WM_NAME=bspwm_panel
export PANEL_FIFO PANEL_HEIGHT PANEL_FONT PANEL_WM_NAME

if xdo id -a "$PANEL_WM_NAME" > /dev/null ; then
   printf "%s\n" "The panel is already running." >&2
   exit 1
fi

trap 'trap - TERM; kill 0' INT TERM QUIT EXIT

[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
mkfifo "$PANEL_FIFO"

bspc subscribe report > "$PANEL_FIFO" &

panel_bar < "$PANEL_FIFO" | dzen2 -ta l -bg '#333232' | sh &

wid=$(xdo id -m -a "$PANEL_WM_NAME")
xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" "$wid"

wait


panel_bar:

Code:

#!/bin/sh

. panel_colors

num_mon=$(bspc query -M | wc -l)

while read -r line ; do
   case $line in
      W*)
         # bspwm's state
         wm=
         IFS=':'
         set -- ${line#?}
         while [ $# -gt 0 ] ; do
            item=$1
            name=${item#?}
            case $item in
               [OoFfUu]*)
                  # desktops
                  case $item in
                     O*)
                        # focused occupied desktop
                        FG=$COLOR_FOCUSED_OCCUPIED_FG
                        BG=$COLOR_FOCUSED_OCCUPIED_BG
                        ;;
                     F*)
                        # focused free desktop
                        FG=$COLOR_FOCUSED_FREE_FG
                        BG=$COLOR_FOCUSED_FREE_BG
                                              ;;
                     U*)
                        # focused urgent desktop
                        FG=$COLOR_FOCUSED_URGENT_FG
                        BG=$COLOR_FOCUSED_URGENT_BG
                        ;;
                     o*)
                        # occupied desktop
                        FG=$COLOR_OCUPPIED_FG
                        BG=$COLOR_OCUPPIED_BG
                        ;;
                     f*)
                        # free desktop
                        FG=$COLOR_FREE_FG
                        BG=$COLOR_FREE_BG
                        ;;
                     u*)
                        # urgent desktop
                        FG=$COLOR_URGENT_FG
                        BG=$COLOR_URGENT_BG
                        ;;
                  esac
                  wm="${wm}^fg(${FG})^bg(${BG}) ${name}"
                  ;;
               [LTG]*)
                  # layout, state and flags
                  wm="${wm}^fg(${COLOR_STATE_FG})^bg(${COLOR_STATE_BG}) ${name}"
                  ;;
            esac
            shift
         done
         ;;
   esac
   printf "%s\n" "${wm}"
done


Edit: Hab die richtige Stelle gefunden. Es ist hier: panel_bar < "$PANEL_FIFO" | dzen2 -ta l -bg '#333232' | sh & :D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum