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

City (scrot) (+2 likes)

szorfein Apr 09, 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
#
# Settings
#

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

set $ws1 i
set $ws2 ii
set $ws3 iii
set $ws4 iv
set $ws5 v
set $ws6 vi

set $mod Mod4

gaps inner 20
gaps outer -2

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

#                         border  bg      text    indicat child_border
client.focused            #383838 #0e0d0e #BBBBBB #4F4F4F #0e0d0e
client.focused_inactive   #1A1A1A #0d010d #424242 #121212 #0d010d
client.unfocused          #030706 #0d010d #4F4F4F #4F4F4F #0d010d
client.urgent             #1A1A1A #0d010d #a5a5a5 #1A1A1A #0d010d
client.background         #121212

#
# 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
bindsym Mod5+F8 exec xbacklight -dec 1 
bindsym Mod5+F9 exec xbacklight -inc 2 
#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

assign [class="Gimp"]$ws5

#
# Exec
#

exec_always --no-startup-id killall lemonbar; sh ~/.config/i3/panel-top.sh &
exec_always --no-startup-id killall lemonbar; sh ~/.config/i3/panel-bottom.sh &

CLICK TO VIEW

x

config_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/sh

HEIGHT=23
FONT="-*-dina-medium-r-*-*-10-*-*-*-*-*-*-*"
FONT_ICON="-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1"

# icons
GENTOO="\ue1ec"
ARCH="\ue00e"
CSTART="\ue00d"
CSOUND="\ue04d"
CVOLUME="\ue204"
CMAIL="\ue070"
CRAM="\ue19a"
CCPU="\ue021"
CNET="\ue04b"
CWIFI="\ue222"
WIFI_STR="\ue02d"
CIP=" ++ "
# Time
CTIME="\ue018"
CPACK="\ue1b7"
CCLOCK="\ue016"
# panel center
CNONE="\ue190"
CFULL="\ue0e6"
# 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"

# $(pAction ${fg} ${bg} ${${command} ${whatprint})
pAction() {
    echo "%{F$1}%{B$2}%{A:$3:}$(printf '%b' $4)%{A}%{B-}%{F-}"
}

# $(pActionUnderline ${fg} ${bg} ${underline} ${${command} ${whatprint})
pActionUnderline() {
    echo "%{F$1}%{B$2}%{U$3}%{+u}%{A:$4:}$(printf '%b' $5)%{A}%{-u}%{B-}%{F-}"
}

# $(pIcon ${color} ${icon})
pIcon() {
    echo "%{F$1}$(printf '%b' $2)%{F-}"
}

# $(pIconUnderline ${color} ${color_underline} ${icon})
pIconUnderline() {
    echo "%{F$1}%{U$2}%{+u}$(printf '%b' $3)%{-u}%{F-}"
}

# $(pText ${color} ${text})
pText() {
    echo "%{F$1}$2%{F-}"
}

# $(pTextUnderline ${color} ${color_underline} ${text})
pTextUnderline() {
    echo "%{F$1}%{U$2}%{+u}$3%{-u}%{F-}"
}

getXresColor() {
   echo "$( xrdb -query | grep $1: | grep -oE '#[a-zA-Z0-9]{6}' | cut -c 1- )"
}

# colors
BG="#de121215"
FG="$(getXresColor foreground)"
BLACK="$(getXresColor color0)"
BLACK2="$(getXresColor color8)"
RED="$(getXresColor color1)"
RED2="$(getXresColor color9)"
GREEN="$(getXresColor color2)"
GREEN2="$(getXresColor color10)"
YELLOW="$(getXresColor color3)"
YELLOW2="$(getXresColor color11)"
BLUE="$(getXresColor color4)"
BLUE2="$(getXresColor color12)"
MAGENTA="$(getXresColor color5)"
MAGENTA2="$(getXresColor color13)"
CYAN="$(getXresColor color6)"
CYAN2="$(getXresColor color14)" 
WHITE="$(getXresColor color7)"
WHITE2="$(getXresColor color15)"
 

x

panel-top.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
 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
#! /bin/sh

PANEL_WM=panel_top
PANEL_FIFO=/tmp/panel_top_fifo

if xdo id -a "$PANEL_WM" > /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"

source $(dirname $0)/config_bar

getName() {
    local icon=$(pIconUnderline ${WHITE} ${RED2} ${GENTOO})
    local cmd="$(uname -n)"
    local cmdEnd=$(pTextUnderline ${WHITE} ${RED} " ${cmd}")
    echo " ${icon}${cmdEnd}"
}

getMyIp() {
    local icon=$(pIcon ${YELLOW} ${CIP})
    local cmd="$(curl -s https://ifcfg.me/)"
    local cmdEnd=$(pText ${WHITE} "${cmd}")
    echo " ${icon} ${cmdEnd} ${icon}"
}

getDay() {
    local icon=$(pIconUnderline ${GREEN} ${BLACK2} ${CTIME})
    local cmd=" $(date '+%A %d %b')" 
    local cmdEnd=$(pTextUnderline ${WHITE} ${BLACK} "${cmd}")
    echo "${icon}${cmdEnd}"
}

clock() {
    local icon=$(pIcon ${GREEN} ${CCLOCK})
    local cmd=$(date +%H:%M)
    local cmdEnd=$(pText ${FG} "${cmd}")
    echo "${icon} ${cmdEnd}"
}

mail() {
    local gmaildir=/home/user/.mails/Gmail/\[Gmail\].All\ Mail/new
    local cmd=$(pAction ${GREEN} ${BG} "i3 'exec termite -e mutt'" ${CMAIL})
    local count=0
    if [[ ! -n $(ls "${gmaildir}") ]]; then
        count=0
    else
        count=$(ls -1 "${gmaildir}" | wc -l)
    fi
    echo "${cmd} ${count}"
}

energy() {
    local ac=/sys/class/power_supply/AC/online
    local bat=/sys/class/power_supply/BAT0/present
    local icon=""
    local batCap=""
    if [[ -e $bat ]] && [[ $(cat $ac) -lt 1 ]]; then
        batCap="$(cat ${bat%/*}/capacity)"
        [ $batCap -gt 90 ] && icon=$BAT100
        [ $batCap -gt 70 ] && [ $batCap -lt 90 ] && icon=$BAT70
        [ $batCap -gt 50 ] && [ $batCap -lt 70 ] && icon=$BAT50
        [ $batCap -gt 30 ] && [ $batCap -lt 50 ] && icon=$BAT30
        [ $batCap -gt 15 ] && [ $batCap -lt 30 ] && icon=$BAT15
        [ $batCap -lt 7 ] && icon=$BAT7
    elif [[ -n $(cat $ac) ]]; then
        batCap="AC"
        icon=$CAC
    else
        batCap="wttf"
    fi
    echo "$(pIcon ${GREEN} $icon) $(pText "#685667" ${batCap})"
}

ws() {
    local cmd=$(i3-msg -t get_outputs | sed 's/.*"current_workspace":"\([^"]*\)".*/\1/')
    local icon=$(pIcon ${GREEN} " >> " )
    local icon2=$(pIcon ${GREEN} " << " )
    local cmdEnd=$(pText ${FG} "${cmd}")
    echo "${icon} ${cmdEnd} ${icon2}"
}

{
    while :; do
        echo "A$(ws)"
        sleep 0.4 || break
    done > "$PANEL_FIFO" &

    while :; do
        echo "W$(getName) $(getMyIp)"
        echo "R$(energy) $(mail) $(getDay) $(clock)"
        sleep 1 || break
    done > "$PANEL_FIFO" &
}

{
    while read -r line ; do 
        cmd=( $line )
        case "${cmd[0]}" in
            W*)
                sysL="${line#?}"
                ;;
            A*)
                sysC="${line#?}"
                ;;
            R*)
                sysR="${line#?}"
                ;;
        esac
        printf "%s\n" "%{l}${sysL}%{c}${sysC}%{r}${sysR}"
    done
} < "$PANEL_FIFO" | lemonbar \
    -g x${HEIGHT} -u 2 -B ${BG} -F ${FG} -f "${FONT}" -f "${FONT_ICON}" | sh &

wid=$(xdo id -a "$PANEL_WM")
tries_left=20

while [ -z "$wid" -a "$tries_left" -gt 0 ] ; do
    sleep 0.05
    wid=$(xdo id -a "$PANEL_WM")
    tries_left=$((tries_left - 1))
done

[ -n "$wid" ] && xdo above -t "$(xdo id -N I3Top -n root | sort | head -n 1)" "$wid"

wait
 

x

panel-bottom.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
 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
#! /bin/sh

PANEL_WM=panel_bottom
PANEL_FIFO=/tmp/panel_bottom_fifo

if xdo id -a "$PANEL_WM" > /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"

source $(dirname $0)/config_bar

music() {
    local icon=$(pIcon ${GREEN} ${CSOUND})
    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:15}"
    else
        cmd=" No Sound"
    fi

    echo "${icon}$(pText ${WHITE} "${cmd}")"
}

volume() {
    local icon=$(pIcon ${GREEN} ${CVOLUME})
    local cmd="$(mpc volume | awk '{print $2}')"
    [[ -z ${volume%?} ]] && volume='100%'
    local clr=$(pText ${FG} "${cmd}")
    echo "${icon} ${clr}"
}

net() {
    local _GETIWL=$(/sbin/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}"
    local icon="$(pIcon ${GREEN} ${CNET})"
    local cmd=$(pText ${WHITE} " ${_status2}")

    echo "${icon}${cmd}"
} 

wifi_str() {
    local _icon=$(pIcon ${GREEN} ${WIFI_STR})
    local _cmd=$(/sbin/iwconfig 2>/dev/null | grep "Link Quality" | cut -d "=" -f 2 | awk '{print $1}')
    echo "${_icon} ${_cmd}"
}

cpu() {
    local icon=$(pIcon ${GREEN} ${CCPU})
    local cmd=" $(cat /proc/loadavg | awk '{print $1}')"
    local cmd+=" $(cat /proc/loadavg | awk '{print $4}')"
    local cmd+=" $(cat /proc/cpuinfo| grep MHz | awk '{ORS=" "}{print $4}' | sed -e 's/.000//g' | cut -f 1)"

    local clr=$(pText ${WHITE} "${cmd}")
    echo "${icon}${clr}"
}

ram() {
    local icon=$(pIcon ${GREEN} ${CRAM})
    local cmd=$(free -m | grep Mem | awk '{print $3}')
    cmd+=" Mb"
    local clr=$(pText ${WHITE} "${cmd}")
    echo "${icon} ${clr}"
}

{
    while :; do
        echo "W$(music) $(volume)"
        echo "A$(cpu) $(ram)"
        echo "R$(wifi_str) $(net)" 
        sleep 1
    done > "$PANEL_FIFO" &
}

{
    while read -r line ; do
        cmd=( $line )
        case "${cmd[0]}" in
            W*)
                sysL="${line#?}"
                ;;
            A*)
                wm="${line#?}"
                ;;
            R*)
                sysR="${line#?}"
                ;;
            reload)
                exit
                ;;
            quit_panel)
                exit
                ;;
        esac
        printf "%s\n" "%{l}${sysL}%{c}${wm}%{r}${sysR}"
    done
} < "$PANEL_FIFO" | lemonbar \
    -g x${HEIGHT} -u 2 -B ${BG} -F ${FG} -f "${FONT}" -f "${FONT_ICON}" -b | sh &

wid=$(xdo id -a "$PANEL_WM")
tries_left=20

while [ -z "$wid" -a "$tries_left" -gt 0 ] ; do
    sleep 0.05
    wid=$(xdo id -a "$PANEL_WM")
    tries_left=$((tries_left - 1))
done

[ -n "$wid" ] && xdo above -t "$(xdo id -N I3Bottom -n root | sort | head -n 1)" "$wid"

wait
 

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
 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
!-------------------------------------------
! XFT Settings gre
     
Xft.antialias:  true 
Xft.autohint:   false 
Xft.dpi:        96
Xft.hinting:    true 
Xft.hintstyle:  hintfull 
Xft.lcdfilter:  lcddefault
Xft.rgba:       rgb

!-------------------------------------------
! URXVT - Settings

URxvt*depth:                        32
URxvt*internalBorder:               3
URxvt*dynamicColors:                on
URxvt*urgentOnBell:                 true
URxvt*borderLess:                   false
URxvt*scrollBar:                    false
URxvt*cursorBlink:                  true
URxvt*cursorUnderline:              true
URxvt*cursorColor:                  #737077
URxvt*scrollColor:                  #151515
URxvt*underlineURLs:                true

URxvt*font: -*-dina-medium-r-*-*-*-90-*-*-*-*-*-*
URxvt*italic: -*-dina-medium-*-*-*-*-90-*-*-*-*-*-*
URxvt*boldFont: -*-dina-bold-r-*-*-*-90-*-*-*-*-*-*
 
!--------------------------------------------
! URxvt Colors

URxvt.colorIT:                       #b291af
URxvt.colorBD:                       #6f6776
URxvt.colorUL:                       #e9cfd3

!--------------------------------------------
! General Colors

*background:    #0f0a13
*foreground:    #9aa8a9
*.cursorColor:  #4a3139

! Black
*color0: #1c0c18
*color8: #1a1e31
! Red
*color1: #873e54
*color9: #bc3962
! Green
*color2: #2a5b6f
*color10: #67808c
! Yellow
*color3: #d83746
*color11: #fc5d7f
! Blue
*color4: #3e3a4d
*color12: #685589
! Magenta
*color5:  #422138
*color13: #8b4779
! Cyan
*color6: #164569
*color14: #38718d
! White
*color7:  #d4b9d7
*color15: #fbdeff


!-------------------------------------------
! Man pages colors

*VT100.colorBDMode:                  true
*VT100.colorBD:                      red
*VT100.colorULMode:                  true
*VT100.colorUL:                      cyan   
*VT100.veryBoldColors:               6

!-------------------------------------------
! xclock

xclock*majorColor:                  #9a875f
xclock*minorColor:                  #9a875f
xclock*minuteColor:                 #9a875f
xclock*hourColor:                   #9a875f
xclock*secondColor:                 #9a875f

!-------------------------------------------
! rofi

rofi.lines:                         6
rofi.color-enabled:                 true
rofi.separator-style:               none 
rofi.width:                         40
! rofi state:                          'bg'     'fg'     'bgalt'     'hlbg'    'hlfg'
! Color scheme for normal row
rofi.color-normal:                  argb:00000000, #8b4779, argb:00000000, #16101b,#ffffff
! Color scheme for urgent row
rofi.color-urgent:                  argb:00000000, #8b4779, argb:00000000, #16101b,#ffffff
! Color scheme for active row
rofi.color-active:                  argb:00000000, #8b4779, argb:00000000, #16101b,#ffffff
! Color scheme window
rofi.color-window:                  argb:ee0f0a13, #000,#fbdeff
 

x