renamed: .config/bspwm/bspwmrc -> bspwm/bspwmrc
renamed: .config/bspwm/conky.conf -> bspwm/conky.conf renamed: .config/bspwm/panel -> bspwm/panel
This commit is contained in:
42
bspwm/bspwmrc
Executable file
42
bspwm/bspwmrc
Executable file
@@ -0,0 +1,42 @@
|
||||
#! /usr/bin/bash
|
||||
|
||||
# bspwm config
|
||||
bspc config border_width 2
|
||||
bspc config window_gap 4
|
||||
|
||||
bspc config split_ratio 0.50
|
||||
bspc config borderless_monocle true
|
||||
bspc config gapless_monocle true
|
||||
bspc config ignore_ewmh_focus true
|
||||
bspc config click_to_focus true
|
||||
|
||||
# color
|
||||
bspc config focused_border_color "#517ba2"
|
||||
bspc config presel_feedback_color "#517ba2"
|
||||
|
||||
# desktops
|
||||
monitors=$(bspc query -M)
|
||||
array=(${monitors})
|
||||
|
||||
if [ ${#array[@]} -eq 2 ]; then
|
||||
bspc monitor ${array[0]} -d web games
|
||||
bspc monitor ${array[1]} -d term misc
|
||||
else
|
||||
bspc monitor -d term web games misc
|
||||
fi
|
||||
|
||||
# application rules
|
||||
bspc rule -a Opera desktop=web
|
||||
bspc rule -a Steam follow=off state=floating desktop=games
|
||||
bspc rule -a Galculator state=floating
|
||||
bspc rule -a RocketLeague border=off
|
||||
bspc rule -a Nvidia-settings state=floating
|
||||
bspc rule -a obs state=floating
|
||||
bspc rule -a Pavucontrol state=floating
|
||||
bspc rule -a "TeamSpeak 3" state=floating
|
||||
|
||||
# hotkey daemon
|
||||
sxhkd &
|
||||
|
||||
# panel
|
||||
~/.config/bspwm/panel &
|
||||
23
bspwm/conky.conf
Normal file
23
bspwm/conky.conf
Normal file
@@ -0,0 +1,23 @@
|
||||
-- vim: ts=4 sw=4 noet ai cindent syntax=lua
|
||||
conky.config = {
|
||||
update_interval = 1,
|
||||
cpu_avg_samples = 1,
|
||||
net_avg_samples = 1,
|
||||
short_units = true,
|
||||
out_to_console = true,
|
||||
out_to_x = false,
|
||||
own_window = false,
|
||||
}
|
||||
|
||||
conky.text = [[
|
||||
S\
|
||||
%{c}\
|
||||
%{F\#ff517ba2}%{B-}%{F\#ffffffff}%{B\#ff517ba2} ${upspeedf br0}K \
|
||||
%{F\#ff3d3d3d}%{B\#ff517ba2}%{F\#ffffffff}%{B\#ff3d3d3d} ${downspeedf br0}K \
|
||||
%{F\#ff517ba2}%{B\#ff3d3d3d}%{F\#ffffffff}%{B\#ff517ba2} ${hwmon 0 temp 1}°%{B\#ff3d3d3d}\
|
||||
%{F\#ff517ba2}%{B\#ff3d3d3d} %{F\#ffffffff}%{B\#ff3d3d3d} ${cpu cpu0}%\
|
||||
%{F\#ff3d3d3d}%{B\#ff517ba2} %{F\#ffffffff}%{B\#ff517ba2} ${mem}%{B-}%{F\#ff517ba2}\
|
||||
%{r}\
|
||||
%{F\#ff517ba2}%{B-}%{F\#ffffffff}%{B\#ff517ba2} ${texeci 60 mosquitto_sub -C 1 -t "study/sensor/temperature"}° \
|
||||
%{F\#ff3d3d3d}%{B\#ff3d3d3d}%{F\#ffffffff} ${time %a %b %d, %T} %{B-}%{F\#ff3d3d3d}\
|
||||
]]
|
||||
95
bspwm/panel
Executable file
95
bspwm/panel
Executable file
@@ -0,0 +1,95 @@
|
||||
#! /usr/bin/bash
|
||||
PANEL_FIFO=/tmp/panel-fifo
|
||||
PANEL_HEIGHT=16
|
||||
PANEL_FONT="-misc-tamlin-medium-r-normal--16-116-100-100-c-80-iso10646-1"
|
||||
PANEL_WM_NAME=bspwm_panel
|
||||
|
||||
COLOR_BLACK="#000000"
|
||||
COLOR_GREY1="#d6d3d2"
|
||||
COLOR_GREY2="#a7a5a5"
|
||||
COLOR_GREY3="#504e4e"
|
||||
|
||||
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"
|
||||
|
||||
num_mon=$(bspc query -M | wc -l)
|
||||
|
||||
conky -c ~/.config/bspwm/conky.conf > "$PANEL_FIFO" &
|
||||
bspc config top_padding $PANEL_HEIGHT
|
||||
bspc subscribe report > "$PANEL_FIFO" &
|
||||
|
||||
while read -r line ; do
|
||||
case $line in
|
||||
S*)
|
||||
# conky output
|
||||
sys="${line#?}"
|
||||
;;
|
||||
W*)
|
||||
# bspwm's state
|
||||
wm=""
|
||||
IFS=':'
|
||||
mon=0
|
||||
set -- ${line#?}
|
||||
while [ $# -gt 0 ] ; do
|
||||
item=$1
|
||||
name=${item#?}
|
||||
case $item in
|
||||
[mM]*)
|
||||
if [ $num_mon -ge 2 ]; then
|
||||
mon=$((mon+1))
|
||||
if [ $mon -gt 1 ]; then
|
||||
wm="${wm}%{F${COLOR_GREY2}}%{B${COLOR_BLACK}};"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
[fFoOuU]*)
|
||||
case $item in
|
||||
f*)
|
||||
# free desktop
|
||||
FG=$COLOR_GREY2
|
||||
BG=$COLOR_BLACK
|
||||
;;
|
||||
F*)
|
||||
# focused free desktop
|
||||
FG=$COLOR_GREY1
|
||||
BG=$COLOR_GREY3
|
||||
;;
|
||||
o*)
|
||||
# occupied desktop
|
||||
FG=$COLOR_GREY2
|
||||
BG=$COLOR_BLACK
|
||||
;;
|
||||
O*)
|
||||
# focused occupied desktop
|
||||
FG=$COLOR_GREY1
|
||||
BG=$COLOR_GREY3
|
||||
;;
|
||||
esac
|
||||
wm="${wm}%{F${COLOR_GREY2}}%{B${BG}}%{F${FG}}%{A:bspc desktop -f ${name}:} ${name}%{A}%{F${BG}}%{B${COLOR_GREY2}}"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
;;
|
||||
esac
|
||||
|
||||
while IFS=';' read -ra array; do
|
||||
bar=""
|
||||
for item in "${!array[@]}"; do
|
||||
bar=${bar}"%{l}${array[${item}]}"
|
||||
if [ ${item} -lt $((${#array[@]} - 1)) ]; then
|
||||
bar=${bar}"${sys}%{S+}"
|
||||
fi
|
||||
done
|
||||
done <<< ${wm}
|
||||
|
||||
printf "%s\n" "${bar}%{F${COLOR_GREY2}}%{B${COLOR_BLACK}}${sys}"
|
||||
|
||||
done < "$PANEL_FIFO" | lemonbar -a 10 -n "$PANEL_WM_NAME" -g x$PANEL_HEIGHT -f "$PANEL_FONT" -F "$COLOR_GREY2" -B "$COLOR_BLACK" | /usr/bin/dash
|
||||
Reference in New Issue
Block a user