guest@dotshare [~/groups/wms/i3] $ ls zen-arch/ | cat

zen arch (scrot) (+2 likes)

okubax Nov 06, 2017 (wms/i3)

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
#okubax


# GENERAL {{{


set $mod Mod4
floating_modifier $mod
popup_during_fullscreen smart

gaps inner 10
gaps outer 10

font pango: inconsolata 10
for_window [class=".*"] title_format "<span font='inconsolata 8'> > %title</span>"


# Set colors from Xresources
# Change 'color7' and 'color2' to whatever colors you want i3 to use 
# from the generated scheme.
# NOTE: The '#f0f0f0' in the lines below is the color i3 will use if
# it fails to get colors from Xresources.
set_from_resource $fg i3wm.color2 #f0f0f0
set_from_resource $bg i3wm.color7 #f0f0f0


# class                 border  backgr. text indicator child_border
client.focused          $bg     $fg     $bg  $bg       $bg
client.focused_inactive $bg     $bg     $fg  $bg       $bg
client.unfocused        $bg     $bg     $fg  $bg       $bg
client.urgent           $bg     $bg     $fg  $bg       $bg
client.placeholder      $bg     $bg     $fg  $bg       $bg

client.background       $bg

# WINDOW RULES {{{


for_window [class="xpad" instance="scratchpad"] move scratchpad
for_window [class="Chromium|Firefox|MPlayer|Galculator|Code|Gsimplecal|Viewnior|xpad|calibre|Java|Spotify|Google-musicmanager|File-roller|Lxappearance|Arandr|Pavucontrol|emulator64-arm|Kamoso|PkgBrowser|Gimp|Main.py|qemu-system-x86_64|Pinentry"] floating enable
for_window [class="URxvt"] floating enable,resize set 820 480
for_window [class="Thunar"] floating enable,resize set 880 640
for_window [title="TrueCrypt|Google Keep"] floating enable
for_window [title="File Operation Progress" class="Thunar"] floating enable
for_window [window_role="pop-up"] floating enable,move absolute center
# force floating for all new windows
#for_window [class="[.]*"] floating enable


# }}}




# KEYBINDS {{{


bindsym $mod+Shift+C reload
bindsym $mod+Shift+R restart
bindsym $mod+q kill
bindsym $mod+Shift+E exit
bindsym $mod+f fullscreen
bindsym $mod+Shift+space floating toggle
bindsym $mod+space focus mode_toggle
bindsym $mod+bar split h
bindsym $mod+underscore split v
bindsym $mod+s layout stacking
bindsym $mod+x layout tabbed
bindsym $mod+z layout default


# move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

# workspace
bindsym $mod+1 workspace 1
bindsym $mod+2 workspace 2
bindsym $mod+3 workspace 3
bindsym $mod+4 workspace 4
bindsym $mod+5 workspace 5
bindsym $mod+6 workspace 6

bindsym $mod+Tab workspace back_and_forth

bindsym $mod+Shift+1 move container to workspace 1
bindsym $mod+Shift+2 move container to workspace 2
bindsym $mod+Shift+3 move container to workspace 3
bindsym $mod+Shift+4 move container to workspace 4
bindsym $mod+Shift+5 move container to workspace 5
bindsym $mod+Shift+6 move container to workspace 6


assign [class="Qemu-system-x86_64"]5
assign [class="Zathura|Soffice|calibre|libreoffice-writer|libreoffice-calc"]4
assign [instance="libreoffice"]4
assign [class="Wine|Steam|dontstarve"]6


mode "resize" {
        # These bindings trigger as soon as you enter the resize mode

        bindsym h resize shrink width 10 px or 10 ppt
        bindsym j resize grow height 10 px or 10 ppt
        bindsym k resize shrink height 10 px or 10 ppt
        bindsym l resize grow width 10 px or 10 ppt
	# arrow keys #
	# bindsym 113 right

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

bindsym $mod+r mode "resize"

# Audio Controls
bindsym XF86AudioPlay exec "mpc toggle"
bindsym XF86AudioStop exec "mpc stop"
bindsym XF86AudioNext exec "mpc next"
bindsym XF86AudioPrev exec "mpc prev"
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
bindsym mod1+a exec playerctl play
bindsym mod1+s exec playerctl pause
bindsym mod1+x exec playerctl next
bindsym mod1+z exec playerctl previous

#Backlight Controls
#bindsym XF86MonBrightnessUp exec "xbacklight +10"
#bindsym XF86MonBrightnessDown exec "xbacklight -10"
bindsym Mod1+d exec --no-startup-id sudo bright_down
bindsym Mod1+i exec --no-startup-id sudo bright_up

#APPS
bindsym $MOD+Return exec --no-startup-id urxvt
#bindsym $mod+p exec --no-startup-id j4-dmenu-desktop --term urxvt --display-binar --dmenu "dmenu -b  -sb '$bg1' -sf '$fg' -nb '$fg' -nf '$bg' -fn 'Consolas-9'"
bindsym $mod+p exec $HOME/bin/dmen.sh
bindsym $MOD+SHIFT+f exec thunar
bindsym Mod1+w exec chromium
bindsym $mod+w exec $HOME/.firefox/firefox
bindsym $mod+b exec $HOME/downloads/tor-browser_en-US/Browser/start-tor-browser
bindsym $mod+e exec $HOME/.VSCode-linux-x64/bin/code
bindsym Mod1+l exec i3lock -i $HOME/.Xresources.d/lock.png
bindsym Mod1+e exec urxvt -e mutt
bindsym $mod+i exec urxvt -e weechat
bindsym $mod+c exec gsimplecal
bindsym Mod1+Shift+c exec galculator
bindsym $MOD+SHIFT+t exec urxvt -e htop
bindsym $MOD+SHIFT+x exec $HOME/bin/i3_session
bindsym $mod+Shift+b bar mode toggle
bindsym $MOD+SHIFT+plus move scratchpad
bindsym $MOD+plus scratchpad show
bindsym Print exec $HOME/bin/screen root
bindsym Mod1+p exec $HOME/bin/screen active


# }}}




#bar {
#    mode hide
#    hidden_state hide
#    modifier Mod1
#    position bottom
#    workspace_buttons no
#}




# PROGRAM AUTOSTART {{{


exec_always --no-startup-id $HOME/bin/wal-set &
exec --no-startup-id sh $HOME/bin/hashwall
exec --no-startup-id sh $HOME/.todo/todo-conky
exec --no-startup-id unclutter &
exec --no-startup-id xss-lock -- i3lock -i $HOME/.Xresources.d/lock.png &
exec --no-startup-id $HOME/.dropbox-dist/dropboxd &
exec --no-startup-id anamnesis --start &
exec --no-startup-id mpd &
exec --no-startup-id mpdscribble &
exec --no-startup-id xrandr --dpi 120 &
exec --no-startup-id redshift &
exec --no-startup-id udiskie &
exec --no-startup-id dunst -fn "$DUNST_FONT" -geometry "$DUNST_SIZE" &
#exec --no-startup-id compton --config ~/.compton.conf -b 
#exec --no-startup-id xpad


# }}}

# vim:filetype=i3

CLICK TO VIEW

x

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
 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
#!/usr/bin/env bash
# vim: set ft=sh:
#
# Dylan's bar script
#
# Created by Dylan Araps.
#
# Depends on: xorg-xrandr, wmctrl, mpc, lemonbar, ip, xdotool

font="${BAR_FONT:-"-*-lemon-*"}"
icon="${BAR_ICON:-"-*-siji-*"}"
height="${BAR_HEIGHT:-36}"


get_workspaces() {
    # Create a dynamic workspace switcher.
    workspaces="$(wmctrl -d | awk -v fg="${color8:-#F0F0F0}" \
                                  '$6!="0,0"{next}
                                   $2=="-"{printf "  %{F"fg"}" $NF "  %{F}"}
                                   $2=="*"{printf "  " $NF "  "}')"
    printf "%s\\n" "$workspaces"
}


get_window() {
    # Get title of focused window.
    printf "%.75s\\n" "$(xdotool getwindowfocus getwindowname)"
}


get_date() {
    # Get the date and time.
    printf "%s\\n" "$(date +"%a %d %b - %H:%M")"
}


get_song() {
    # Get the current song from mopidy/mpd.
    printf "%.100s\\n" "$(mpc current -f '%albumartist% - %title%')"
}

get_dbx() {
    dbx="$(echo -e $(dropbox-cli status | sed -n 1p))"

    dbx_icon=""

    printf "%s\\n" "$(icon "$dbx_icon") ${dbx}"
}

get_mail() {
    # Get new mail from offlineimap folder.
    mail="$(echo -e $(ls /home/ajibola/.mail/Gmail/INBOX/new | wc -l))"

    mail_icon=""

    printf "%s\\n" "$(icon "$mail_icon") ${mail}"
}

get_volume() {
    # Get the system volume.
    volume="$(amixer sget Master | grep -o -m 1 -E "[[:digit:]]+%")"

    case "$volume" in
        0%|[0-9]%)   vol_icon=" " ;;
        1?%|2?%|3?%) vol_icon="" ;;
        4?%|5?%|6?%) vol_icon="" ;;
        *) vol_icon="" ;;
    esac

    printf "%s\\n" "$(icon "$vol_icon") ${volume}"

}

get_bat() {
    status=$(cat /sys/class/power_supply/BAT0/status)
    capacity=$(cat /sys/class/power_supply/BAT0/capacity)

    if [ "$status" == "Charging" ]; then
        printf "%s\\n" "$(icon "") ${capacity}"
    elif [ "$status" == "Full" ]; then
        printf "%s\\n" "$(icon "") ${capacity}"
    elif (("$capacity" <= "20")); then
        printf "%s\\n" "$(icon "") ${capacity}"
    elif (("$capacity" <= "60")); then
        printf "%s\\n" "$(icon "") ${capacity}"
    elif (("$capacity" <= "100")); then
        printf "%s\\n" "$(icon "") ${capacity}"
    fi
}

get_wifi() {
    wifi="$(echo -e $(iw wlp1s0 link | grep 'SSID' | cut -c 8-))"
    wifi_icon=""

    printf "%s\\n" "$(icon "$wifi_icon") ${wifi}"
}


icon() {
    # Format an icon.
    printf "%s\\n" "%{F${color3:-#F0F0F0}}${1}%{F}"
}


main() {
    # Main script function.

    # Import colors from 'wal'.
    # https://github.com/dylanaraps/pywal
    . "${HOME}/.cache/wal/colors.sh"

    # Loop and print the info.
    while :; do
        workspaces="$(get_workspaces)"
        window="$(icon "") $(get_window)"
        date="$(get_date)"
        song="$(icon "") $(get_song)"
        dbx="$(get_dbx)"
        mail="$(get_mail)"
        volume="$(get_volume)"
        bat="$(get_bat)"
        wifi="$(get_wifi)"

        printf "%s%s%s\\n" \
               "%{l}   ${workspaces}  |  ${window}" \
               "%{c}${date}" \
               "%{r}${song}  |  ${dbx} ${mail} ${volume} ${bat} ${wifi}    "
        sleep .1s
    done |\

    # Launch lemonbar.
    lemonbar -g "x${height}" \
             -B "${color0:-#000000}" -F "${color15:-#F0F0F0}"\
             -n "bar" -f "$font" -f "$icon"
}


main "$@"
 

x

colors.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
58
59
60
61
62
63
64
65
66
67
68
69
70
! X colors.
! Generated by 'wal'
emacs*foreground:   #C9BEB4
emacs*background:   #272e38
URxvt*foreground:   #C9BEB4
XTerm*foreground:   #C9BEB4
UXTerm*foreground:  #C9BEB4
URxvt*background:   [100]#272e38
XTerm*background:   #272e38
UXTerm*background:  #272e38
URxvt*cursorColor:  #C9BEB4
XTerm*cursorColor:  #C9BEB4
UXTerm*cursorColor: #C9BEB4
URxvt*borderColor:  [100]#272e38

! Colors 0-15.
*.color0: #272e38
*color0:  #272e38
*.color1: #698898
*color1:  #698898
*.color2: #5290A5
*color2:  #5290A5
*.color3: #6F99A9
*color3:  #6F99A9
*.color4: #8B9CA5
*color4:  #8B9CA5
*.color5: #93A5AD
*color5:  #93A5AD
*.color6: #A2A1A0
*color6:  #A2A1A0
*.color7: #C9BEB4
*color7:  #C9BEB4
*.color8: #7d8187
*color8:  #7d8187
*.color9: #698898
*color9:  #698898
*.color10: #5290A5
*color10:  #5290A5
*.color11: #6F99A9
*color11:  #6F99A9
*.color12: #8B9CA5
*color12:  #8B9CA5
*.color13: #93A5AD
*color13:  #93A5AD
*.color14: #A2A1A0
*color14:  #A2A1A0
*.color15: #C9BEB4
*color15:  #C9BEB4

! Black color that will not be affected by bold highlighting.
*.color66: #272e38
*color66:  #272e38

! Rofi colors.
rofi.color-window: #272e38, #272e38, #5290A5
rofi.color-normal: #272e38, #C9BEB4, #272e38, #5290A5, #272e38
rofi.color-active: #272e38, #C9BEB4, #272e38, #5290A5, #272e38
rofi.color-urgent: #272e38, #698898, #272e38, #698898, #C9BEB4

! Xclock colors.
XClock*foreground: #C9BEB4
XClock*background: #272e38
XClock*majorColor:  rgba:c9/be/b4/ff
XClock*minorColor:  rgba:c9/be/b4/ff
XClock*hourColor:   rgba:c9/be/b4/ff
XClock*minuteColor: rgba:c9/be/b4/ff
XClock*secondColor: rgba:c9/be/b4/ff

! Set depth to make transparency work.
URxvt*depth: 32
 

x

Notes

os: Arch
wm: i3(i3-gaps)
bar: lemonbar

dotfiles