guest@dotshare [~/groups/wms/herbstluft] $ ls Awesome-Herbstluftwm-Setup/ | cat

Awesome Herbstluftwm Setup (scrot) (+1 likes)

Pascal3366 Feb 13, 2017 (wms/herbstluft)

autostart(raw, dl)

SCROT

  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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/bin/bash

# this is a simple config for herbstluftwm

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
	eval `dbus-launch --sh-syntax --exit-with-session`
fi

function hc() {
    herbstclient "$@"
}

hc emit_hook reload
xsetroot -solid '#5A8E3A'


# Theme
xrdb -load $HOME/.Xresources

# load fonts
xset +fp /home/pascal/.fonts
xset +fp /usr/share/fonts/local
xset fp rehash

# remove all existing keybindings
#hc keyunbind --all
#reset
herbstclient chain , emit_hook reload , keyunbind --all , mouseunbind --all , unsetenv HCT , set default_frame_layout 2 , load default '(clients max:0)' , rename default "${TAG_NAMES[1]}"

# keybindings
Mod=Mod4
Alt=Mod1
Fn=Mod2
hc keybind $Mod-x close
hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-r reload
hc keybind $Mod-Return spawn exo-open --launch TerminalEmulator

#toggle touchpad by pressin the F1 key
hc keybind $Fn-F1 spawn toggle-touchpad

# tags (Font-Awesome)
TAG_NAMES=( {"     ","     ","     ","      ","     ","     ","     ","    ","     "} )
#TAG_NAMES=( {" WEB "," TERMINALS "," DEV "," MUSIC "," FILES "," CHAT "," VMs "," NEWS "," SCHOOL "," OTHER "} )
TAG_KEYS=( {1..8} 0 )

# need to be done before tags creation
hc set default_frame_layout 2
hc set_layout max

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 "$Mod-$key"        use_index "$i"
        hc keybind "$Mod-Shift-$key" move_index "$i"
    fi
done


## set initial frame padding
herbstclient pad 0 35 0 27

## autostart progs
(autorun_application "xss-lock -- i3lock -n -i ~/Bilder/victory-of-the-daleks-doctor-who-9557.png")
(autorun_application "xbacklight -set 100")
(autorun_application "volumeicon")
(autorun_application "nm-applet --sm-disable")
(autorun_application "thunar --daemon")
(autorun_application "mpd")
(autorun_application "gksudo xfce4-power-manager")
(autorun_application "gksudo dhclient -r wlp2s0")
(autorun_application "udiskie")
(autorun_application "unclutter -idle 2 -root")
(autorun_application "dunst")
(nitrogen --restore &)

#minimize
hc keybind $Mod-n       spawn /home/pascal/.config/herbstluftwm/hide_window +1
hc keybind $Mod-Shift-n spawn /home/pascal/.config/herbstluftwm/hide_window -1
hc keybind $Mod-Control-n spawn /home/pascal/.config/herbstluftwm/hide_window 0

# cycle through tags
hc keybind $Mod-Right        use_index +1 --skip-visible
hc keybind $Mod-Shift-Right move_index +1 --skip-visible
hc keybind $Mod-Left         use_index -1 --skip-visible
hc keybind $Mod-Shift-Left  move_index -1 --skip-visible

# layouting
hc keybind $Mod-r remove
hc keybind $Mod-space cycle_layout 1
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-y pseudotile toggle

#splitting
hc keybind $Mod-u split vertical 0.5
hc keybind $Mod-o split horizontal 0.5
# let the current frame explode into subframes
hc keybind $Mod-Control-space split explode

# resizing
RESIZESTEP=0.05
hc keybind $Mod-Control-h resize left +$RESIZESTEP
hc keybind $Mod-Control-j resize down +$RESIZESTEP
hc keybind $Mod-Control-k resize up +$RESIZESTEP
hc keybind $Mod-Control-l resize right +$RESIZESTEP

# 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
hc keybind $Mod-grave cycle -1
hc keybind $Mod-h focus left
hc keybind $Mod-j focus down
hc keybind $Mod-k focus up
hc keybind $Mod-l focus right
hc keybind $Mod-i jumpto urgent
hc keybind $Mod-Shift-h shift left
hc keybind $Mod-Shift-j shift down
hc keybind $Mod-Shift-k shift up
hc keybind $Mod-Shift-l shift right

#raise on focus
hc set raise_on_focus 1
hc set raise_on_click 1
hc set focus_follows_mouse 0

#launch rofi
hc keybind $Mod-p spawn /home/pascal/.config/herbstluftwm/myrofi.sh

#mpd controls
hc keybind $Alt-Up spawn amixer -q -D pulse sset Master 2%+
hc keybind $Alt-Down spawn amixer -q -D pulse sset Master 2%-
hc keybind $Alt-m spawn amixer -q -D pulse sset Master toggle
hc keybind $Alt-Left spawn mpc prev
hc keybind $Alt-Right spawn mpc next
hc keybind $Alt-p spawn mpc toggle


#screenshot
DATE=`date +%d%m%Y_%H%M%S`
hc keybind Print spawn xsnap -nogui -file $HOME/screenshot-$DATE
hc keybind $Alt-Print spawn scrot

#lock the screen
hc keybind $Mod-$Alt-l spawn i3lock -n -i ~/Bilder/victory-of-the-daleks-doctor-who-9557.png

#shortcuts
hc keybind $Mod-q spawn firefox

# appearance
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_active_color '#222222'
#hc set frame_border_normal_color '#101010'
hc set frame_border_normal_color '#111'
hc set frame_bg_normal_color '#565656'
hc set frame_bg_active_color '#345F0C'
hc set frame_border_width 8
hc set always_show_frame 1
hc set frame_bg_transparent 1
hc set frame_transparent_width 0
hc set frame_gap 0


hc attr theme.active.color '#9fbc00'
hc attr theme.normal.color '#454545'
hc attr theme.urgent.color orange
hc attr theme.inner_width 0
hc attr theme.inner_color black
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 '#3E4A00'
hc attr theme.active.outer_color '#3E4A00'
hc attr theme.background_color '#141414'



# rules
hc unrule -F
hc rule focus=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK)' manage=off
hc rule class=Mindock manage=off
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)' pseudotile=on
hc rule windowtype~'_NET_WM_WINDOW_TYPE_(FULLSCREEN|FS)' fullscreen=on
hc rule class~"Hybrid|Openfetion|File-roller|Gmrun|Kupfer\.py|Do|dosbox|ngspice|Cairo-compmgr|Fcitx-config-gtk|fontforge|Workrave|Palimpsest|Wine|Wish|Cxsetup" pseudotile=on
hc rule class=Firefox not windowrole=browser pseudotile=on
hc rule class=Thunar instance=file_progress pseudotile=on
hc rule class=tint2 manage=off focus=off

hc set tree_style '╾│ ├└╼─┐'


# unlock, just to be sure
hc unlock

# do multi monitor setup here, e.g.:
# hc remove_monitor 1
# hc move_monitor 0 1280x1024+0+0
# hc add_monitor 1280x1024+1280+

#"$(dirname "$0")"/panels start
hc spawn autorun_application "polybar my-awesome-polybar"
hc spawn autorun_application "polybar bottom-bar"

## RUNTIME:
#// external:
hc spawn /home/pascal/.config/herbstluftwm/dzen-post.sh
hc emit_hook complete
#// execute chain:
herbstclient chain ${ex}&
#pgrep tint2 >/dev/null || tint2 -c /home/pascal/.config/herbstluftwm/tint2rc &
# vi: se tw=0:
#sleep 3
#bash /home/pascal/.config/herbstluftwm/tray.sh

CLICK TO VIEW

x

autorun_application(raw, dl)

1
2
3
4
5
6
#!/bin/bash
if pidof -o %PPID -x "$1">/dev/null; then
	:
else
	($1 &)
fi
 

x

hide_window(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
function tag() {
  herbstclient list_monitors | grep '\[FOCUS\]' | cut -d'"' -f2
}
 
tag=$(tag)
case "$@" in
  +1)   herbstclient dump "'$tag" || herbstclient add "'$tag"
        herbstclient move "'$tag"
        ;;
  -1)   if herbstclient dump "'$tag"; then
          herbstclient chain . lock . use "'$tag"
          winid=$(herbstclient attr clients.focus.winid)
          herbstclient chain . use $tag . bring $winid . unlock
        fi
        ;;
  0|*)  herbstclient dump "'$tag" && herbstclient merge_tag "'$tag" 
;;
esac
 

x

locker.sh(raw, dl)

1
2
3
4
5
6
#!/bin/sh

exec xautolock -detectsleep 
  -time 3 -locker "i3lock -d -c 000070" \
  -notify 30 \
  -notifier "notify-send -u critical -t 10000 -- 'LOCKING screen in 30 seconds'"
 

x

myrofi.sh(raw, dl)

1
rofi -show run -width 1000 -fg "#B0E670" -bg "#14161F" -hlfg "#14161F" -hlbg "#B0E670" -bc "#14161F" -location 0 -lines 19 -bw 0 -font "Dejavu Sans Mono 12" -padding 20 -separator-style none -opacity 90 -fuzzy -sidebar-mode -auto-select -regex -color-enabled -tokenize
 

x

restart(raw, dl)

 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
#!/bin/bash
# TODO multiple monitors support
IFS=
layouts=`mktemp -d`
tags=`herbstclient tag_status`

iterate_tags() {
    func=$1
    IFS='	'
    for tag in $tags; do
        IFS=
        $func ${tag#?}
    done
}

dump() {
    herbstclient dump $1 > "$layouts/$1"
}

load() {
    herbstclient load $1 "$(cat $layouts/$1)"
}

iterate_tags dump
herbstclient wmexec
sleep 3
iterate_tags load

rm -rf $layouts
 

x