guest@dotshare [~/groups/wms/i3] $ ls Madness/ | cat

Madness (scrot) (+3 likes)

szorfein Dec 15, 2017 (wms/i3)

config-i3(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
#
# Settings
#

font -*-dina-medium-r-*-*-8-*-*-*-*-*-*-*

set $ws1 mail
set $ws2 web
set $ws3 code
set $ws4 media
set $ws5 gimp
set $ws6 focus

set $mod Mod4

gaps inner 18
gaps outer 32

for_window [class="^.*"] border normal 0
for_window [class=".*"] title_format " >_ %title "

#                         border  bg      text    indicat child_border
client.focused            #231417 #281d2a #848474 #4F4F4F #101110
client.focused_inactive   #231417 #141d24 #636357 #121212 #101110
client.unfocused          #231417 #17212a #68685b #4F4F4F #101107
client.urgent             #23181a #4a3d31 #6c777a #1A1A1A #1f1515
client.background         #231417

#
# Shortcut
#

bindsym $mod+Shift+C reload
bindsym $mod+Shift+R restart
bindsym $mod+Shift+E exit
bindsym $mod+Z kill

bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+Tab workspace back_and_forth

bindsym $mod+Shift+1 move container to workspace $ws1
bindsym $mod+Shift+2 move container to workspace $ws2
bindsym $mod+Shift+3 move container to workspace $ws3
bindsym $mod+Shift+4 move container to workspace $ws4
bindsym $mod+Shift+5 move container to workspace $ws5
bindsym $mod+Shift+6 move container to workspace $ws6

bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

bindsym Ctrl+$mod+l split h
bindsym Ctrl+$mod+j split v

bindsym $mod+s floating toggle

mode "resize" {
    bindsym Left resize shrink width 1 px or 1 ppt
    bindsym Down resize grow height 1 px or 1 ppt
    bindsym Up resize shrink height 1 px or 1 ppt
    bindsym Right resize grow width 1 px or 1 ppt

    bindsym h resize shrink width 1 px or 1 ppt
    bindsym j resize grow height 1 px or 1 ppt
    bindsym k resize shrink height 1 px or 1 ppt
    bindsym l resize grow width 1 px or 1 ppt

    bindsym Return mode "default"
    bindsym Escape mode "default"
}

bindsym $mod+r mode "resize"

#
# Personal Shortcut
#

bindsym $mod+space exec /usr/bin/rofi -show run
bindsym $mod+Return exec /usr/bin/termite

bindsym Mod1+Ctrl+Up exec mpc volume +2
bindsym Mod1+Ctrl+Down exec mpc volume -2
bindsym Mod1+Ctrl+Left exec mpc prev
bindsym Mod1+Ctrl+Right exec mpc next
bindsym Mod1+Shift+d exec mpc del 0

bindsym Mod5+F7 exec pkill -USR1 redshift
# if xbacklight doesn't work, install acpilight, else remove sudo bellow.
bindsym Mod5+F8 exec sudo xbacklight -1
bindsym Mod5+F9 exec sudo xbacklight +1
#bindsym Mod5+f exec termite -e ranger
#bindsym Mod5+n exec termite -e ncmpcpp
#bindsym Mod5+ exec \"vivaldi -incognito --proxy-server=\"http://localhost:39901\" --host-resolver-rules=\"MAP * 0.0.0.0,EXCLUDE localhost\"\"

#
# Wm Layout
# 

# xprop command for find class name
for_window [class="Lxappearance"] floating enable
for_window [class="Sxiv|feh"] floating enable
for_window [class="mpv"] floating enable
for_window [class="XFontSel"] floating enable
for_window [class="Gimp"] floating enable
#for_window [class="Zathura"] floating enable
for_window [class="Vivaldi-stable"] border pixel 1 

assign [class="Vivaldi-stable"]$ws2
assign [class="Gimp"]$ws5
assign [class="Zathura"]$ws4

#
# Exec
#

# Polybar top
exec_always --no-startup-id $HOME/.config/polybar/launch.sh

CLICK TO VIEW

x

config-polybar(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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
[colors]
background = ${xrdb:background}
background-alt = ${xrdb:color0}
foreground = ${xrdb:foreground}
foreground-alt = ${xrdb:color7}
primary = ${xrdb:color6}
secondary = ${xrdb:color13}
alert = ${xrdb:color9}

[bar/top]
dpi = 135
width = 98%
height = 40
offset-x = 1%
offset-y = 4
fixed-center = true
bottom = false

background = ${colors.background}
foreground = ${colors.foreground}

line-size = 0
line-color = #f00

border-size = 0
border-color = #00000000

padding-left = 2
padding-right = 2

module-margin-left = 0
module-margin-right = 2

font-0 = NotoSans-Regular:size=6;2
font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = "Material Icons:antialias=false:size=9;5"

modules-left = hostname tor ip mpd
modules-center = i3
modules-right = volume mail memory cpu temperature battery wlan eth date

wm-restack = i3
override-redirect = true

cursor-click = pointer
cursor-scroll = ns-resize

[module/xwindow]
type = internal/xwindow
label = %title:0:30:...%

[module/bspwm]
type = internal/bspwm

label-focused = %icon%
label-focused-background = ${colors.background-alt}
label-focused-underline= ${colors.primary}
label-focused-padding = 2

label-occupied = %icon%
label-occupied-padding = 2

label-urgent = %icon%!
label-urgent-background = ${colors.alert}
label-urgent-padding = 2

label-empty = %icon%
label-empty-foreground = ${colors.foreground-alt}
label-empty-padding = 2

[module/i3]
type = internal/i3
format = <label-state> <label-mode>
wrapping-scroll = false

; find icon name : fc-match -a |grep -i Material
; to find icon: xfd -fa MaterialIcons,
; echo "\ueXXX" to print and paste here
ws-icon-0 = mail;
ws-icon-1 = web;
ws-icon-2 = code;
ws-icon-3 = media;
ws-icon-4 = gimp;
ws-icon-5 = focus;

; focused = Active workspace on focused monitor
label-focused = %icon%
label-focused-background = ${module/bspwm.label-focused-background}
label-focused-underline = ${module/bspwm.label-focused-underline}
label-focused-padding = ${module/bspwm.label-focused-padding}

; unfocused = Inactive workspace on any monitor
label-unfocused = %icon%
label-unfocused-padding = ${module/bspwm.label-occupied-padding}

; visible = Active workspace on unfocused monitor
label-visible = %iconx%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}

; urgent = Workspace with urgency hint set
label-urgent = %icon%
label-urgent-background = ${module/bspwm.label-urgent-background}
label-urgent-padding = ${module/bspwm.label-urgent-padding}

[module/ip]
type = custom/script
interval = 2
format = "<label> "
format-prefix = " "
format-prefix-foreground = ${colors.primary}
exec = echo "$(curl --limit-rate 1k -s https://ifcfg.me)" || echo ""

[module/hostname]
type = custom/script
interval = 256
format = "<label> "
format-prefix = " "
format-prefix-foreground = ${colors.primary}
exec = echo "$(uname -n)"

[module/mail]
type = custom/script
; 600s = 10min
interval = 600
format = " <label> "
format-prefix = " "
format-prefix-foreground = ${colors.primary}
exec = ~/.config/polybar/mails

[module/tor]
type = custom/text
content = " "
content-foreground = ${colors.secondary}
; need into /etc/sudoers line bellow to work
; username ALL=(ALL) NOPASSWD: /bin/systemctl restart tor
click-left = "sudo systemctl restart tor"

[module/mpd]
type = internal/mpd
host = 127.0.0.1
port = 53000
format-online = <icon-prev> <icon-pause> <icon-play> <icon-next> 

icon-prev =
icon-play =
icon-pause =
icon-next =

toggle-on-foreground = ${colors.primary}
toggle-off-foreground = ${colors.secondary}

label-offline = no sound

[module/cpu]
type = internal/cpu
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.primary}
format-underline = #f90000
label = %percentage%%

[module/memory]
type = internal/memory
interval = 2
format-prefix = " "
format-prefix-foreground = ${colors.primary}
format-underline = #4bffdc
label = %percentage_used%%

[module/wlan]
type = internal/network
interface = wlp2s0
interval = 3.0

format-connected = <ramp-signal> <label-connected>
format-connected-underline = #9f78e1
label-connected = "%essid% -> %{F#aca074}%signal% %{F-}"

format-disconnected = offline
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}

ramp-signal-0 =
ramp-signal-1 =
ramp-signal-2 =
ramp-signal-3 =
ramp-signal-4 =
ramp-signal-foreground = ${colors.secondary}

[module/eth]
type = internal/network
interface = br0
interval = 3.0

format-connected-underline = #55aa55
format-connected-prefix = " "
format-connected-prefix-foreground = ${colors.foreground-alt}
label-connected = %local_ip%

format-disconnected = 
;format-disconnected = <label-disconnected>
;format-disconnected-underline = ${self.format-connected-underline}
;label-disconnected = %ifname% disconnected
;label-disconnected-foreground = ${colors.foreground-alt}

[module/date]
type = internal/date
interval = 5

date = " %d-%m-%Y"
date-alt = " %d-%m-%Y"

time = %H:%M
time-alt = %H:%M:%S

format-prefix = " "
format-prefix-foreground = ${colors.primary}
format-underline = #0a6cf5

label = %time% %date%

[module/volume]
type = custom/script
interval = 2
format = "<label> "
format-prefix = " "
format-prefix-foreground = ${colors.primary}
exec = echo "$(mpc volume | awk '{print $2}')"

[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 98

format-charging = <animation-charging> <label-charging>
format-charging-underline = #ffb52a

format-discharging = <ramp-capacity> <label-discharging>
format-discharging-underline = ${self.format-charging-underline}

format-full-prefix = " "
format-full-prefix-foreground = ${colors.foreground}
format-full-underline = ${self.format-charging-underline}

ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-foreground = ${colors.foreground-alt}

animation-charging-0 =
animation-charging-1 =
;animation-charging-2 =
animation-charging-foreground = ${colors.foreground-alt}
animation-charging-framerate = 750

[module/temperature]
type = internal/temperature
thermal-zone = 0
warn-temperature = 60

format = <ramp> <label>
format-underline = #f50a4d
format-warn = <ramp> <label-warn>
format-warn-underline = ${self.format-underline}

label = %temperature%
label-warn = %temperature%
label-warn-foreground = ${colors.secondary}

ramp-0 =
ramp-1 =
ramp-2 =
ramp-foreground = ${colors.foreground-alt}

[settings]
screenchange-reload = true

[global/wm]
margin-top = 0
margin-bottom = 0
 

x

launch.sh(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#!/usr/bin/env sh

# Terminate already running bar instances
killall -q polybar

# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done

# Launch bar1 and bar2
polybar top &

echo "Bars launched..."
 

x

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

# This program will automatically search your mails.
# And print number of new messages.
# Require another prog for doing this, offlineimap, msmtp or isync.

gmaildir=/home/user/.mails/Gmail/\[Gmail\].All\ Mail/new
prog=/usr/bin/offlineimap
count=0
log=/tmp/mails.log

if [ -x $prog ] ; then 

    $prog 2>/dev/null &
    wait
    
    if [ $? = 0 ] ; then 
        echo "$(date) - $prog success" >> $log
    elif [ $? = 1 ] ; then
        echo "$(date) - $prog has fail" >> $log
    else
        echo "$(date) - unknown prob" >> $log
    fi
fi

if [[ ! -d ${gmaildir} ]] ; then 
    echo "$(date) - $gmaildir does not exist" >> $log
elif [[ ! -n $(ls "${gmaildir}") ]] ; then
    echo "$(date) - $gmaildir no new mail found" >> $log
else
    count=$(ls -1 "${gmaildir}" | wc -l)
fi

echo "${count}"
 

x

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
! Special
*background:    #151d22
*foreground:    #afe1d2
*.cursorColor:  #2d4944

! black
*color0: #1d282f
*color8: #344048

! red
*color1: #6b3659
*color9: #874272

! Green
*color2: #396f5e
*color10: #448773

! Yellow
*color3: #cbd59a
*color11: #f0f8c9

! Blue
*color4: #364670
*color12: #455a8e

! Magenta
*color5:  #613a73
*color13: #794b87

! Cyan
*color6: #1c6689
*color14: #207ba2

! White
*color7:  #93cfbd
*color15: #b8eadb

! Rofi
!                                   fg                    bgSelect fgSelect
rofi.color-normal: argb:00000000, #1f7590, argb:00000000, #1d282f,#a3d3b0
!                          bg      border 
rofi.color-window: argb:ff151d22, #132122, #832757
 

x

Notes

i3gaps and polybar

all dots and list dependencies are on github

install, copy:

  • config-i3 to ~/.config/i3/config
  • config-polybar to ~/.config/polybar/config
  • launch.sh to ~/.config/polybar/launch.sh
  • mails to ~/.config/polybar/mails
  • colors where u want :)

Comments

penguin1 said about 11 months ago

I took you for a qutebrowseer user ;)
really nice as always

ps
as long as you use termite - why do you show off the colors in Xresourse format?
show em off in termite format and let the urxvt users convert them :D :D :D

edited about 11 months ago

quelotic said about 4 months ago

This looks great, thought the colors for the terminal don’t match in my rxvt.. what could be it?