Dystopia of Wonders (scrot) (+3 likes)
Shinryuu Nov 17, 2015 (wms/herbstluft)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | #!/bin/bash
hc() {
herbstclient "$@"
}
hc emit_hook reload
# remove all existing keybindings
hc keyunbind --all
# keybindings
Mod=Mod1
#herbstclient load ${TAG_NAMES[0]} '(clients max:0)'
# tags
TAG_NAMES=("一" "二" "三" "四" "五" "六")
TAG_KEYS=( {1..6} 0 )
hc rename default "${TAG_NAMES[0]}" || true
for i in ${!TAG_NAMES[@]} ; do
hc add "${TAG_NAMES[$i]}"
key="${TAG_KEYS[$i]}"
if ! [ -z "$key" ] ; then
hc keybind "Control-$key" use_index "$i"
hc keybind "$Mod-Shift-$key" move_index "$i"
fi
done
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_active_color '#353535'
hc set frame_border_normal_color '#101010'
hc set frame_bg_normal_color '#202020'
hc set frame_bg_active_color '#6c3b41'
hc set frame_border_width 1
hc set always_show_frame 0
hc set frame_bg_transparent 1
hc set frame_transparent_width 0
hc set frame_gap 0
hc attr theme.active.color '#353535'
hc attr theme.normal.color '#252525'
hc attr theme.urgent.color orange
hc attr theme.inner_width 1
hc attr theme.inner_color '#202020'
hc attr theme.border_width 2
hc attr theme.floating.border_width 4
hc attr theme.floating.outer_width 1
hc attr theme.floating.outer_color black
hc attr theme.active.inner_color '#383838'
hc attr theme.active.outer_color '#282828'
hc attr theme.background_color '#ffffff'
# mouse bindings
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
# layouts
hc load 一 '
(split horizontal:0.500000:0
(clients vertical:0 0x1800005)
(clients vertical:0))'
hc load 二 '
(split horizontal:0.500000:1
(split vertical:0.500000:1
(clients vertical:0)
(clients vertical:0))
(split vertical:0.500000:0
(clients vertical:0 0x1a00003)
(clients vertical:0)))'
# rules
hc unrule -F
# focus new clients
hc rule focus=on
# rules for clients
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype='_NET_WM_WINDOW_TYPE_DIALOG' focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
hc rule class=qutebrowser tag=一 focus=on
hc rule class=mpv tag=一 focus=on
hc rule class=sxiv tag=一 focus=on
hc rule class=wine tag=一 focus=on
# unlock, just to be sure
hc unlock
herbstclient set tree_style '╾│ ├└╼─┐'
# do multi monitor setup here, e.g.:
# hc set_monitors 1280x1024+0+0 1920x1080+1280+0
hc detect_monitors
# panel
panel.sh &
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | #!/bin/bash
# Just a dirty script for lemonbar,
# you need to use 'siji' font for icons.
# main monitor
monitor=${1:-0}
# padding
herbstclient pad $monitor 16
# settings
RES="x16+1280x"
FONT="*-siji-medium-r-*-*-10-*-*-*-*-*-*-*"
FONT2="-*-cure.se-medium-r-*-*-11-*-*-*-*-*-*-*"
FONT3="IPAGothic-8"
BG="#1A1C1F"
FG="#A8A8A8"
BLK="#262626"
RED="#834f48"
YLW="#917154"
BLU="#45536E"
GRA="#898989"
VLT="#7B3D93"
# icons
st="%{F$YLW} %{F-}"
sm="%{F$RED} %{F-}"
sv="%{F$BLU} %{F-}"
sd="%{F$VLT} %{F-}"
# functions
set -f
function uniq_linebuffered() {
awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@"
}
# events
{
# now playing
mpc idleloop player | cat &
mpc_pid=$!
# volume
while true ; do
echo "vol $(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')"
sleep 1 || break
done > >(uniq_linebuffered) &
vol_pid=$!
# date
while true ; do
date +'date_min %b %d %A '%{F$RED}%{F-}' %H:%M'
sleep 1 || break
done > >(uniq_linebuffered) &
date_pid=$!
# herbstluftwm
herbstclient --idle
# exiting; kill stray event-emitting processes
kill $mpc_pid $vol_pid $date_pid
} 2> /dev/null | {
TAGS=( $(herbstclient tag_status $monitor) )
unset TAGS[${#TAGS[@]}]
time=""
song="nothing to see here"
windowtitle="what have you done?"
visible=true
while true ; do
echo -n "%{l}"
for i in "${TAGS[@]}" ; do
case ${i:0:1} in
'#') # current tag
echo -n "%{U$RED}%{+u}"
;;
'+') # active on other monitor
echo -n "%{U$YLW}%{+u}"
;;
':')
echo -n "%{-u}"
;;
'!') # urgent tag
echo -n "%{U$YLW}"
;;
*)
echo -n "%{-u}"
;;
esac
echo -n " ${i:1} "
done
# center window title
echo -n "%{c}$st%{F$GRA}${windowtitle//^/^^} %{F-}"
# align right
echo -n "%{r}"
echo -n "$sm"
echo -n "$song" %{F$YLW}"$song2"%{F-}
echo -n "$sv"
echo -n "$volume"
echo -n "$sd"
echo -n "$date "
echo ""
# wait for next event
read line || break
cmd=( $line )
# find out event origin
case "${cmd[0]}" in
tag*)
TAGS=( $(herbstclient tag_status $monitor) )
unset TAGS[${#TAGS[@]}]
;;
mpd_player|player)
song="$(mpc -f %artist% current)"
song2="$(mpc -f %title% current)"
;;
vol)
volume="${cmd[@]:1}"
;;
date_min)
date="${cmd[@]:1}"
;;
focus_changed|window_title_changed)
windowtitle="${cmd[@]:2}"
;;
quit_panel)
exit
;;
reload)
exit
;;
esac
done
} 2> /dev/null | lemonbar -g ${RES} -u 3 -B ${BG} -F ${FG} -f ${FONT} -f ${FONT2} -f ${FONT3} & $1
|
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | # sxhkd configuration
# herbstluftwm
# reload sxhkd config
alt + shift + s
pkill -USR1 -x sxhkd
# quit herbstluftwm
alt + control + q
herbstclient quit
# toggle redshift
control + apostrophe
pkill -USR1 redshift
# menu
alt + p
dmenu_run
alt + comma
dmenufm
# mpd toggle
control + section
mpc toggle
# web, fm, img
alt + {1,2,3}
{qutebrowser,spacefm,gimp}
alt + {odiaeresis,adiaeresis}
{xcmenuctrl,lolimpdnu}
# terminal
alt + shift + Return
termite
# close windows
alt + shift + c
herbstclient close
# kill panel properly and quit
alt + shift + q
herbstclient close; pkill lemonbar; pkill panel
# handle panels and reloading properly
alt + shift + r
herbstclient reload
# window splitting
alt + {w,q,e}
herbstclient split {bottom 0.5,right 0.5, explode}
# focus
alt + period
herbstclient cycle_monitor
alt + {Tab,shift+Tab,c,u}
herbstclient {cycle_all +1,cycle_all -1,cycle,jumpto urgent}
alt + {Left,Down,Up,Right}
herbstclient {focus left,focus down,focus up,focus right}
# layouting
alt + {r,shift+Tab,shift+f,shift+m,shift+p}
herbstclient {remove,cycle_layout 1,floating toggle, fullscreen toggle, pseudotile toggle}
# moving clients
alt + shift + {Left,Down,Up,Right}
herbstclient shift {left,down,up,right}
# resizing frames
alt + control + {Left,Down,Up,Right}
herbstclient resize {left +0.01,down +0.01,up +0.01,right +0.01}
# cycle through tags
alt + {adiaeresis,odiaeresis}
herbstclient use_index {+1 --skip-visible,-1 --skip-visible}
# shift client to specified monitor
alt + {apostrophe,section}
herbstclient shift_to_monitor {1,0}
# swap
alt + m
herbstclient spawn swap.sh auto
|
x
Notes
I’ve been on this window manager almost for two years. I’ve done some small changes such as changing colors and modifying the panel. I’m more than comfortable with this. I moved from default keybinding method to sxhkd and I seem to like it better. If you want to fiddle with my panel; you’ll need lemonbar or a one with xft support if you want to see some foreign characters with a correct font. You will also need “siji” font for icons. For more information see: https://github.com/krypt-n/bar