guest@dotshare [~/groups/wms/i3] $ ls Three-i3-themes/ | cat

Three i3 themes (scrot)

LightAir Apr 06, 2017 (wms/i3)

configs_config(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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
#--------------------------------------
# Секция настройки шрифтов
#--------------------------------------

font pango: Roboto Condensed 9


#--------------------------------------
# Секция переменных
#--------------------------------------

# Доступная палитра
# #EF5571 #8BABB6 #8BB3CC #E59757
# #C0A2BA #85B988 #C4BE67 #EE6555
# #DEDEDE #626262 #D64937 #21252E

# Цвета классы
set $cbfocol #DEDEDE
set $cbgfocol #DEDEDE
set $ctfocol #DEDEDE
set $cifocol #DEDEDE
set $cbficol #DEDEDE
set $cbgficol #DEDEDE
set $ctficol #DEDEDE
set $cificol #DEDEDE
set $cbuncol #DEDEDE
set $cbguncol #DEDEDE
set $ctuncol #DEDEDE
set $ciuncol #DEDEDE
set $cburcol #DEDEDE
set $cbgurcol #DEDEDE
set $cturcol #DEDEDE
set $ciurcol #DEDEDE
set $cbplcol #DEDEDE
set $cbgplcol #DEDEDE
set $ctplcol #DEDEDE
set $ciplcol #DEDEDE

# цвета ws
set $wbgcolor #21252E
set $wstcolor #f2ebc7
set $wspcolor #f2ebc7
set $fwbcolor #21252E
set $fwbgcolor #769070
set $fwtcolor #16100b
set $awbcolor #21252E
set $awbgcolor #348899
set $awtcolor #16100b
set $iwbcolor #21252E
set $iwbgcolor #4C5356
set $iwtcolor #16100b
set $uwbcolor #21252E
set $uwbgcolor #AC4344
set $uwtcolor #16100b

# gaps
set $gaps_inner 6
set $gaps_outer 10

# Путь до папки с конфигом
set $home /home/rain/.config/i3

# Клавиша windows
set $mod Mod4
# l
set $up 46
# k
set $down 45
# j
set $left 44
# ;
set $right 47

# воркспейсы
set $ws1 1:
set $ws2 2:
set $ws3 3:
set $ws4 4:
set $ws5 5:
set $ws6 6:
set $ws7 7:
set $ws8 8:
set $ws9 9:
set $ws10 10:


#--------------------------------------
# Бинд секция
#--------------------------------------

# Терминал
bindsym $mod+Return exec --no-startup-id urxvt
bindsym $mod+Shift+Return exec --no-startup-id terminology

# Закрыть окно mod + q
bindcode $mod+24 kill

# launcher mod + d
bindcode $mod+40 exec --no-startup-id $home/bin/dmenu.sh
bindcode $mod+Ctrl+40 exec --no-startup-id rofi
# http://www.webupd8.org/2016/06/how-to-get-unity-like-hud-searchable.html
# bindcode $mod+38 exec ~/.config/i3/bin/i3-hud-menu.py

# Система
# mod + ctrl + r
bindcode $mod+Ctrl+27 exec shutdown -r now
# mod + ctrl + o
bindcode $mod+Ctrl+32 exec shutdown -h now
# Перечитать файл конфига
# Mod + shift + c
bindcode $mod+Shift+54 reload
# Перезапуск wm. (Сохраняет лэйаут)
# Mod + shift + r
bindcode $mod+Shift+27 restart
# Выход (из X сессии)
# Mod + shift + e
bindcode $mod+Shift+26 exec "i3-nagbar -t warning -m 'Вы действительно хотите выйти?' -b 'Выход' 'i3-msg exit'"
# Lock Mod + shift + l
bindcode $mod+Ctrl+46 exec "xautolock -locknow"

# Раскладки
bindsym $mod+Ctrl+semicolon exec --no-startup-id $home/bin/set-dvorak.sh
bindsym $mod+Ctrl+s exec --no-startup-id $home/bin/set-default.sh

# фокус стрелками
bindsym $mod+Left focus left
bindsym $mod+Down focus down
bindsym $mod+Up focus up
bindsym $mod+Right focus right

# Фокус
bindcode $mod+$left focus left
bindcode $mod+$down focus down
bindcode $mod+$up focus up
bindcode $mod+$right focus right

# Перемещение окон стрелками
bindsym $mod+Shift+Left move left
bindsym $mod+Shift+Down move down
bindsym $mod+Shift+Up move up
bindsym $mod+Shift+Right move right

# Перемещение окон
bindcode $mod+Shift+$left move left
bindcode $mod+Shift+$down move down
bindcode $mod+Shift+$up move up
bindcode $mod+Shift+$right move right

# Разбить окно по горизонтали Mod + h
bindcode $mod+43 split h

# Разбить окно по вертикали Mod + v
bindcode $mod+55 split v

# Окно в фулскрин Mod + f
bindcode $mod+41 fullscreen

# Лайаут stacked, tabbed, toggle split
# Mod + s
bindcode $mod+39 layout stacking
# Mod + w
bindcode $mod+25 layout tabbed
# Mod + e
bindcode $mod+26 layout toggle split

# tiling / floating
bindsym $mod+Shift+space floating toggle

# фокус между tiling / floating
bindsym $mod+space focus mode_toggle

# Фокус родителя
# Mod + a
bindcode $mod+38 focus parent

# Фокус детей
#bindsym $mod+d focus child

# изменение бордюра
# Mod + t
bindcode $mod+28 border normal
# Mod + y
bindcode $mod+29 border 1pixel
# Mod + u
bindcode $mod+30 border none

# Переключение по воркспейсам
# Mod + z
bindcode $mod+52 workspace prev
# Mod + x
bindcode $mod+53 workspace next
# Mod + c
bindcode $mod+54 workspace back_and_forth

# Обои
# Mod + n
bindcode $mod+57 exec nitrogen --sort=time

# Браузер
# Mod + b
bindcode $mod+56 exec $home/bin/apprun/browser.sh

# IDE
# Mod + m
bindcode $mod+58 exec $home/bin/apprun/ide.sh

# Функциональные клавиши
## скриншотим
bindsym $mod+F3 exec scrot

## яркость
bindsym $mod+F4 exec --no-startup-id $home/bin/br-down.sh
#bindsym XF86MonBrightnessDown exec --no-startup-id $home/bin/br-down.sh
bindsym $mod+F5 exec --no-startup-id $home/bin/br-up.sh
#bindsym XF86MonBrightnessUp exec --no-startup-id $home/i3/bin/br-up.sh

## громкость
bindsym $mod+F7 exec --no-startup-id $home/bin/vol-down.sh
bindsym $mod+F8 exec --no-startup-id $home/bin/vol-up.sh

## плейер
bindsym $mod+F9 exec --no-startup-id mpc toggle
bindsym $mod+F10 exec --no-startup-id mpc stop
bindsym $mod+F11 exec --no-startup-id mpc prev
bindsym $mod+F12 exec --no-startup-id mpc next

## Настройка окон
for_window [class="(i?)ktorrent"] floating enable
for_window [class="Nitrogen"] floating enable
for_window [window_role="pop-up"] floating enable
for_window [class="xpad"] floating enable

# окно в scratchpad Mod + shift + -
bindcode $mod+Shift+20 move scratchpad

# Show the next scratchpad window or hide the focused scratchpad window.
# Mod + -
bindcode $mod+20 scratchpad show

# Переключение по воркспейсам
# Mod + 1..9, 0
bindcode $mod+10 workspace $ws1
bindcode $mod+11 workspace $ws2
bindcode $mod+12 workspace $ws3
bindcode $mod+13 workspace $ws4
bindcode $mod+14 workspace $ws5
bindcode $mod+15 workspace $ws6
bindcode $mod+16 workspace $ws7
bindcode $mod+17 workspace $ws8
bindcode $mod+18 workspace $ws9
bindcode $mod+19 workspace $ws10

# Перемещение в воркспейс
# Mod + shift + 1..9, 0
bindcode $mod+Shift+10 move container to workspace $ws1
bindcode $mod+Shift+11 move container to workspace $ws2
bindcode $mod+Shift+12 move container to workspace $ws3
bindcode $mod+Shift+13 move container to workspace $ws4
bindcode $mod+Shift+14 move container to workspace $ws5
bindcode $mod+Shift+15 move container to workspace $ws6
bindcode $mod+Shift+16 move container to workspace $ws7
bindcode $mod+Shift+17 move container to workspace $ws8
bindcode $mod+Shift+18 move container to workspace $ws9
bindcode $mod+Shift+19 move container to workspace $ws10

# Mod + shift + r
bindcode $mod+27 mode "resize"

# Ресайз окна (Можно юзать мышь)
mode "resize" {
        # These bindings trigger as soon as you enter the resize mode
        # Pressing left will shrink the window’s width.
        # Pressing right will grow the window’s width.
        # Pressing up will shrink the window’s height.
        # Pressing down will grow the window’s height.
        bindcode $left       resize shrink width 10 px or 10 ppt
        bindcode $down       resize grow height 10 px or 10 ppt
        bindcode $up         resize shrink height 10 px or 10 ppt
        bindcode $right      resize grow width 10 px or 10 pptbindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 -- +10% && killall -SIGUSR1 i3status

        # same bindings, but for the arrow keys
        bindsym Left        resize shrink width 10 px or 10 ppt
        bindsym Down        resize grow height 10 px or 10 ppt
        bindsym Up          resize shrink height 10 px or 10 ppt
        bindsym Right       resize grow width 10 px or 10 ppt

        # back to normal: Enter or Escape
        bindsym Return mode "default"
        bindsym Escape mode "default"
}


#--------------------------------------
# Секция assign
#--------------------------------------

# Раскидываем по воркспейсам

assign [class="(?i)ktorrent"]$ws2

assign [class="(?i)firefox"]$ws3
assign [class="(?i)chromium"]$ws3

assign [class="(?i)smplayer"] $ws4

assign [class="(?i)atom"]$ws5

assign [class="(?i)ristretto"]$ws6
assign [class="(?i)gwenview"]$ws6
assign [class="(?i)okular"]$ws6
assign [class="Viewnior"] $ws6

assign [class="(?i)libreoffice"]$ws7

assign [class="(?i)gimp"]$ws8
assign [class="(?i)inkscape"]$ws8
assign [class="(?i)blender"]$ws8

assign [class="(?i)nitrogen"]$ws10


#--------------------------------------
# Другие параметры
#--------------------------------------

# Mouse+$mod для перемещения плавающего окна
floating_modifier $mod

gaps inner $gaps_inner
gaps outer $gaps_outer

# Поребрик =)
new_window none
new_float pixel 2

hide_edge_borders both

# Красим окна
# class                 border   backgr.   text     indicator
client.focused          $cbfocol $cbgfocol $ctfocol $cifocol
client.focused_inactive $cbficol $cbgficol $ctficol $cificol
client.unfocused        $cbuncol $cbguncol $ctuncol $ciuncol
client.urgent           $cburcol $cbgurcol $cturcol $ciurcol
client.placeholder      $cbplcol $cbgplcol $ctplcol $ciplcol

client.background       #ffffff
#--------------------------------------
# Автозагрузка
#--------------------------------------

exec --no-startup-id $home/bin/autostart.sh
# exec --no-startup-id $home/bin/i3-appmenu-service.py

#--------------------------------------
# Бар
#--------------------------------------

bar {
    font pango: Roboto Condensed 9
    status_command i3status -c $home/i3status
    position top
    workspace_buttons yes
    # tray
    tray_output LVDS1
    tray_padding 1
    separator_symbol ""
    colors {
        background $wbgcolor
        statusline $wstcolor
        separator  $wspcolor

        # ws               border     bg         text
        focused_workspace  $fwbcolor  $fwbgcolor  $fwtcolor
        active_workspace   $awbcolor  $awbgcolor  $awtcolor
        inactive_workspace $iwbcolor  $iwbgcolor  $iwtcolor
        urgent_workspace   $uwbcolor  $uwbgcolor  $uwtcolor
    }
}

CLICK TO VIEW

x

configs_.Xdefaults(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
Xcursor.theme: Adwaitay



! ------------------------------------------------------------------------------
! ROFI Color theme
! ------------------------------------------------------------------------------
rofi.color-enabled: true
rofi.color-window: #21252e, #4c5356, #f2ebc7
rofi.color-normal: #21252e, #f2ebc7, #21252e, #769070, #f2ebc7
rofi.color-active: #21252e, #769070, #21252e, #769070, #21252e
rofi.color-urgent: #21252e, #ac4344, #21252e, #ac4344, #f2ebc7



! ------------------------------------------------------------------------------
! urxvt
! ------------------------------------------------------------------------------

! scrollbar
URxvt.scrollBar: false
URxvt.scrollstyle: next

URxvt*scrollTtyOutput: False
! прокрутка по нажатию клавиши
URxvt*scrollTtyKeypress: true
URxvt*scrollWithBuffer: true
URxvt*secondaryScroll: true

! font
URxvt*font: xft:DejaVu Sans Mono:style=Book:pixelsize=13
URxvt.letterSpace: -1

! colors
! Background color (black)
URxvt*background: #21252E
! Font color (white)
URxvt*foreground: #F2EBE5
! black
URxvt*color0: #21252E
! red
URxvt*color1: #AC4344
! green
URxvt*color2: #769070
! yellow
URxvt*color3: #DB9E36
! blue
URxvt*color4: #348899
! magenta
URxvt*color5: #AC404F
! cyan
URxvt*color6: #0077A6
! gray
URxvt*color7: gray90
! gray
URxvt*color8: grey50
! red
URxvt*color9: #AC4344
! green
URxvt*color10: #769070
! yellow
URxvt*color11: #DB9E36
! blue
URxvt*color12: #348899
! magenta
URxvt*color13: #AC404F
! cyan
URxvt*color14: #0077A6
! white
URxvt*color15: #f2ebc7


URxvt*saveLines: 5000
 

x

configs_dmenu.sh(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/bin/bash

fn="terminus-8"
nb="#D64937"
nf="#ffffff"
sb="#8BB3CC"
sf="#EEC665"
h="20"

i3-dmenu-desktop --dmenu="dmenu -nb '"$nb"' -nf '"$nf"' -fn '"$fn"' -sb '"$sb"' -sf '"$sf"' -h '"$h"'"
 

x

i3status(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
general {
    output_format = "i3bar"
    interval = 1
    colors = true
    color_good = "#769070"
    color_degraded = "#60867f"
    color_bad = "#AC4344"
}

order += "cpu_usage 0"
order += "disk /home"
order += "ethernet enp8s0"
order += "wireless wlp7s0"
order += "volume master"
order += "battery 0"
order += "tztime local"

wireless wlp7s0 {
    format_up = "   %essid "
    format_down = "  down "
}

ethernet enp8s0 {
    format_up = " : up "
    format_down = " : down "
}

battery 0 {
    format = "%status %percentage"
    path = "/sys/class/power_supply/BAT0/uevent"
    low_threshold = 20
    threshold_type = percentage
    status_chr = "  "
    status_bat = "  "
    status_full = "  "
    last_full_capacity = false
    integer_battery_capacity = true
}

tztime local {
    format = "   %H:%M:%S "
}

cpu_usage {
    format = "  CPU: %usage"
}

disk "/home" {
    format = "   %percentage_used of %total "
    prefix_type = custom
}

volume master {
    format = "   %volume "
    format_muted = "   %volume "
    device = "default"
    mixer = "Master"
    mixer_idx = 0
}
 

x

themes_dark.ini(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
[Palette]
red=#AC4344
white=#F2EBC7
blue=#348899
green=#769070
yellow=#FBD977
gray=#6C6C6C
black=#21252E
magenta=#c175c1
cyan=#429d9b

[i3Style]
cbfocol=black
cbgfocol=black
ctfocol=white
cifocol=white

cbficol=blue
cbgficol=blue
ctficol=black
cificol=black

cbuncol=gray
cbguncol=gray
ctuncol=white
ciuncol=white

cburcol=red
cbgurcol=red
cturcol=white
ciurcol=white

cbplcol=yellow
cbgplcol=yellow
ctplcol=black
ciplcol=black


wbgcolor=black
wstcolor=white
wspcolor=white

fwbcolor=green
fwbgcolor=green
fwtcolor=white

iwbcolor=black
iwbgcolor=black
iwtcolor=white

uwbcolor=red
uwbgcolor=red
uwtcolor=white

awbcolor=white
awbgcolor=white
awtcolor=black

gaps_inner=8
gaps_outer=2

[URxvt]
background=black
foreground=white

color0=black
color1=red
color2=green
color3=yellow
color4=blue
color5=magenta
color6=cyan
color7=gray

color8=black
color9=red
color10=green
color11=yellow
color12=blue
color13=magenta
color14=cyan
color15=white

[i3Status]
color_good=green
color_degraded=cyan
color_bad=red

[Dmenu]
fn="terminus-9"
nb=black
nf=white
sb=white
sf=black
h="20"
 

x

themes_gray.ini(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
[Palette]
red=#f19292
white=#f5f5f5
blue=#439fd2
green=#76da9d
yellow=#f4de71
gray=#a1a1a1
black=#6c6c6c
magenta=#e480e4
cyan=#2ccfcc
superblack=#11142a

[i3Style]
cbfocol=black
cbgfocol=black
ctfocol=white
cifocol=white

cbficol=blue
cbgficol=blue
ctficol=white
cificol=white

cbuncol=gray
cbguncol=gray
ctuncol=black
ciuncol=black

cburcol=red
cbgurcol=red
cturcol=white
ciurcol=white

cbplcol=yellow
cbgplcol=yellow
ctplcol=black
ciplcol=black


wbgcolor=black
wstcolor=white
wspcolor=white

fwbcolor=white
fwbgcolor=white
fwtcolor=black

iwbcolor=black
iwbgcolor=black
iwtcolor=white

uwbcolor=red
uwbgcolor=red
uwtcolor=superblack

awbcolor=green
awbgcolor=green
awtcolor=superblack

gaps_inner=8
gaps_outer=2

[URxvt]
background=black
foreground=white

color0=black
color1=red
color2=green
color3=yellow
color4=blue
color5=magenta
color6=cyan
color7=gray

color8=black
color9=red
color10=green
color11=yellow
color12=blue
color13=magenta
color14=cyan
color15=white

[i3Status]
color_good=green
color_degraded=cyan
color_bad=red

[Dmenu]
fn="terminus-9"
nb=black
nf=white
sb=white
sf=black
h="20"
 

x

themes_white-red.ini(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
[Palette]
red=#d64765
white=#DEDEDE
blue=#288fcf
green=#44ad4b
yellow=#e3ad2b
gray=#626262
black=#353b41
magenta=#d92c94
cyan=#06ada8

[i3Style]
cbfocol=red
cbgfocol=red
ctfocol=white
cifocol=white

cbficol=blue
cbgficol=blue
ctficol=white
cificol=white

cbuncol=white
cbguncol=white
ctuncol=gray
ciuncol=white

cburcol=green
cbgurcol=green
cturcol=black
ciurcol=white

cbplcol=yellow
cbgplcol=yellow
ctplcol=gray
ciplcol=white


wbgcolor=white
wstcolor=gray
wspcolor=black

fwbcolor=red
fwbgcolor=red
fwtcolor=white

iwbcolor=white
iwbgcolor=white
iwtcolor=red

uwbcolor=magenta
uwbgcolor=magenta
uwtcolor=white

awbcolor=black
awbgcolor=black
awtcolor=white

gaps_inner=8
gaps_outer=2

[URxvt]
background=white
foreground=black

color0=green
color1=red
color2=bleck
color3=yellow
color4=blue
color5=magenta
color6=cyan
color7=gray

color8=green
color9=red
color10=black
color11=yellow
color12=blue
color13=magenta
color14=cyan
color15=white

[i3Status]
color_good=green
color_degraded=cyan
color_bad=red

[Dmenu]
fn="terminus-9"
nb=white
nf=black
sb=red
sf=white
h="20"
 

x

bin_autostart.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
#!/bin/bash
# Перечитать конфиг без перезапуска иксов
#
# XDG_CURRENT_DESKTOP=kde
# QT_QPA_PLATFORM=kde
# QT_QPA_PLATFORM_THEME=kde

xrdb ~/.Xdefaults &

# Два моника
xrandr --output LVDS1 --mode 1366x768 --pos 0x0 --output VGA1 --mode 1920x1080 --pos -1920x0 &

# lxpolkit
lxpolkit &

#xsetroot -cursor_name left_ptr &
# обои
nitrogen --restore &

# плейер
mpd &

# compton
compton -o .2 &

# Демон уведомлений
volnoti -T "dark"

# раскладка
setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle" &

# клипбоард
# clipit &

# Локер
# ./locker.sh &
 

x

bin_br-down.sh(raw, dl)

1
2
3
4
5
6
7
#!/bin/bash

xbacklight -5

BR=`xbacklight -get | sed -r 's/\..+//'`

eval "volnoti-show -s /usr/share/pixmaps/volnoti/display-brightness-dark.svg $BR"
 

x

bin_br-up.sh(raw, dl)

1
2
3
4
5
6
7
#!/bin/bash

xbacklight +5

BR=`xbacklight -get | sed -r 's/\..+//'`

eval "volnoti-show -s /usr/share/pixmaps/volnoti/display-brightness-dark.svg $BR"
 

x

bin_colortest.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
#!/bin/bash
#
# ANSI color scheme script featuring Space Invaders
#
# Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
# Modified by lolilolicon
#

f=3 b=4
for j in f b; do
  for i in {0..7}; do
    printf -v $j$i %b "\e[${!j}${i}m"
  done
done
bld=$'\e[1m'
rst=$'\e[0m'

cat << EOF

 $f1  ▀▄   ▄▀     $f2 ▄▄▄████▄▄▄    $f3  ▄██▄     $f4  ▀▄   ▄▀     $f5 ▄▄▄████▄▄▄    $f6  ▄██▄  $rst
 $f1 ▄█▀███▀█▄    $f2███▀▀██▀▀███   $f3▄█▀██▀█▄   $f4 ▄█▀███▀█▄    $f5███▀▀██▀▀███   $f6▄█▀██▀█▄$rst
 $f1█▀███████▀█   $f2▀▀███▀▀███▀▀   $f3▀█▀██▀█▀   $f4█▀███████▀█   $f5▀▀███▀▀███▀▀   $f6▀█▀██▀█▀$rst
 $f1▀ ▀▄▄ ▄▄▀ ▀   $f2 ▀█▄ ▀▀ ▄█▀    $f3▀▄    ▄▀   $f4▀ ▀▄▄ ▄▄▀ ▀   $f5 ▀█▄ ▀▀ ▄█▀    $f6▀▄    ▄▀$rst

 $bld$f1▄ ▀▄   ▄▀ ▄   $f2 ▄▄▄████▄▄▄    $f3  ▄██▄     $f4▄ ▀▄   ▄▀ ▄   $f5 ▄▄▄████▄▄▄    $f6  ▄██▄  $rst
 $bld$f1█▄█▀███▀█▄█   $f2███▀▀██▀▀███   $f3▄█▀██▀█▄   $f4█▄█▀███▀█▄█   $f5███▀▀██▀▀███   $f6▄█▀██▀█▄$rst
 $bld$f1▀█████████▀   $f2▀▀▀██▀▀██▀▀▀   $f3▀▀█▀▀█▀▀   $f4▀█████████▀   $f5▀▀▀██▀▀██▀▀▀   $f6▀▀█▀▀█▀▀$rst
 $bld$f1 ▄▀     ▀▄    $f2▄▄▀▀ ▀▀ ▀▀▄▄   $f3▄▀▄▀▀▄▀▄   $f4 ▄▀     ▀▄    $f5▄▄▀▀ ▀▀ ▀▀▄▄   $f6▄▀▄▀▀▄▀▄$rst


                                     $f7▌$rst

                                   $f7▌$rst

                              $f7    ▄█▄    $rst
                              $f7▄█████████▄$rst
                              $f7▀▀▀▀▀▀▀▀▀▀▀$rst

EOF
 

x

bin_i3-appmenu-service.py(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
#!/usr/bin/env python3

from gi.repository import Gtk
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop

class i3AppmenuService(dbus.service.Object):
  def __init__(self):
    bus_name = dbus.service.BusName('com.canonical.AppMenu.Registrar', bus = dbus.SessionBus())
    dbus.service.Object.__init__(self, bus_name, '/com/canonical/AppMenu/Registrar')
    self.window_dict = dict()

  @dbus.service.method('com.canonical.AppMenu.Registrar',
    in_signature='uo',
    sender_keyword='sender')
  def RegisterWindow(self, windowId, menuObjectPath, sender):
    self.window_dict[windowId] = (sender, menuObjectPath)

  @dbus.service.method('com.canonical.AppMenu.Registrar',
    in_signature='u',
    out_signature='so')
  def GetMenuForWindow(self, windowId):
    if windowId in self.window_dict:
      sender, menuObjectPath = self.window_dict[windowId]
      return [dbus.String(sender), dbus.ObjectPath(menuObjectPath)]

  @dbus.service.method('com.canonical.AppMenu.Registrar')
  def Q(self):
    Gtk.main_quit()

DBusGMainLoop(set_as_default=True)
myservice = i3AppmenuService()
Gtk.main()

# GTK apps : get dbus service (xprop)
 

x

bin_i3-hud-menu.py(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
#!/usr/bin/env python3

import dbus
import subprocess

"""
  format_label_list
"""
def format_label_list(label_list):
  head, *tail = label_list
  result = head
  for label in tail:
    result = result + " > " + label
  return result

"""
  try_appmenu_interface
"""
def try_appmenu_interface(window_id):
  # --- Get Appmenu Registrar DBus interface
  session_bus = dbus.SessionBus()
  appmenu_registrar_object = session_bus.get_object('com.canonical.AppMenu.Registrar', '/com/canonical/AppMenu/Registrar')
  appmenu_registrar_object_iface = dbus.Interface(appmenu_registrar_object, 'com.canonical.AppMenu.Registrar')

  # --- Get dbusmenu object path
  try:
    dbusmenu_bus, dbusmenu_object_path = appmenu_registrar_object_iface.GetMenuForWindow(window_id)
  except dbus.exceptions.DBusException:
    return

  # --- Access dbusmenu items
  dbusmenu_object = session_bus.get_object(dbusmenu_bus, dbusmenu_object_path)
  dbusmenu_object_iface = dbus.Interface(dbusmenu_object, 'com.canonical.dbusmenu')
  dbusmenu_items = dbusmenu_object_iface.GetLayout(0, -1, ["label"])

  dbusmenu_item_dict = dict()

  """ explore_dbusmenu_item """
  def explore_dbusmenu_item(item, label_list):
    item_id = item[0]
    item_props = item[1]
    item_children = item[2]

    if 'label' in item_props:
      new_label_list = label_list + [item_props['label']]
    else:
      new_label_list = label_list

    # FIXME: This is not excluding all unactivable menuitems.
    if len(item_children) == 0:
      dbusmenu_item_dict[format_label_list(new_label_list)] = item_id
    else:
      for child in item_children:
        explore_dbusmenu_item(child, new_label_list)

  explore_dbusmenu_item(dbusmenu_items[1], [])

  # --- Run dmenu
  dmenu_string = ''
  head, *tail = dbusmenu_item_dict.keys()
  dmenu_string = head
  for m in tail:
    dmenu_string += '\n'
    dmenu_string += m

  dmenu_cmd = subprocess.Popen(['dmenu', '-i', '-l', '10'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  dmenu_cmd.stdin.write(dmenu_string.encode('utf-8'))
  dmenu_result = dmenu_cmd.communicate()[0].decode('utf8')
  dmenu_cmd.stdin.close()

  # --- Use dmenu result
  if dmenu_result in dbusmenu_item_dict:
    action = dbusmenu_item_dict[dmenu_result]
    print(dbusmenu_object_iface.Event(action, 'clicked', 0, 0))


"""
  try_gtk_interface
"""
def try_gtk_interface(gtk_bus_name_cmd, gtk_object_path_cmd):
  gtk_bus_name = gtk_bus_name_cmd.split(' ')[2].split('\n')[0].split('"')[1]
  print(gtk_object_path_cmd)
  gtk_object_path = gtk_object_path_cmd.split(' ')[2].split('\n')[0].split('"')[1]
  print("GTK MenuModel Bus name and object path: ", gtk_bus_name, gtk_object_path)

  # --- Ask for menus over DBus ---
  session_bus = dbus.SessionBus()
  gtk_menubar_object = session_bus.get_object(gtk_bus_name, gtk_object_path)
  gtk_menubar_object_iface = dbus.Interface(gtk_menubar_object, dbus_interface='org.gtk.Menus')
  gtk_action_object_actions_iface = dbus.Interface(gtk_menubar_object, dbus_interface='org.gtk.Actions')
  gtk_menubar_results = gtk_menubar_object_iface.Start([x for x in range(1024)])

  # --- Construct menu list ---
  gtk_menubar_menus = dict()
  for gtk_menubar_result in gtk_menubar_results:
    gtk_menubar_menus[(gtk_menubar_result[0], gtk_menubar_result[1])] = gtk_menubar_result[2]

  gtk_menubar_action_dict = dict()
  gtk_menubar_target_dict = dict()

  """ explore_menu """
  def explore_menu(menu_id, label_list):
    for menu in gtk_menubar_menus[menu_id]:
      if 'label' in menu:
        menu_label = menu['label'].replace('_', '')
      else:
        menu_label = '?'

      new_label_list = label_list + [menu_label]
      formatted_label = format_label_list(new_label_list)

      if 'action' in menu:
        menu_action = menu['action']
        gtk_menubar_action_dict[formatted_label] = menu_action
        if 'target' in menu:
          menu_target = menu['target']
          gtk_menubar_target_dict[formatted_label] = menu_target

      if ':section' in menu:
        menu_section = menu[':section']
        section_menu_id = (menu_section[0], menu_section[1])
        explore_menu(section_menu_id, label_list)

      if ':submenu' in menu:
        menu_submenu = menu[':submenu']
        submenu_menu_id = (menu_submenu[0], menu_submenu[1])
        explore_menu(submenu_menu_id, new_label_list)

  explore_menu((0,0), [])

  # --- Run dmenu
  dmenu_string = ''
  head, *tail = gtk_menubar_action_dict.keys()
  dmenu_string = head
  for m in tail:
    dmenu_string += '\n'
    dmenu_string += m

  dmenu_cmd = subprocess.Popen(['dmenu', '-i', '-l', '10'], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  dmenu_cmd.stdin.write(dmenu_string.encode('utf-8'))
  dmenu_result = dmenu_cmd.communicate()[0].decode('utf8')
  dmenu_cmd.stdin.close()

  # --- Use dmenu result
  if dmenu_result in gtk_menubar_action_dict:
    action = gtk_menubar_action_dict[dmenu_result]
    print('GTK Action :', action)
    gtk_action_object_actions_iface.Activate(action.replace('unity.', ''), [], dict())

"""
  main
"""

# --- Get X Window ID ---
window_id_cmd = subprocess.check_output(['xprop', '-root', '-notype', '_NET_ACTIVE_WINDOW']).decode('utf-8')
window_id = window_id_cmd.split(' ')[4].split('\n')[0]

print('Window id is :', window_id)

# --- Get GTK MenuModel Bus name ---

gtk_bus_name_cmd = subprocess.check_output(['xprop', '-id', window_id, '-notype', '_GTK_UNIQUE_BUS_NAME']).decode('utf-8')
gtk_object_path_cmd = subprocess.check_output(['xprop', '-id', window_id, '-notype', '_GTK_MENUBAR_OBJECT_PATH']).decode('utf-8')

if gtk_bus_name_cmd == '_GTK_UNIQUE_BUS_NAME:  not found.\n' or gtk_object_path_cmd == '_GTK_MENUBAR_OBJECT_PATH:  not found.\n':
  try_appmenu_interface(int(window_id, 16))
else:
  try_gtk_interface(gtk_bus_name_cmd, gtk_object_path_cmd)
 

x

bin_i3switch.py(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
#!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# i3 color theme switcher
#

import os
import argparse
import re
import configparser
from subprocess import call


def cb_i3(val, colors):
    """i3 callback"""
    return "set $" + val + " " + colors[val] + "\n"


def cb_urxvt(val, colors):
    """urxvt callback"""
    return "URxvt*" + val + ":" + colors[val] + "\n"


def cb_status(val, colors):
    """i3 status callback"""
    return val + " = \"" + colors[val] + "\"\n"


def cb_dmenu(val, colors):
    """dmenu callback"""
    return val + "=\"" + colors[val] + "\"\n"


def replace(old_path, new_path, reg, colors, cb):
    """ Поиск и замена в файле по регулярному выражению"""
    old = open(old_path, "r")
    new = open(new_path, "w")

    for line in old:
        a = re.search(reg, line.strip())
        if a and a.group(1) in colors:
            new.write(cb(a.group(1), colors))
        else:
            new.write(line)

    old.close()
    new.close()


def colors_replace(palette, style):
    """color replace"""
    for color in style:
        if style[color] in palette:
            style[color] = palette[style[color]]
    return style


def main():
    """Main"""
    i3 = os.path.expanduser('~/.config/i3/')
    home = os.path.expanduser('~/')

    parser = argparse.ArgumentParser()
    parser.add_argument("theme", action='store', type=str, help='used theme')
    args = parser.parse_args()

    theme = configparser.ConfigParser()
    theme.read(['../themes/' + args.theme + '.ini'])

    palette = dict(theme.items('Palette'))
    i3_colors = colors_replace(palette, dict(theme.items('i3Style')))
    urxvt_colors = colors_replace(palette, dict(theme.items('URxvt')))
    i3_status_colors = colors_replace(palette, dict(theme.items('i3Status')))
    dmenu_colors = colors_replace(palette, dict(theme.items('Dmenu')))

    sets = re.compile(r'.*set.*\$(.*)\s+(\S+)')
    replace("../configs/config", "/tmp/i3config", sets, dict(home=i3), cb_i3)
    replace("/tmp/i3config", i3 + "config", sets, i3_colors, cb_i3)

    urxvt = re.compile(r'.*URxvt\*(.*):\s*(\S+)')
    replace("../configs/.Xdefaults", home + ".Xdefaults", urxvt, urxvt_colors, cb_urxvt)

    i3status = re.compile(r'\s*(.*)\s+(=|\+=)\s+"(.*)"')
    replace("../configs/i3status", i3 + "i3status", i3status, i3_status_colors, cb_status)

    dmenu = re.compile(r'\s*(.*)\s*=\s*"(.*)"')
    replace("../configs/dmenu.sh", i3 + "bin/dmenu.sh", dmenu, dmenu_colors, cb_dmenu)

    call(["i3-msg", "restart"])
    call(["xrdb", home + ".Xdefaults"])
    call(["chmod", "+x", i3 + "bin/dmenu.sh"])

    print('ok')


if __name__ == "__main__":
    main()
 

x

bin_locker.sh(raw, dl)

1
2
3
#!/bin/sh

exec xautolock -detectsleep -locker 'i3lock -i /home/lightair/docs/pics/ls.png' -time 3 -notify 30 -notifier 'notify-send -u critical -t 10000 -- "LOCKING screen in 30 seconds"'
 

x

bin_set-default.sh(raw, dl)

1
2
3
4
5
#!/bin/bash

setxkbmap "us,ru" ",winkeys" "grp:alt_shift_toggle"

notify-send --expire-time=50 "Standart keyboard"
 

x

bin_set-dvorak.sh(raw, dl)

1
2
3
4
5
#!/bin/bash

setxkbmap "dvorak,ru" ",rud" "grp:alt_shift_toggle"

notify-send --expire-time=50 "Dvorak keyboard"
 

x

bin_vol-down.sh(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/bin/bash

VOL=`amixer -D pulse sset Master 5%- | cut -d"[" -f2 | sed -r 's/%.+//' | awk 'NR == 6{print}'`

if [ "$VOL" = "0" ]
then
	eval "volnoti-show -m $VOL"
else
	eval "volnoti-show $VOL"
fi
 

x

bin_vol-up.sh(raw, dl)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/bin/bash

VOL=`amixer -D pulse sset Master 5%+ | cut -d"[" -f2 | sed -r 's/%.+//' | awk 'NR == 6{print}'`

if [ "$VOL" = "0" ]
then
	eval "volnoti-show -m $VOL"
else
	eval "volnoti-show $VOL"
fi
 

x

bin_apprun_browser.sh(raw, dl)

1
2
3
#!/bin/bash

chromium-browser &&
 

x

bin_apprun_ide.sh(raw, dl)

1
2
3
#!/bin/bash

idea &&
 

x

Notes

i3 + theme switcher + 3 themes

github repo

repo

structure

i3config/
- bin
- configs
- themes

i3config

The configuration includes i3 theme switcher.

Depends

i3-gaps

dmenu

Font Roboto Condensed

Font Awesome

tvolnoti

nitrogen, mpd, compton, lxpolkit, xrandr, xbacklight

Install

Copy the entire contents of the directory in ~/.config/i3

Go to the folder ~/.config/i3/bin

Run python i3switch.py theme_name, where theme_name theme from “themes” folder

Comments

wz said about 1 week ago

Neat!