guest@dotshare [~/groups/wms/herbstluft] $ ls Sakura-on-7d3750/ | cat

Sakura on #7d3750 (scrot) (+1 likes)

Shinryuu Jul 27, 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
#!/usr/bin/env bash
#  ██                     ██     
# ░██                    ░██     
# ░██       █████  ██████░██     
# ░██████  ██░░░██░░██░░█░██████ 
# ░██░░░██░███████ ░██ ░ ░██░░░██
# ░██  ░██░██░░░░  ░██   ░██  ░██
# ░██  ░██░░██████░███   ░██████ 
# ░░   ░░  ░░░░░░ ░░░    ░░░░░  
# configuration made with love!

hc() {
    herbstclient "$@"
}

hc emit_hook reload

# remove all existing keybindings
hc keyunbind --all

# keybindings
Mod=Mod1    # Use alt as the main modifier

# tags
tag_names=("TERM" "WEB" "IMG" "NULL" "HERB")
tag_keys=( {1..5} 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-Control-$key" move_index "$i"
    fi
done

# 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

# theme
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_active_color '#7d3750'
hc set frame_border_normal_color '#1d1f21'
hc set frame_bg_normal_color '#1d1f21'
hc set frame_bg_active_color '#345f0c'
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 '#7d3750'
hc attr theme.normal.color '#1d1f21'
hc attr theme.urgent.color orange
hc attr theme.inner_width 1
hc attr theme.inner_color '#1d1f21'
hc attr theme.border_width 4
hc attr theme.floating.border_width 6
hc attr theme.floating.outer_width 2
hc attr theme.floating.outer_color '#222222'
hc attr theme.active.inner_color '#7d3750'
hc attr theme.active.outer_color '#7d3750'
hc attr theme.background_color '#1d1f21'

hc set window_gap 0
hc set frame_padding 0
hc set smart_window_surroundings 0
hc set smart_frame_surroundings 1
hc set mouse_recenter_gap 0

# layouts
hc load TERM '
(split horizontal:0.730000:0
(split horizontal:0.310000:1
	(clients vertical:0 0x200001a)
	(clients vertical:0 0x8000d9))
(split vertical:0.300000:1
	(clients vertical:0 0x80001d) 
(split vertical:0.780000:1 
	(clients vertical:0) 
(split horizontal:0.680000:0 
	(clients vertical:0) 
	(clients vertical: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

# unlock, just to be sure
hc unlock

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

# do multi monitor setup here, e.g.:
# hc set_monitors 1280x1024+0+0 1280x1024+1280+0
# or simply:
hc detect_monitors

# find the panel
panel=~/.config/herbstluftwm/panel_old.sh
[ -x "$panel" ] || panel=/etc/xdg/herbstluftwm/panel.sh
for monitor in $(herbstclient list_monitors | cut -d: -f1) ; do
    # start it on each (nope) monitor
    "$panel" &
done

CLICK TO VIEW

x

.colors_barrage(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
30
31
32
33
34
35
36
! special
*.foreground:   #919294
*.background:   #1d1f21
*.cursorColor:  #919294

! black
*.color0:       #404040
*.color8:       #464646

! red
*.color1:       #7a4256
*.color9:       #7a4956

! green
*.color2:       #58614f
*.color10:      #6d7762

! yellow
*.color3:       #97814e
*.color11:      #a38d56

! blue
*.color4:       #424a64
*.color12:      #626c94

! magenta
*.color5:       #7d5066
*.color13:      #7e4967

! cyan
*.color6:       #3c5a5d
*.color14:      #548084

! white
*.color7:       #7b8695
*.color15:      #94a1b3
 

x

panel.sh(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
 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
#!/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 20

# settings
RES="x20+1920x"
FONT="*-siji-medium-r-*-*-10-*-*-*-*-*-*-*"
#FONT2="*-benis-lemon-medium-r-*-*-10-*-*-*-*-*-*-*"
FONT2="-*-cure.se-medium-r-*-*-11-*-*-*-*-*-*-*"
FONT3="IPAGothic:pixelsize=11:antialias=false"
#FONT3="Kochi Gothic-8" # stopped working; fontconfig issues?

BG="#1D1F21"
BA="#242629"
FG="#A8A8A8"
BLK="#262626"
RED="#7d3750"
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 "%{B$RED}"
                    ;;
                '+') # active on other monitor
                    echo -n "%{B$YLW}"
                    ;;
                ':')
                    echo -n "%{B-}"
                    ;;
                '!') # urgent tag
                    echo -n "%{U$YLW}"
                    ;;
                *)
                    echo -n "%{B-}"
                    ;;
            esac
            echo -n " ${i:1} %{B-}"
        done
	
	# center window title
	echo -n "%{c}$st${windowtitle//^/^^}"
	
        # 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

.Xresources(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
30
! URxvt settings
! starts from here:

! fonts
URxvt*font: xft:spectrum berry:size=9,\
            xft:Siji:antialias=false,\
            xft:Kochi Gothic:antialias=false,\
URxvt*boldMode: false
URxvt*boldFont: xft:spectrum berry: size=9

! colorscheme
#include "/home/shn/.colors/barrage2"

! settings
urxvt*urgentOnBell: true
URxvt*scrollBar: false
URxvt*cursorBlink:false
URxvt*iso14755: false
URxvt*url-launcher: qutebrowser
URxvt*termName: rxvt-unicode-256color
URxvt.geometry: 72x22

! custom key bindings
URxvt.perl-ext-common: default,matcher,clipboard
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Shift-Control-V: perl:clipboard:paste

! clickable URLs
URxvt.matcher.button: 1
URxvt.url-launcher: /usr/bin/qutebrowser
 

x

Notes

It seems I haven’t visited this site for a long time but now it’s time to change that! I’ve been switching between window managers quite a bit during few years. Most notably I’ve been on 2bwm. I felt that something was missing on 2bwm even it felt a good place to spend my time on. I decided to go back to herbstluftwm because I had a wonderful time on it for years before. That was when my new adventure begun.

I almost forgot to mention that I use sxhkd for keybindings. It makes my life easier. So no need to think why my autostart doesn’t have lines for settings,

font: berry
terminal: urxvt
panel: lemonbar
irc: weechat
music: deadbeef and mpd
file manager: coretools and ranger
web browser: qutebrowser
webm file (hosted at yiff.moe which is a pomf clone and it should be safe): https://a.yiff.moe/rvboyr.webm
clean screenshot: https://a.yiff.moe/xdcebg.png

My dotfiles are located at: https://github.com/Shinryuu/dotfiles
My local homepage is based on this: https://github.com/tayumpee/start_page2_firefox_and_chrome

Comments

zBDragon said about 6 years ago

Had problems getting it to work on Manjaro, switched to Arch linux and got it working. (somewhat)
Thanks.

edited about 6 years ago

vegangaro said about 6 years ago
Shinryuu said about 6 years ago

@zBDragon: That’s quite interesting find. There shouldn’t be anything that is “OS specific”. I’d try to check that your path like for sh and bash are correct on scripts on your system though.

edited about 6 years ago