Initial import

This commit is contained in:
Lucas 2019-09-11 02:11:40 +00:00
commit 3779fdce2c
48 changed files with 2012 additions and 0 deletions

28
xdg-config-dir/Makefile Normal file
View file

@ -0,0 +1,28 @@
# env
# Written in 2019 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
.POSIX:
.SUFFIXES:
PREFIX= $(HOME)
DIRS= herbstluftwm
install:
mkdir -p $(PREFIX)/.config
cp -fr $(DIRS) $(PREFIX)/.config
diff:
-for d in $(DIRS); do for f in "$$d"/*; do \
diff -u "$$f" $(PREFIX)/.config/"$$f"; \
done; done
uninstall:
cd $(PREFIX)/.config && rm -fr $(DIRS)

View file

@ -0,0 +1,176 @@
#!/bin/sh
# env
# Written in 2019 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
if [ -f ~/.config/herbstluftwm/theme ]; then
. ~/.config/herbstluftwm/theme
fi
hc() { herbstclient "$@"; }
hc emit_hook reload
# remove all existing keybindings
hc keyunbind --all
# keybindings
Mod=Mod4
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Shift-c close
# programs
hc keybind $Mod-g spawn plumb
hc keybind $Mod-p spawn dmenu_run \
-p run -fn "$hlwm_face" \
-nb "$hlwm_background" -nf "$hlwm_foreground" \
-sb "$hlwm_background" -sf "$hlwm_color14"
hc keybind $Mod-Shift-Return spawn xterm
hc keybind $Mod-Control-Return spawn xterm -geometry 80x40
hc keybind $Mod-Control-l spawn xlock
hc keybind $Mod-Print spawn screenshot
# basic movement
# focusing clients
hc keybind $Mod-Left focus left
hc keybind $Mod-Down focus down
hc keybind $Mod-Up focus up
hc keybind $Mod-Right focus right
# moving clients
hc keybind $Mod-Shift-Left shift left
hc keybind $Mod-Shift-Down shift down
hc keybind $Mod-Shift-Up shift up
hc keybind $Mod-Shift-Right shift right
# splitting frames
# create an empty frame at the specified direction
hc keybind $Mod-u split bottom 0.5
hc keybind $Mod-o split right 0.5
# let the current frame explode into subframes
hc keybind $Mod-Control-space split explode
# resizing frames
resizestep=0.05
hc keybind $Mod-Control-Left resize left +$resizestep
hc keybind $Mod-Control-Down resize down +$resizestep
hc keybind $Mod-Control-Up resize up +$resizestep
hc keybind $Mod-Control-Right resize right +$resizestep
# tags
hc try rename default 1
for tag in 1:1 2:2 3:3 4:4 5:5 6:6 7:7 8:8 9:9 0:0; do
name=${tag%:*}
key=${tag#*:}
hc try add $name
hc keybind $Mod-$key use $name
hc keybind $Mod-Shift-$key move $name
done
hc load 2 "(split horizontal:0.5:1 (clients max:0) (clients max:0))"
hc load 3 "(clients max:0)"
# cycle through tags
hc keybind $Mod-period use_index +1 --skip-visible
hc keybind $Mod-comma use_index -1 --skip-visible
# layouting
hc keybind $Mod-v set_layout vertical
hc keybind $Mod-h set_layout horizontal
hc keybind $Mod-m set_layout max
hc keybind $Mod-r remove
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-Shift-s pseudotile toggle
# The following cycles through the available layouts within a frame, but skips
# layouts, if the layout change wouldn't affect the actual window positions.
# I.e. if there are two windows within a frame, the grid layout is skipped.
hc keybind $Mod-space \
or , and . compare tags.focus.curframe_wcount = 2 \
. cycle_layout +1 vertical horizontal max vertical grid \
, cycle_layout +1
# mouse
hc mouseunbind --all
hc mousebind $Mod-Button1 move
hc mousebind $Mod-Button2 zoom
hc mousebind $Mod-Button3 resize
# focus
hc keybind $Mod-BackSpace cycle_monitor
hc keybind $Mod-Tab cycle_all +1
hc keybind $Mod-j cycle +1
hc keybind $Mod-Shift-Tab cycle_all -1
hc keybind $Mod-k cycle -1
hc keybind $Mod-c cycle
hc keybind $Mod-i jumpto urgent
# theme
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_width 0
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 "$hlwm_color11"
hc attr theme.normal.color "$hlwm_color8"
hc attr theme.urgent.color "$hlwm_color9"
hc attr theme.inner_width 0
hc attr theme.outer_width 0
hc attr theme.border_width 2
hc attr theme.background_color "$hlwm_background"
hc set window_gap 0
hc set frame_padding 4
hc set smart_window_surroundings 0
hc set smart_frame_surroundings 0
hc set mouse_recenter_gap 0
# rules
hc unrule -F
#hc rule class=XTerm tag=3 # move all xterms to tag 3
hc rule focus=on # normally focus new clients
#hc rule focus=off # normally do not focus new clients
# give focus to most common terminals
#hc rule class~"(.*[Rr]xvt.*|.*[Tt]erm|Konsole)" focus=on
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|DESKTOP)" manage=off
hc rule class=XTerm pseudotile=on
hc rule class=Firefox instance=Navigator fullscreen=on tag=3
hc rule class="Tor Browser" pseudotile=on tag=3
hc rule class=SshAskpass pseudotile=on
hc rule class=Snes9x-gtk pseudotile=on
hc set tree_style "╾│ ├└╼─┐"
#hc set tree_style "-| |'>-."
# unlock, just to be sure
hc unlock
hc detect_monitors
if [ -f ~/.config/herbstluftwm/herbstpanel.sh ]; then
font_height=13
bar_height=$(($font_height))
for m in $(hc list_monitors | cut -d : -f 1); do
hc pad "$m" 0 0 $bar_height 0
hc monitor_rect "$m" | {
read -r x y w h
y=$(($y + $h - $bar_height - 1))
printf "%s\t%u\t%u\t%u\t%u\n" \
"$m" "$x" "$y" "$w" $bar_height
}
done | sh ~/.config/herbstluftwm/herbstpanel.sh
fi

View file

@ -0,0 +1,83 @@
#!/bin/sh
# env
# Written in 2019 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
if [ -f ~/.config/herbstluftwm/theme ]; then
. ~/.config/herbstluftwm/theme
fi
tagstatus() {
mon=$1
herbstclient tag_status "$mon" | tr "\t" "\n" | {
out=
while IFS= read -r line; do
[ -z "$line" ] && continue
tag=${line#[.:+#%!-]}
rev=
color=$hlwm_color8
case $line in
:*) color=$hlwm_foreground
;;
[#-]*) color=$hlwm_color14
;;
[%+]*) color=$hlwm_color6
;;
!*) color=$hlwm_color13
focused=$(herbstclient attr tags.focus.name)
if [ "$tag" = "$focused" ]; then
color=$hlwm_color14
fi
;;
esac
o=$o"%{O1}%{U$color+u}%{O5}%{U--u}"
done
printf "%%{c}%s%%{O1}\n" "$o"
}
}
taglist() {
mon=$1
tagstatus "$mon"
herbstclient -i "tag_changed|tag_flags" \
| while read -r discard; do
tagstatus "$mon"
done
}
if [ $# -ne 0 ]; then
printf "Usage: %s monitor x y width height\n" "${0##*/}" >&2
exit 1
fi
while IFS=" " read -r m x y w h; do
left=
center=
right=
{
taglist "$m" &
spoon -t &
} | while IFS= read line; do
case $line in
"%{c}"*)
center=$line
;;
"%{r}"*)
right=$line
;;
esac
printf "%s%s%s\n" "$left" "$center" "$right"
done | lemonbar -g "$w"x"$h"+"$x"+"$y" \
-B "$hlwm_background" -F "$hlwm_foreground" \
-f "$hlwm_font" | sh &
done
herbstclient -w reload >/dev/null
kill 0

View file

@ -0,0 +1,33 @@
# env
# Written in 2019 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
: ${hlwm_color0="#000000"}
: ${hlwm_color1="#cc2900"}
: ${hlwm_color2="#29cc00"}
: ${hlwm_color3="#cca300"}
: ${hlwm_color4="#0029cc"}
: ${hlwm_color5="#cc00a3"}
: ${hlwm_color6="#00a3cc"}
: ${hlwm_color7="#cccccc"}
: ${hlwm_color8="#333333"}
: ${hlwm_color9="#ff5c33"}
: ${hlwm_color10="#5cff33"}
: ${hlwm_color11="#ffd633"}
: ${hlwm_color12="#335cff"}
: ${hlwm_color13="#ff33d6"}
: ${hlwm_color14="#33d6ff"}
: ${hlwm_color15="#ffffff"}
: ${hlwm_background="#0d0a00"}
: ${hlwm_foreground="#fffcf2"}
: ${hlwm_font="-misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1"}
#: ${hlwm_font="-lucy-tewi-medium-r-normal--11-90-100-100-c-60-iso10646-1"}
: ${hlwm_face="monospace:size=9"}