140 lines
3.2 KiB
Bash
140 lines
3.2 KiB
Bash
# vim: ft=zsh
|
|
|
|
# Which modules to load
|
|
mods=(
|
|
bspwm_desktop_pager
|
|
bspwm_taskbar
|
|
network_status
|
|
date
|
|
load
|
|
)
|
|
|
|
# Define the *look* of your panel here
|
|
function panel_draw {
|
|
panel_data=(
|
|
"$out[bspwm_desktop_pager]"
|
|
"$out[bspwm_taskbar]"
|
|
"%{r}"
|
|
"%{F$panel_bg_focused}%{F-}%{B$panel_bg_focused}"
|
|
""
|
|
"LA: $out[load]"
|
|
""
|
|
"Network: $out[network_status]"
|
|
" "
|
|
"$out[date]"
|
|
""
|
|
"%{B-}"
|
|
)
|
|
|
|
printf '%s\n' "$panel_data"
|
|
}
|
|
|
|
function panel_pre_start {
|
|
# Set bspwm top padding
|
|
bspc config top_padding "$(( panel_h + bspwm_window_gap ))"
|
|
}
|
|
|
|
function panel_post_start {
|
|
# Set the layer on which lemonbar resides
|
|
xdo above -t $( xdo id -n root ) $( xdo id -a $panel_window_name )
|
|
}
|
|
|
|
function panel_cleanup_misc {
|
|
# Reset bspwm top padding
|
|
bspc config top_padding 0
|
|
}
|
|
|
|
# General config
|
|
# ==============
|
|
|
|
# fifo location
|
|
#panel_fifo="$XDG_RUNTIME_DIR/frozenbar.fifo"
|
|
|
|
# Window name
|
|
panel_window_name='frozenbar'
|
|
|
|
## Colours
|
|
# I source a common config so that all my scripts share the same colours
|
|
source ~/.config/common/colours
|
|
panel_fg_normal=$colour_fg
|
|
panel_fg_focused=$colour_fg_active
|
|
panel_bg_normal=$colour_bg
|
|
panel_bg_focused=$colour_bg_active
|
|
|
|
## Fonts
|
|
panel_fontspec='-*-terminesspowerline-medium-*-normal-*-14-*-*-*-*-*-iso10646-*'
|
|
|
|
## Get root window data to automatically set up the panel's dimensions and position
|
|
get_rootwin_data
|
|
|
|
## We use bspwm, and we need to know its settings
|
|
source ~/.config/common/bspwm
|
|
|
|
## Set the panel dimensions and position
|
|
panel_h='14'
|
|
panel_w=$(( root_win_w - ( bspwm_window_gap * 2 ) ))
|
|
panel_geometry="${panel_w}x${panel_h}+${bspwm_window_gap}+${bspwm_window_gap}"
|
|
|
|
## How many clickable areas are available to use:
|
|
panel_clickable_areas='128'
|
|
|
|
# Module configs
|
|
# ==============
|
|
|
|
# bspwm_desktop_pager
|
|
# -------------------
|
|
declare -A bspwm_desktop_pager
|
|
bspwm_desktop_pager[colour_focused]=$panel_bg_focused
|
|
bspwm_desktop_pager[show_empty_tags]=0
|
|
|
|
declare -a bspwm_desktop_pager_blacklist
|
|
bspwm_desktop_pager_blacklist=( 'h' )
|
|
|
|
# bspwm_taskbar
|
|
# -------------
|
|
declare -A bspwm_taskbar
|
|
declare -a bspwm_taskbar_blacklist
|
|
bspwm_taskbar[focused_only]=0
|
|
bspwm_taskbar[counter]=1
|
|
bspwm_taskbar[fg_normal]='#bebebe'
|
|
bspwm_taskbar[fg_focused]=$panel_fg_normal
|
|
bspwm_taskbar[start]="%{F$panel_bg_normal}%{B$panel_bg_focused}%{F-} "
|
|
bspwm_taskbar[end]="%{F$panel_bg_focused} %{B-}%{F-}"
|
|
bspwm_taskbar[max_size]=132
|
|
bspwm_taskbar_blacklist=( 'h' )
|
|
|
|
# bspwm_date
|
|
# ----------
|
|
declare -A date
|
|
date[format]='%A, %Y.%m.%d %H:%M:%S'
|
|
|
|
# simple_launcher
|
|
# ---------------
|
|
declare -A simple_launcher
|
|
simple_launcher[start]="%{F$panel_bg_normal}%{B$panel_bg_focused}%{F-}"
|
|
simple_launcher[end]="%{F$panel_bg_focused} %{B-}%{F-}"
|
|
|
|
# network_status
|
|
# --------------
|
|
mod_network_status_check_rate=10
|
|
mod_network_status_ok='%{F#00FF00}ok%{F-}'
|
|
mod_network_status_warn='%{F#FFFF00}WARN%{F-}'
|
|
mod_network_status_fail='%{F#FF0000}FAIL%{F-}'
|
|
|
|
network_status_hosts=(
|
|
de-ber-as20647.anchors.atlas.ripe.net
|
|
nl-ams-as1101.anchors.atlas.ripe.net
|
|
uk-boh-as196745.anchors.atlas.ripe.net
|
|
)
|
|
|
|
out[network_status]='%{F#FFFF00}checking...%{F-}'
|
|
|
|
# mod_load
|
|
# --------
|
|
mod_load_crit=4
|
|
mod_load_warn=3
|
|
|
|
mod_load_warn_colour='#FFFF00'
|
|
mod_load_crit_colour='#FF0000'
|
|
mod_load_ok_colour='#00FF00'
|