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

Luna (scrot) (+1 likes)

szorfein Sep 14, 2017 (wms/i3)

Xresources(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
! Special
*background:    #1e2832
*foreground:    #caf0ec
*.cursorColor:  #4a3139

! Black
*color0: #353e47
*color8: #59626b

! Red
*color1: #675665
*color9: #927a90

! Green
*color2: #3a6469
*color10: #5a9295

! Yellow
*color3: #a5b0aa
*color11: #e1f0e4

! Blue
*color4: #515e71
*color12: #6e7f99

! Magenta
*color5:  #636d73
*color13: #81779d

! Cyan
*color6: #2b908c
*color14: #3bc7bc

! White
*color7:  #bdb8c1
*color15: #ebcbde

! Rofi
rofi.color-normal: argb:00000000, #515e71, argb:00000000, #1e2832,#2b908c
rofi.color-urgent: argb:00000000, #00ff00, argb:00000000, #110000,#fae1ee
rofi.color-active: argb:00000000, #0000ff, argb:00000000, #000011,#caf0ec
rofi.color-window: argb:ff1e2832, #515e71, #3bc7bc

CLICK TO VIEW

x

config(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
#
# 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 26
gaps outer 0

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

#                         border  bg      text    indicat child_border
client.focused            #232323 #232f3b #d0f3eb #4F4F4F #212a33
client.focused_inactive   #1A1A1A #232f3b #536d73 #121212 #212a33
client.unfocused          #030706 #232f3b #636d73 #4F4F4F #212a33
client.urgent             #1A1A1A #232f3b #a5a5a5 #1A1A1A #212a33
client.background         #1b2026

#
# 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 2 
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 &
exec_always --no-startup-id killall lemonbar; sh ~/.config/i3/panel-bottom &
 

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="$(getXresColor background)"
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(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=$(pIcon ${FG} ${GENTOO})
    local cmd="$(uname -n)"
    local cmdEnd=$(pText ${WHITE} "${cmd}")
    echo "${icon} ${cmdEnd}"
}

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

getDay() {
    local icon=$(pIcon ${MAGENTA} ${CTIME})
    local cmd=" $(date '+%A %d %b')" 
    local cmdEnd=$(pText ${WHITE} "${cmd}")
    echo "${icon}${cmdEnd}"
}

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

mail() {
    local gmaildir=/home/username/.mails/Gmail/\[Gmail\].All\ Mail/new
    local cmd=$(pAction ${BLUE} ${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 ${MAGENTA} $icon) $(pText ${WHITE} ${batCap})"
}

ws() {
    local cmd=$(i3-msg -t get_outputs | sed 's/.*"current_workspace":"\([^"]*\)".*/\1/')
    local icon=$(pIcon ${YELLOW} " >* " )
    local icon2=$(pIcon ${YELLOW} " *< " )
    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(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
#! /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 ${MAGENTA} ${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
        _artist=$(pText ${MAGENTA} "${artist:0:10}")
        _music=$(pText ${BLUE2} "${musicname:0:25}")
        cmd=" playing $_artist * $_music"
    elif [ "${stat}" ] && [ "${stat}" = "[paused]" ] ; then
        _artist=$(pText ${MAGENTA} "${artist:0:10}")
        _music=$(pText ${BLUE2} "${musicname:0:25}")
        cmd=" paused $_artist * $_music"
    else
        cmd=" no sound"
    fi

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

volume() {
    local icon=$(pIcon ${MAGENTA} ${CVOLUME})
    local vol="$(mpc volume | awk '{print $2}')"
    [[ -z ${vol} ]] && vol='100%'
    local clr=$(pText ${FG} "${vol}")
    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 ${MAGENTA} ${CNET})"
    local cmd=$(pText ${WHITE} " ${_status2} ")

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

wifi_str() {
    local _icon=$(pIcon ${MAGENTA} ${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 ${MAGENTA} ${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 ${MAGENTA} ${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

gtk.css(raw, dl)

1
2
3
4
5
6
VteTerminal, vte-terminal {
    padding-top: 25px;
    padding-bottom: 28px;
    padding-left: 35px;
    padding-right: 35px;
}   
 

x

Notes

desktop: i3-gaps

console: termite

bar: lemonbar

Other files on github

Trouble for install: here

$ mv config ~/.config/i3
$ mv config_bar ~/.config/i3
$ mv panel-top ~/.config/i3
$ mv panel-bottom ~/.config/i3
$ chmod +x ~/.config/i3/*
$ mv gtk.css ~/.config/gtk-3.0/