From 2477463f29bb430b5948a3de636f619608ea720b Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 28 Apr 2023 17:34:08 +0200 Subject: Update hlwm for use within KDE --- .config/herbstluftwm/panel-bot.sh | 86 --------------------------------------- 1 file changed, 86 deletions(-) delete mode 100755 .config/herbstluftwm/panel-bot.sh (limited to '.config/herbstluftwm/panel-bot.sh') diff --git a/.config/herbstluftwm/panel-bot.sh b/.config/herbstluftwm/panel-bot.sh deleted file mode 100755 index a42ea1e..0000000 --- a/.config/herbstluftwm/panel-bot.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env bash - -hc() { "${herbstclient_command[@]:-herbstclient}" "$@" ; } -quote() { local q="$(printf '%q ' "$@")"; printf '%s' "${q% }" ; } -uniq_linebuffered() { awk '$0 != l { print ; l=$0 ; fflush(); }' "$@"; } - -monitor=${1:-0} - -hc attr "monitors.$monitor" > /dev/null || { printf "Invalid monitor $monitor" && exit 1 ; } - -monitor_offset_x=$(hc monitor_rect "$monitor" | awk '{print $1 }') -monitor_offset_y=$(hc monitor_rect "$monitor" | awk '{print $2 }') -monitor_width=$(hc monitor_rect "$monitor" | awk '{ print $3 }') -monitor_height=$(hc monitor_rect "$monitor" | awk '{ print $4 }') -panel_height=21 -panel_color_bg="$(hc get frame_border_normal_color)" -panel_color_fg="#efefef" -panel_color_focus="$(hc get frame_border_active_color)" -panel_font="Liberation Mono:size=9" -panel_offset_x=$(( monitor_offset_x )) -panel_offset_y=$(( monitor_offset_y + monitor_height - panel_height )) - -{ - hc --idle -} 2> /dev/null | { - while : - do - # Wait for an event - IFS=$'\t' read -ra event || break - - # Declare clients as an array - declare -a clients - - # Check which tag the monitor is on now - monitor_tag="$(herbstclient attr "monitors.$monitor.tag")" - - # Collect all clients on the monitor - for client in $(hc attr clients | grep '0x') - do - [[ "$(hc attr "clients.$client.tag")" != $monitor_tag ]] && continue - - clients+=("$client") - done - - name_offset_interval=$(( monitor_width / ${#clients[@]} )) - - # Look up current focus window - focus="$(hc attr clients.focus.winid)" - - # Loop through the clients to create a representation - index=0 - - for client in "${clients[@]}" - do - - if [[ "$client" == "$focus." ]] - then - color_fg="$panel_color_focus" - else - color_fg="$panel_color_fg" - fi - - name=" $(hc attr "clients.$client.title") " - name_width=$(xftwidth "$panel_font" "$name") - name_offset=$(( name_offset_interval * index )) - - printf "^pa(%s)^bg(%s)^fg(%s)^ca(1,%s)%s^ca()" \ - "$name_offset" \ - "$panel_color_bg" \ - "$color_fg" \ - "herbstclient jumpto '$client'" \ - "$name" - - index=$(( index + 1 )) - done - - # Add a newline - printf "\n" - - # Clean up some variables - unset clients - unset index - done -} | dzen2 -w "$monitor_width" -x "$panel_offset_x" -y "$panel_offset_y" -fn "$panel_font" -h "$panel_height" \ - -e "button3=;button4=exec:$hc_quoted use_index -1;button5=exec:$hc_quoted use_index +1" \ - -ta l -bg "$panel_color_bg" -fg "$panel_color_fg" -- cgit v1.1