guest@dotshare [~/groups/wms/bspwm] $ ls urban-dark/ | cat

urban dark (scrot)

magdeoz21 Sep 03, 2017 (wms/bspwm)

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

bspc monitor -d I II III IV V
gap=8

bspc config window_gap $gap
bspc config top_padding $(($PANEL_HEIGHT-gap))
bspc config left_padding -$gap
bspc config right_padding -$gap
bspc config bottom_padding -$gap
bspc config border_width        0

bspc config split_ratio          0.52
bspc config borderless_monocle   true
bspc config gapless_monocle      true
bspc config history_aware_focus     true
bspc config adaptive raise          true

bspc desktop I --layout monocle
bspc desktop III --layout monocle
bspc rule -a Google-chrome desktop='^1' private=on
bspc rule -a XTerm desktop='^2'
bspc rule -a XTerm:ncmpcpp state=floating
bspc rule -a Nautilus desktop='^3'
bspc rule -a Spotify desktop='^4'
bspc rule -a Gimp desktop='^5' state=floating follow=on
bspc config focus_follows_pointer true

bspc config normal_border_color "#d9c1a9"
bspc config focused_border_color "#d9c1a9"
bspc config presel_feedback_color "#783e57"

xsetroot -cursor_name left_ptr
feh --bg-fill ~/backgrounds/urban.jpg
~/.themes/bspwm/Dark/panel &
sxhkd -c ~/.themes/bspwm/sxhkd/sxhkdrc

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
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
225
226
227
228
229
#! /bin/sh


FONT="-xos4-terminesspowerline-medium-r-normal--12-120-72-72-c-60-iso10646-1"
FONT2="-*-fontawesome-medium-r-normal-*-12-*-*-*-*-0-*-*"
#FONT="-*-tamsyn-medium-r-normal-*-12-*-*-*-*-*-*-1"
ICONS="-xos4-terminusicons2mono-medium-r-normal--12-120-72-72-m-60-iso8859-1"
ICONS2="-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1"
BG="#1F201D"

BARHEIGHT=25
EDGEWIDTH=1
UNDERLINE_WIDTH=2

# Don't touch.  Edit width/height above instead.
SCREENHEIGHT=$(xrandr -q | grep Screen | awk '{print $10}' | sed s/,//)
SCREENWIDTH=$(xrandr -q | grep Screen | awk '{print $8}')
BARWIDTH=$(($SCREENWIDTH - $(($EDGEWIDTH * 2))))

source $(dirname $0)/panel_icons
source $(dirname $0)/panel_colors
source $(dirname $0)/panel_conf

if xdo id -a "$PANEL_WM_NAME" > /dev/null ; 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 subscribe |\
        grep -oE "[Mm][^TM]*[TML]" --line-buffered |\
        while read line; do echo W$line; done > "$PANEL_FIFO" &

{

function GETIME {
        case $1 in
                HOUR)
                        timed=$(date | grep -o "[0-9]*:[0-9]*")
                        hour=$(date "+%H")
                        min=$(date "+%M")
                        mdhr=$((10#$hour % 12))
                        mdhr=11
                        part="AM"
                        if [[ "$hour" > 11 ]]; then
                                part="PM"
                        fi
                        if [[ "$mdhr" == 0 ]]; then
                                mdhr=12
                        fi
                        ICON=$(pIcon "#b0a9ab" ${CCLOCK})
                        OUTPUT=$(echo "${ICON} $hour:$min $part")
                        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_CLOCK_FG} "${OUTPUT}")
                        echo -e "${clr}"
                        ;;
                DATE)
                        ICON=$(pIcon "#b0a9ab" ${CDATE})
                        OUT=$(date +'%Y-%m-%d')
                        OUTPUT=$(echo $ICON $OUT)
                        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_SYS_FG} "${OUTPUT}")
                        echo -e "${clr}"
        esac
}

function FOCUS () {
        wnd_focus=$(xdotool getwindowfocus)
        wnd_title=$(xprop -id $wnd_focus WM_CLASS | grep -Po "\".*?\"" | head -1 | grep -Po "[^\"]*" )
        if [[ "$wnd_title" == '' ]]; then
                wnd_title='Desktop'
        elif [[ "$wnd_title" == 'google-chrome' ]]; then
                wnd_title='Google Chrome'
        elif [[ "$wnd_title" == "telegram-desktop" ]]; then
                wnd_title='Telegram'
        fi
        get_icon=$(ICONFOCUS "$wnd_title")
        ICON=$(pIcon "#b0a9ab" ${get_icon})
        OUTPUT=$(echo -e $ICON $wnd_title)
        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_SYS_FG} "${OUTPUT}")
        echo -e "${clr}"
}

function BATERY () {
        stat=$(acpi -b | awk '{print $3}' | cut -d ',' -f1)
        batery=$(acpi -b | grep -P -o '[0-9]+(?=%)')
        if [ $stat == "Charging" ]; then
                ICON=$(pIcon "#b0a9ab" $CAC)
                batery="AC"
                por=""
        else
                por="% "
                if [ $batery -gt 90 ]; then
                        ICON=$(pIcon "#b0a9ab" $BAT100)
                elif [ $batery -gt 70 ] && [ $batery -lt 90 ]; then
                        ICON=$(pIcon "#b0a9ab" $BAT70)
                elif [ $batery -gt 50 ] && [ $batery -lt 70 ]; then
                        ICON=$(pIcon "#b0a9ab" $BAT50)
                elif [ $batery -gt 30 ] && [ $batery -lt 50 ]; then
                        ICON=$(pIcon "#b0a9ab" $BAT30)
                elif [ $batery -gt 15 ] && [ $batery -lt 30 ]; then
                        ICON=$(pIcon "#b0a9ab" $BAT15)
                elif [ $batery -lt 7 ]; then
                        ICON=$(pIcon "#b0a9ab" $BAT7)
                fi
        fi
        OUTPUT=$(echo -e "${ICON} ${batery}${por}")
        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_BATERY_FG} "${OUTPUT}")
        echo -e "${clr}"
}

function CPUINFO () {
        case $1 in
                FREE)
                        ICON=$(pIcon "#b0a9ab" $CCPU)
                        mem=$(free -m | grep Mem: | awk '{printf $3 "/" $2 "Mb"}')
                        output=$(echo -e "${ICON} ${mem}")
                        cmd=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_FREE_FG} "${output}")
                        local clr=$(pActionSimple "xterm -e vtop --theme wizard &>/dev/null" "${cmd}" )
                        echo -e "${clr}"
                        ;;
                TEMP)
                        temp=$(echo "scale=1; " `cat /sys/class/hwmon/hwmon0/temp1_input` "/1000" | bc)
                        OUTPUT=$(echo -e "${CTEMP} ${temp}°C")
                        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_TEMP_FG} "${OUTPUT}")
                        echo -e "${clr}"
                        ;;
                LOAD)
                        ICON=$(pIcon "#b0a9ab" $CRAM)
                        cpu=$(grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}')
                        c_lvl=`printf "%.0f" $cpu`
                        cmd=$(echo "$c_lvl%")
                        OUTPUT=$(echo "${ICON} ${cmd} ")
                        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_TEMP_FG} "${OUTPUT}")
                        echo -e "${clr}"
                        ;;
        esac
}

function DISK () {
        ICON=$(pIcon "#b0a9ab" $CDRIVE)
        DISK=$( df -h /home | tail -1 | grep 'Filesystem\|/home*' | awk '{printf $4 "/" $2}')
        OUTPUT=$(echo "${ICON} ${DISK}")
        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_DRIVES_FG} "${OUTPUT}")
        echo -e "${clr}"
}

function NET () {
        local _GETIWL=$(iwgetid -r)
        local _GETETH=$(ip a | grep "state UP" | awk '{ORS=""}{print $2}' | cut -d ':' -f 1)
        local _status=${_GETIWL:-$_GETETH}
        local _status2="${_status:-Down}"
        echo -e "${CWIFI} ${_status2}"
}

function VOL () {
    VOLUME=$(pulseaudio-ctl full-status | awk '{split($0, array, " ")} END{print array[1]}')
    MUTE=$(pulseaudio-ctl full-status | awk '{split($0, array, " ")} END{print array[2]}')
    if [ "$MUTE" == "yes" ]; then
            echo "Mute"
    else
            echo -e "${CVOLUME} $VOLUME%"
    fi
}

CMusic() {
        prev=$(echo "%{F#7c7c7e}%{B${COLOR_DEFAULT_BG}}%{A:mpc prev &>/dev/null:}$(printf '%b' ${CPREV})%{A}%{B-}%{F-}")
        pause=$(echo "%{F#7c7c7e}%{B${COLOR_DEFAULT_BG}}%{A:mpc pause &>/dev/null:}$(printf '%b' ${CPAUS})%{A}%{B-}%{F-}")
        play=$(echo "%{F#7c7c7e}%{B${COLOR_DEFAULT_BG}}%{A:mpc play &>/dev/null:}$(printf '%b' ${CPLAY})%{A}%{B-}%{F-}")
        next=$(echo "%{F#7c7c7e}%{B${COLOR_DEFAULT_BG}}%{A:mpc next &>/dev/null:}$(printf '%b' ${CNEXT})%{A}%{B-}%{F-}")
        echo "${prev}${pause}${play}${next}"
}

function MUSIC (){
        OS=$(uname -n)
        ICONARCH=$(echo -e "%{F#1793D1}$(printf '%b' ${ARCH})%{F-}")
        ICONMUSIC=$(echo -e "%{F#782e43}$(printf '%b' ${CSOUND})%{F-}")
        local stat="$(mpc status | grep \# | awk '{print $1}')"
        local artist=$(mpc -f %artist% current)
        local musicname=$(mpc -f %title% current)
        local cmd=""
        if [ "${stat}" ] && [ "${stat}" = "[playing]" ] ; then
                cmd="Playing >> ${artist:0:10} - ${musicname:0:15}"
        elif [ "${stat}" ] && [ "${stat}" = "[paused]" ] ; then
                cmd="Paused >> ${artist:0:10} - ${musicname:0:20}"
        else
                cmd="No Sound"
        fi

        OUT=$(echo "${ICONMUSIC} ${cmd}")
        local clr=$(pText ${COLOR_DEFAULT_FG} "${OUT}")
        OUTPUT=$(echo "%{A:xterm -e ncmpcpp &>/dev/null:}${clr}%{A}")
        local clr=$(pTextUnderline ${COLOR_DEFAULT_FG} ${COLOR_TEMP_FG} "${OUTPUT}")
        echo -e ${clr}
}

while :; do
        echo "S %{F$COLOR_DEFAULT_FG} \
                %{l} $(FOCUS) $(CMusic) $(MUSIC)\
                %{r}$(CPUINFO FREE)  $(CPUINFO LOAD)  $(DISK)  $(BATERY) $(GETIME DATE) $(GETIME HOUR)"
        sleep .5
done
} > "$PANEL_FIFO" &

$(dirname $0)/panel_bar < "$PANEL_FIFO" | lemonbar \
        -a 32 \
        -n "$PANEL_WM_NAME" \
        -g ${BARWIDTH}x${BARHEIGHT}+${EDGEWIDTH} \
        -u 2 \
        -f ${FONT} \
        -f ${FONT2} \
        -f ${ICONS} \
        -f ${ICONS2} \
        -F "$COLOR_DEFAULT_FG" \
        -B "$COLOR_DEFAULT_BG" | sh | while read line; do eval "$line"; done &

wid=$(xdo id -a "$PANEL_WM_NAME")
tries_left=20
while [ -z "$wid" -a "$tries_left" -gt 0 ] ; do
	sleep 0.05
	wid=$(xdo id -a "$PANEL_WM_NAME")
	tries_left=$((tries_left - 1))
done
[ -n "$wid" ] && xdo above -t "$(xdo id -N Bspwm -n root | sort | head -n 1)" "$wid"

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
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
#! /bin/bash
#

source $(dirname $0)/panel_colors
source $(dirname $0)/panel_icons

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

while read -r line ; do
        case $line in
                S*)
                        #sys="%{F$COLOR_SYS_FG}%{B$COLOR_SYS_BG} ${line#?} %{B-}%{F-}"
                        sysR="${line#?}"
                        ;;
                T*)
                        #title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG} ${line#?} %{B-}%{F-}"
                        sysL="${line#?}"
                        ;;
                W*)
                        # bspwm's state
                        wm=""
                        IFS=':'
                        set -- ${line#?}
                        while [ $# -gt 0 ] ; do
                                item=$1
                                name=${item#?}
                                case $item in
                                        [mM]*)
                                                [ $num_mon -lt 2 ] && shift && continue
                                                case $item in
                                                        m*)
                                                                # monitor
                                                                FG=$COLOR_MONITOR_FG
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                        M*)
                                                                # focused monitor
                                                                FG=$COLOR_FOCUSED_MONITOR_FG
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                esac
                                                wm="${wm}%{F${FG}}%{B${BG}}%{A:bspc monitor -f ${name}:} ${name} %{A}%{B-}%{F-}"
                                                ;;
                                        [fFoOuU]*)
                                                case $item in
                                                        f*)
                                                                # free desktop
                                                                FG=$COLOR_FREE_FG
                                                                IC=${CNONE}
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                        F*)
                                                                # focused free desktop
                                                                FG=$COLOR_FOCUSED_FREE_FG
                                                                IC=${CNONE}
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                        o*)
                                                                # occupied desktop
                                                                FG=$COLOR_OCCUPIED_FG
                                                                IC=${CFULL}
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                        O*)
                                                                # focused occupied desktop
                                                                FG=$COLOR_FOCUSED_OCCUPIED_FG
                                                                IC=${CFULL}
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                        u*)
                                                                # urgent desktop
                                                                FG=$COLOR_URGENT_FG
                                                                IC=${CNONE}
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                        U*)
                                                                # focused urgent desktop
                                                                FG=$COLOR_FOCUSED_URGENT_FG
                                                                IC=${CFULL}
                                                                BG=$COLOR_DEFAULT_BG
                                                                ;;
                                                esac
                                                wm="${wm}%{F${FG}}%{B${BG}}%{A:bspc desktop -f ${name}:}  $(printf '%b' $IC) %{A}%{B-}%{F-}"
                                                ;;
                                        [LTG]*)
                                                # layout, state and flags
                                                #wm="${wm}%{F$COLOR_STATE_FG}%{B$COLOR_STATE_BG} ${name} %{B-}%{F-}"
                                                wm="${wm}%{F$COLOR_STATE_FG}%{B$COLOR_STATE_BG} %{B-}%{F-}"
                                                ;;
                                esac
                                shift
                        done
                        ;;
        esac
        printf "%s\n" "%{l}${sysL}%{c}${wm}%{r}${sysR}"
done
 

x

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


COLOR_DEFAULT_FG="#7c7c7e"
#COLOR_DEFAULT_BG="#2b2c33"
COLOR_DEFAULT_BG="#353234"

COLOR_MONITOR_FG="#A0A0A0"
COLOR_MONITOR_BG="#2b2c33"

COLOR_FOCUSED_MONITOR_FG="#b1d0e8"
COLOR_FOCUSED_MONITOR_BG="#232323"

COLOR_FREE_FG="#844662"
COLOR_FREE_BG="#232323"

COLOR_FOCUSED_FREE_FG="#846774"
COLOR_FOCUSED_FREE_BG="#232323"

COLOR_OCCUPIED_FG="#6a3946"
COLOR_OCCUPIED_BG="#232323"

COLOR_FOCUSED_OCCUPIED_FG="#844662"
COLOR_FOCUSED_OCCUPIED_BG="#232323"

COLOR_URGENT_FG="#578c6a"
COLOR_URGENT_BG="#232323"

COLOR_FOCUSED_URGENT_FG="#782e43"
COLOR_FOCUSED_URGENT_BG="#232323"

COLOR_STATE_FG="#89b09c"
COLOR_STATE_BG="#353234"

COLOR_TITLE_FG="#a8a2c0"
COLOR_TITLE_BG="#232323"

COLOR_SYS_FG="#b1a57d"
COLOR_SYS_BG="#232323"

COLOR_CLOCK_FG="#144b6c"
COLOR_BATERY_FG="#87556b"

COLOR_FREE_FG="#6b7993"
COLOR_TEMP_FG="#782e43"

COLOR_DRIVES_FG="#578c6a"
COLOR_MUSIC_FG="#4b5f84"
 

x

panel_icons(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
#!\bin\bash

# icons
GENTOO="\ue1ec"
ARCH="\uf17c"
CSTART="\ue00d"
CSOUND="\ue04d"
CVOLUME="\ue204"
CMAIL="\ue070"
CDRIVE="\ue026"
CRAM="\ue19a"
CCPU="\ue021"
CTEMP="\ue0cc"
CNET="\ue04b"
CWIFI="\ue222"
# Time
CTIME="\ue018"
CPACK="\ue1b7"
CCLOCK="\ue015"
CDATE="\ue266"
# panel center
#CNONE="\ue0c0"
CNONE="\ue023"
#CFULL="\ue0c1"
CFULL="\ue022"
# icons panel music
CPREV="\ue055"
CNEXT="\ue05b"
CPLAY="\ue058"
CPAUS="\ue059"
# icon volume
VPLUS="\ue06c"
VMINUS="\ue06d"
# battery or AC
BAT100="\ue254"
BAT70="\ue252"
BAT50="\ue250"
BAT30="\ue24f"
BAT15="\ue24e"
BAT7="\ue24c"
CAC="\ue215"

## programs
URXVT="\uf120"
XTERM="\uf120"
CHROME="\uf268"
DESK="\uf108"
FILEM="\uf07b"
 

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
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
#include "/home/magdeoz/.termcolors/common"
#include "/home/magdeoz/.termcolors/5725"

! --------test ----
Xft.dpi:                        109
Xft.antialias:                  1
Xft.autohint:                   1
Xft.hinting:                    1
Xft.hintstyle:                  hintslight
Xft.lcdfilter:                  lcdlight
Xft.rgba:                       rgb

*xterm*faceName:                xft:Fantasque Sans Mono:pixelsize=14.5
URxvt.font:             xft:Fantasque Sans Mono:pixelsize=14.5
!xterm*lineSpace:                -3
!xterm.letterSpace:              -1
xterm.iso14755:                 false
xterm.iso14755_52:              false
xterm*geometry:                 65x17
xterm.scrollBar:                false
URxvt.scrollBar: false
xterm*loginShell:               true
xterm.internalBorder:           35
! -----------------

xterm*termName: xterm-256color
*xterm*borderWidth: 0
xterm*locale: true
xterm*salveLines: 4096
xterm*faceSize: 9
xterm*saveLines: 4096
xterm*cursorBlink: True
xterm*loginshell: False

xterm*VT100.Translations: #override \
                 Ctrl Shift <Key>V:    insert-selection(CLIPBOARD) \n\
                 Ctrl Shift <Key>C:    copy-selection(CLIPBOARD)


*background:	bg
*foreground:	fg
*color0:		blk
*color8:		bblk
*color1:		red
*color9:		bred
*color2:		grn
*color10:		bgrn
*color3:		ylw
*color11:		bylw
*color4:		blu
*color12:		bblu
*color5:		mag
*color13:		bmag
*color6:		cyn
*color14:		bcyn
*color7:		wht
*color15:		bwht
 

x

5725(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#define blk   #363334
#define bblk  #5c575b
#define red   #854340
#define grn   #97a293
#define ylw   #c29f6f
#define blu   #5e606c
#define mag   #7a6054
#define cyn   #78746c
#define wht   #c3c1b8
#define bred  #854340
#define bgrn  #97a293
#define bylw  #c29f6f
#define bblu  #5e606c
#define bmag  #7a6054
#define bcyn  #78746c
#define bwht  #c3c1b8
 

x

common(raw, dl)

1
2
#define	bg	#353234
#define fg    #f5c497
 

x