Skip to content

Commit

Permalink
switch from Xubuntu to Void Linux running bspwm
Browse files Browse the repository at this point in the history
  • Loading branch information
sunaku committed Nov 30, 2015
1 parent 0b7bdc5 commit c0cb047
Show file tree
Hide file tree
Showing 42 changed files with 682 additions and 196 deletions.
6 changes: 2 additions & 4 deletions .Xdefaults.erb
@@ -1,16 +1,14 @@
! vim:filetype=xdefaults:
<% light_theme = ENV['THEME'] == 'light' %>

! see "font4" in /usr/share/X11/app-defaults/XTerm
*font : -*-fixed-medium-r-*-*-13-*-*-*-*-*-*-*
*font : -*-tamzen-medium-r-*-*-16-*-*-*-*-*-*-*

! enable colors in native X applications
#ifdef COLOR
*customization : -color
#endif

! use the Human cursor theme from Ubuntu
Xcursor.theme : Human
Xcursor.theme : whiteglass

! choose color scheme to use in terminals
<% if light_theme %>
Expand Down
3 changes: 3 additions & 0 deletions .asoundrc
@@ -0,0 +1,3 @@
# http://unix.stackexchange.com/a/193428
defaults.pcm.card 1
defaults.ctl.card 1
31 changes: 31 additions & 0 deletions .config/bspwm/bspwmrc
@@ -0,0 +1,31 @@
#!/bin/sh

bspc config border_width 2
bspc config window_gap 12

bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_by_distance true
bspc config history_aware_focus true
bspc config focus_follows_pointer true
bspc config pointer_follows_monitor true
bspc config remove_disabled_monitors true
bspc config remove_unplugged_monitors true
bspc config merge_overlapping_monitors true

# bspc monitor -d I II III IV V VI VII VIII IX X
bspc monitor -d 1 2 3 4 5 6 7 8 9 a

bspc rule -a Gimp desktop=^8 follow=on floating=on
bspc rule -a Chromium desktop=^2
bspc rule -a mplayer2 floating=on
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off

# restore windows into current session
. ~/.config/bspwm/examples/loop/profile
. ~/.config/bspwm/examples/loop/bspwmrc

bspwm-panel &
sxhkd -m -1 & # the -1 ensures new keyboards are mapped
17 changes: 17 additions & 0 deletions .config/bspwm/examples/bspwmrc
@@ -0,0 +1,17 @@
#! /bin/sh

bspc config border_width 2
bspc config window_gap 12

bspc config split_ratio 0.52
bspc config borderless_monocle true
bspc config gapless_monocle true
bspc config focus_by_distance true

bspc monitor -d I II III IV V VI VII VIII IX X

bspc rule -a Gimp desktop=^8 follow=on floating=on
bspc rule -a Chromium desktop=^2
bspc rule -a mplayer2 floating=on
bspc rule -a Kupfer.py focus=on
bspc rule -a Screenkey manage=off
3 changes: 3 additions & 0 deletions .config/bspwm/examples/external_rules/bspwmrc
@@ -0,0 +1,3 @@
#! /bin/sh

bspc config external_rules_command "$(which external_rules)"
14 changes: 14 additions & 0 deletions .config/bspwm/examples/external_rules/external_rules
@@ -0,0 +1,14 @@
#! /bin/sh

wid=$1
class=$2
instance=$3

if [ "$instance" = fontforge ] ; then
title=$(xtitle "$wid")
case "$title" in
Layers|Tools|Warning)
echo "focus = off"
;;
esac
fi
@@ -0,0 +1 @@
`wattr` belongs to [wmutils](https://github.com/wmutils/core).
@@ -0,0 +1,15 @@
#! /bin/sh

fwid=$(bspc query -W -w focused.automatic)

if [ -n "$fwid" ] ; then
wattr wh $fwid | {
read width height
if [ $width -gt $height ] ; then
echo "split_dir=left"
else
echo "split_dir=down"
fi
echo "split_ratio=0.5"
}
fi
6 changes: 6 additions & 0 deletions .config/bspwm/examples/loop/bspwmrc
@@ -0,0 +1,6 @@
#! /bin/sh

if [ -e "$BSPWM_TREE" ] ; then
bspc restore -T "$BSPWM_TREE" -H "$BSPWM_HISTORY" -S "$BSPWM_STACK"
rm "$BSPWM_TREE" "$BSPWM_HISTORY" "$BSPWM_STACK"
fi
3 changes: 3 additions & 0 deletions .config/bspwm/examples/loop/profile
@@ -0,0 +1,3 @@
export BSPWM_TREE=/tmp/bspwm.tree
export BSPWM_HISTORY=/tmp/bspwm.history
export BSPWM_STACK=/tmp/bspwm.stack
6 changes: 6 additions & 0 deletions .config/bspwm/examples/loop/sxhkdrc
@@ -0,0 +1,6 @@
super + alt + {_,shift + }Escape
{bspc query -T > "$BSPWM_TREE"; \
bspc query -H > "$BSPWM_HISTORY"; \
bspc query -S > "$BSPWM_STACK"; \
bspc quit,\
bspc quit 1}
5 changes: 5 additions & 0 deletions .config/bspwm/examples/loop/wm
@@ -0,0 +1,5 @@
#! /bin/sh

while true ; do
bspwm || break
done
1 change: 1 addition & 0 deletions .config/bspwm/examples/loop/xinitrc
@@ -0,0 +1 @@
exec wm
8 changes: 8 additions & 0 deletions .config/bspwm/examples/overlapping_borders/bspwmrc
@@ -0,0 +1,8 @@
#! /bin/sh

BW=3
bspc config border_width $BW
bspc config window_gap -$BW
for side in top right bottom left ; do
bspc config ${side}_padding $BW
done
3 changes: 3 additions & 0 deletions .config/bspwm/examples/panel/bspwmrc
@@ -0,0 +1,3 @@
#! /bin/sh

panel &
23 changes: 23 additions & 0 deletions .config/bspwm/examples/panel/panel
@@ -0,0 +1,23 @@
#! /bin/sh

if [ $(pgrep -cx panel) -gt 1 ] ; 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 config top_padding $PANEL_HEIGHT
bspc control --subscribe > "$PANEL_FIFO" &
xtitle -sf 'T%s' > "$PANEL_FIFO" &
clock -sf 'S%a %H:%M' > "$PANEL_FIFO" &
battery -sf 'B%s %i' > "$PANEL_FIFO" &

. panel_colors

cat "$PANEL_FIFO" | panel_bar | lemonbar -n "$PANEL_WM_NAME" -g x$PANEL_HEIGHT -f "$PANEL_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" &

wait
74 changes: 74 additions & 0 deletions .config/bspwm/examples/panel/panel_bar
@@ -0,0 +1,74 @@
#! /bin/sh
#
# Example panel for LemonBoy's bar

. panel_colors

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

while read -r line ; do
case $line in
S*)
# clock output
sys_infos="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG} ${line#?} %{B-}%{F-}"
;;
T*)
# xtitle output
title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG} ${line#?} %{B-}%{F-}"
;;
W*)
# bspwm internal state
wm_infos=""
IFS=':'
set -- ${line#?}
while [ $# -gt 0 ] ; do
item=$1
name=${item#?}
case $item in
M*)
# active monitor
if [ $num_mon -gt 1 ] ; then
wm_infos="$wm_infos %{F$COLOR_ACTIVE_MONITOR_FG}%{B$COLOR_ACTIVE_MONITOR_BG} ${name} %{B-}%{F-} "
fi
;;
m*)
# inactive monitor
if [ $num_mon -gt 1 ] ; then
wm_infos="$wm_infos %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG} ${name} %{B-}%{F-} "
fi
;;
O*)
# focused occupied desktop
wm_infos="${wm_infos}%{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u} ${name} %{-u}%{B-}%{F-}"
;;
F*)
# focused free desktop
wm_infos="${wm_infos}%{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u} ${name} %{-u}%{B-}%{F-}"
;;
U*)
# focused urgent desktop
wm_infos="${wm_infos}%{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u} ${name} %{-u}%{B-}%{F-}"
;;
o*)
# occupied desktop
wm_infos="${wm_infos}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG} ${name} %{B-}%{F-}"
;;
f*)
# free desktop
wm_infos="${wm_infos}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG} ${name} %{B-}%{F-}"
;;
u*)
# urgent desktop
wm_infos="${wm_infos}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG} ${name} %{B-}%{F-}"
;;
L*)
# layout
wm_infos="$wm_infos %{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG} ${name} %{B-}%{F-}"
;;
esac
shift
done
;;
esac
printf "%s\n" "%{l}${wm_infos}%{c}${title}%{r}${sys_infos}"
done
24 changes: 24 additions & 0 deletions .config/bspwm/examples/panel/panel_colors
@@ -0,0 +1,24 @@
COLOR_FOREGROUND='#FFA3A6AB'
COLOR_BACKGROUND='#FF34322E'
COLOR_ACTIVE_MONITOR_FG='#FF34322E'
COLOR_ACTIVE_MONITOR_BG='#FF58C5F1'
COLOR_INACTIVE_MONITOR_FG='#FF58C5F1'
COLOR_INACTIVE_MONITOR_BG='#FF34322E'
COLOR_FOCUSED_OCCUPIED_FG='#FFF6F9FF'
COLOR_FOCUSED_OCCUPIED_BG='#FF5C5955'
COLOR_FOCUSED_FREE_FG='#FFF6F9FF'
COLOR_FOCUSED_FREE_BG='#FF6D561C'
COLOR_FOCUSED_URGENT_FG='#FF34322E'
COLOR_FOCUSED_URGENT_BG='#FFF9A299'
COLOR_OCCUPIED_FG='#FFA3A6AB'
COLOR_OCCUPIED_BG='#FF34322E'
COLOR_FREE_FG='#FF6F7277'
COLOR_FREE_BG='#FF34322E'
COLOR_URGENT_FG='#FFF9A299'
COLOR_URGENT_BG='#FF34322E'
COLOR_LAYOUT_FG='#FFA3A6AB'
COLOR_LAYOUT_BG='#FF34322E'
COLOR_TITLE_FG='#FFA3A6AB'
COLOR_TITLE_BG='#FF34322E'
COLOR_STATUS_FG='#FFA3A6AB'
COLOR_STATUS_BG='#FF34322E'
5 changes: 5 additions & 0 deletions .config/bspwm/examples/panel/profile
@@ -0,0 +1,5 @@
PANEL_FIFO=/tmp/panel-fifo
PANEL_HEIGHT=24
PANEL_FONT_FAMILY="-*-tamzen-medium-*-normal-*-15-*-*-*-*-*-*-*"
PANEL_WM_NAME=lemonpanel
export PANEL_FIFO PANEL_HEIGHT PANEL_FONT_FAMILY PANEL_WM_NAME
2 changes: 2 additions & 0 deletions .config/bspwm/examples/panel/sxhkdrc
@@ -0,0 +1,2 @@
super + alt + Escape
pkill -x panel; bspc quit
88 changes: 88 additions & 0 deletions .config/bspwm/examples/sxhkdrc
@@ -0,0 +1,88 @@
#
# bspwm hotkeys
#

super + alt + Escape
bspc quit

super + w
bspc window -c

super + t
bspc desktop -l next

super + b
bspc desktop -B

super + {s,f}
bspc window -t {floating,fullscreen}

super + {grave,Tab}
bspc {window,desktop} -f last

super + apostrophe
bspc window -s last

super + {o,i}
bspc control --record-history off; \
bspc window {older,newer} -f; \
bspc control --record-history on

super + y
bspc window -w last.manual

super + m
bspc window -s biggest

super + {_,shift + }{h,j,k,l}
bspc window -{f,s} {left,down,up,right}

super + {_,shift + }c
bspc window -f {next,prev}

super + {comma,period}
bspc desktop -C {backward,forward}

super + bracket{left,right}
bspc desktop -f {prev,next}

super + ctrl + {h,j,k,l}
bspc window -p {left,down,up,right}

super + ctrl + {_,shift + }space
bspc {window -p cancel,desktop -c}

super + alt + {h,j,k,l}
bspc window -e {left -10,down +10,up -10,right +10}

super + alt + shift + {h,j,k,l}
bspc window -e {right -10,up +10,down -10,left +10}

super + ctrl + {1-9}
bspc window -r 0.{1-9}

super + {_,shift + }{1-9,0}
bspc {desktop -f,window -d} ^{1-9,10}

~button1
bspc pointer -g focus

super + button{1-3}
; bspc pointer -g {move,resize_side,resize_corner}

super + @button{1-3}
bspc pointer -u

#
# wm independent hotkeys
#

super + Return
urxvt

super + space
dmenu_run

# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd

0 comments on commit c0cb047

Please sign in to comment.