guest@dotshare [~/groups/wms/herbstluft] $ ls Delusion/ | cat

Delusion (scrot) (+2 likes)

DoubleT Jan 19, 2016 (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
#!/usr/bin/env bash

# this is a simple config for herbstluftwm

hc() {
    herbstclient "$@"
}

hc emit_hook reload

# remove all existing keybindings
hc keyunbind --all

# keybindings
# if you have a super key you will be much happier with Mod set to Mod4
Mod=Mod1    # Use alt as the main modifier
#Mod=Mod4   # Use the super key as the main modifier

#hc keybind $Mod-Shift-q quit
hc keybind $Mod-Shift-q spawn exitbox
hc keybind $Mod-Control-r reload
hc keybind $Mod-Shift-w close
hc keybind $Mod-Return spawn ${TERMINAL:-xterm} # use your $TERMINAL with xterm as fallback
hc keybind $Mod-Shift-Return spawn st -e tmux
hc keybind $Mod-r spawn spawn_rofi

# 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-v       split   bottom  0.5
hc keybind $Mod-h       split   right   0.5
hc keybind $Mod-o		split	auto

# 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

# cycle through tags
hc keybind $Mod-comma use_index +1 --skip-visible
hc keybind $Mod-period  use_index -1 --skip-visible

# layouting
hc keybind $Mod-Shift-r remove
hc keybind $Mod-s floating toggle
hc keybind $Mod-f fullscreen toggle
hc keybind $Mod-p pseudotile toggle
hc keybind $Mod-space 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-Shift-Tab   cycle_all -1
hc keybind $Mod-c cycle
hc keybind $Mod-i jumpto urgent

# Volume
hc keybind XF86AudioRaiseVolume spawn pulseaudio-ctl up
hc keybind XF86AudioLowerVolume spawn pulseaudio-ctl down
hc keybind XF86AudioMute spawn pulseaudio-ctl mute

# Misc
hc keybind Print spawn screenshot
hc keybind XF86TouchpadToggle spawn touchpad

# theme
hc attr theme.tiling.reset 1
hc attr theme.floating.reset 1
hc set frame_border_width 0
hc set frame_bg_transparent 1
hc set frame_transparent_width 0
hc set frame_gap 0
hc set always_show_frame 0

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

hc attr theme.tiling.outer_color '#000000'
hc attr theme.floating.outer_color '#000000'
hc attr theme.active.outer_color '#000000'
hc attr theme.active.color '#e1485a'
hc attr theme.normal.color '#f5f5f5'
hc attr theme.urgent.color '#c81a71'
hc attr theme.outer_width 3
hc attr theme.border_width 6

# tags
#tag_names( term web img herb null foo )
#tag_keys=( {1..6} 0 )
tag_names=( "h" "e" "r" "b" "s" "t" )
tag_keys=( {1..9} 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 "$Mod-$key" use_index "$i"
        hc keybind "$Mod-Shift-$key" move_index "$i"
    fi
done

# rules
hc unrule -F
hc rule class=Firefox tag=h
hc rule class=Steam tag=t
hc rule focus=on # normally focus new 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|DESKTOP)' manage=off

# tag modes
hc floating t on


# unlock, just to be sure
hc unlock
herbstclient set tree_style '╾│ ├└╼─┐'

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

CLICK TO VIEW

x

panel(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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/sh

. panel_config

if [ $(pgrep -cx panel) -gt 1 ] ; then
    pkill -o panel
fi

trap 'trap - TERM; kill 0' INT TERM QUIT EXIT

[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO"
mkfifo "$PANEL_FIFO"

herbstclient pad $MON $PANEL_HEIGHT

clock -i30 -sf 'T%d %b, %a // %H:%M' > "$PANEL_FIFO" &
 
while [[ true ]]; do
    state=$(volume)
    if [ $(echo $state | cut -d ' ' -f 1) == "off" ]; then
        vol_icon=vol_percent="off"
        echo "V" "%{B$CLR1} ${AC}pulseaudio-ctl mute${AB}${AC4}pulseaudio-ctl up${AB}${AC5}pulseaudio-ctl down${AB}%{F$CLR7}${vol_icon}%{F-}${AE}${AE}${AE} %{B-} ${vol_percent}" > "$PANEL_FIFO"
    else
        vol_percent=$(pulseaudio-ctl | grep "Volume level" | cut -c 39-41)
        if [ $vol_percent -gt 66 ]; then
            vol_icon=elif [ $vol_percent -gt 33 ]; then
            vol_icon=else
            vol_icon=fi
        echo "V" "%{B$CLR1} ${AC}pulseaudio-ctl mute${AB}${AC4}pulseaudio-ctl up${AB}${AC5}pulseaudio-ctl down${AB}%{F$CLR7}${vol_icon}%{F-}${AE}${AE}${AE} %{B-} ${vol_percent}" > "$PANEL_FIFO"
    fi
    
  if [ "$(pidof mpd)" ];  then
    if [ "$(mpc status |grep playing)" ]; then
          currentsong=$(mpc current)
          mpd_icon=playing="$currentsong"
          echo "X""%{B$CLR1}%{F$CLR7}${AC}mpc prev${AB}   ${AE}${AC}mpc toggle${AB}${mpd_icon} ${AE}${AC}mpc next${AB}  ${AE}%{F-}%{B-} $playing "
        else
          mpd_icon=playing="Stopped..."
          echo "X""%{B$CLR1}%{F$CLR7}${AC}mpc prev${AB}   ${AE}${AC}mpc toggle${AB}${mpd_icon} ${AE}${AC}mpc next${AB}  ${AE}%{F-}%{B-} $playing "
    fi
  else
    mpd_icon=playing="Stopped..."
    echo "X""%{B$CLR1}%{F$CLR7}${AC}mpc prev${AB}   ${AE}${AC}mpc toggle${AB}${mpd_icon} ${AE}${AC}mpc next${AB}  ${AE}%{F-}%{B-} $playing "
  fi

    sleep 1
done > $PANEL_FIFO &

while [[ true ]]; do
    mem=$(free -m| grep  Mem | awk '{ print int($3/$2*100) }')
    read cpu a b c previdle rest < /proc/stat
    prevtotal=$((a+b+c+previdle))
    sleep 0.5
    read cpu a b c idle rest < /proc/stat
    total=$((a+b+c+idle))
    cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
    echo "C$cpu"
    echo "M$mem "
    sleep 3
done > $PANEL_FIFO &

while [[ true ]]; do
	QUAL=`iwconfig wlp3s0 | grep 'Link Quality=' | awk '{gsub(/[=/]/," "); print $3}'`
	MAX=`iwconfig wlp3s0 | grep 'Link Quality=' | awk '{gsub(/[=/]/," "); print $4}'`
	PERC=`echo $QUAL*100/$MAX | bc`
	SSID=$(essid -w wlp3s0)

	if [[ $PERC -le 15 ]]; then
			icon=""
	elif [[ $PERC -le 40 ]]; then
			icon=""
	elif [[ $PERC -le 70 ]]; then
			icon=""
	elif [[ $PERC -le 100 ]]; then
			icon=""
	fi

    if [ "$SSID" != "" ]; then
        essid="$SSID"
    else
        essid="Bağlantı Yok!"
		icon=""
    fi

	echo "S" "%{B$CLR1}%{F$CLR7} $icon %{F-}%{B-} ${essid}" 

    sleep 3
done > $PANEL_FIFO &

while [[ true ]]; do
            batt=$(battery -n 0)
            bat_perc=$(echo $batt | cut -d ' ' -f 2)
            bat_status=$(echo $batt | cut -d ' ' -f 1)

            if [ $bat_perc -gt 75 ]; then
                bat_symbol=""
            elif [ $bat_perc -gt 50 ]; then
                bat_symbol=""
            elif [ $bat_perc -gt 30 ]; then
                bat_symbol=""
            elif [ $bat_perc -gt 15 ]; then
                bat_symbol=""
            else
                bat_symbol=""
            fi

            if [ $bat_status == "Charging" ]; then
                bat_symbol=""
            fi

            echo "B" "%{B$CLR1}%{F$CLR7} $bat_symbol %{F-}%{B-} ${bat_perc}"

    sleep 30
done > $PANEL_FIFO &


while [[ true ]]; do
			wm_infos=""
			TAGS=( $(herbstclient tag_status $monitor) )
			for i in "${TAGS[@]}" ; do
				case ${i:0:1} in
					'#')
						# focused occupied desktop
						wm_infos="${wm_infos}%{F$CLR_FG}%{B$CLR_BG}%{U$CLR1} %{+u}${AC}${goto} ${i:1}${AB}       	${AE}%{-u} %{B-}%{F-}"
						;;
					'+')
						# focused free desktop
						wm_infos="${wm_infos}%{F$CLR_FG}%{B$CLR_BG}%{U$CLR1} %{+u}${AC}${goto} ${i:1}${AB}      	${AE}%{-u} %{B-}%{F-}"
						;;
					'!')
						# focused urgent desktop
						wm_infos="${wm_infos}%{F$CLR_FG}%{B$CLR_BG}%{U$CLR1} %{+u}${AC}${goto} ${i:1}${AB}       	${AE}%{-u} %{B-}%{F-}"
						;;
					':')
						# occupied desktop
						wm_infos="${wm_infos}%{F$CLR_FG}%{B$CLR_BG}%{U$CLR4} %{+u}${AC}${goto} ${i:1}${AB}       	${AE}%{-u} %{B-}%{F-}"
						;;
					 *)
						# free desktop
						wm_infos="${wm_infos}%{F$CLR_FG}%{B$CLR_BG}%{U$CLR0} %{+u}${AC}${goto} ${i:1}${AB}       	${AE}%{-u} %{B-}%{F-}"
						;;
				esac
				shift
			done
	echo "W$wm_infos"
    sleep .3
done > $PANEL_FIFO &

/home/doublet/.config/herbstluftwm/panel_bar < "$PANEL_FIFO" | lemonbar -g $PANEL_GEO -f "$FONT" -f "$ICON_FONT" -F $CLR_FG -B $CLR_BG -R $CLR_FG -u 6 -a 13 -r $BORDER  | while read line; do eval "$line"; done &

wait
 

x

panel_bar(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
#!/bin/sh

. panel_config

while read -r line ; do
	case $line in
		T*)
			clock="${AC}pop_cal${AB}%{B$CLR1}%{F$CLR7}  %{F-}%{B-} ${line#?} ${AE}"	
			;;
		C*)
			cpu="%{B$CLR1}%{F$CLR7}  %{F-}%{B-} ${line#?} "	
			;;
		M*)
			mem="%{B$CLR1}%{F$CLR7}  %{F-}%{B-} ${line#?}"	
			;;
		V*)
			vol="${line#?}"
			;;
		S*)
			wifi="${line#?}"
			;;
		B*)
			batt="${line#?}"
			;;
		X*)
			mpd="${line#?}"
			;;
		W*)
			wm_infos="${line#?}"
			;;
	esac
	printf "%s\n" "%{l}$mpd%{c}$wm_infos%{r}$cpu$SEP$mem$SEP$wifi$SEP$vol$SEP$batt$SEP$date$SEP$clock"
done
 

x

panel_config(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
PANEL_FIFO=/tmp/panel-fifo
PANEL_HEIGHT=22
PANEL_GEO=1896x18+10+0
BORDER=2
MON=0
FONT='Roboto-8:Medium'
ICON_FONT='i3fonticon-10:Regular'

# Colors
CLR0='#ff3e464e'		#BLACK
CLR1='#ffdb0a5b'		#RED
CLR2='#ff3fc380'		#GREEN
CLR3='#fff2784b'		#YELLOW
CLR4='#ff22a7f0'		#BLUE
CLR5='#fff64747'		#ORANGE
CLR6='#ff55aeae'		#CYAN
CLR7='#ffecf0f1'		#WHITE

CLR_BG='#FF141516'
CLR_FG='#FFECF0F1'

# Commands
AC='%{A:'				# start click area
AC4='%{A4:'				# start click area (wheel up)
AC5='%{A5:'				# start click area (wheel down)
AB=':}'					# end click area cmd
AE='%{A}'				# end click area
goto='herbstclient use'       		# go to this desktop

# Icons
DO=''					# occupied desktop
DF=''					# free desktop

SEP=" "
SEPR="%{F$CLR1}%{F-}"
SEPL="%{F$CLR1}%{F-}"
 

x

Notes

Font: Created with fontello. Here: https://github.com/TaylanTatli/dotfiles/raw/master/.fonts/i3fonticon.ttf
bar is lemonbar with xft and border support: https://github.com/dark-yux/bar