Setup status bar for laptop
Export laptop packages.
This commit is contained in:
@@ -2,4 +2,5 @@ sourceDir = "{{ .chezmoi.homedir }}/{{ .chezmoi.os }}-config"
|
||||
|
||||
[data]
|
||||
gui = true
|
||||
ext_kb = true
|
||||
# ext_kb = true
|
||||
ext_kb = false
|
||||
|
||||
@@ -5,21 +5,9 @@ command=~/.config/i3blocks/scripts/$BLOCK_NAME
|
||||
separator=true
|
||||
separator_block_width=25
|
||||
markup=pango
|
||||
# color=#d1e7ff
|
||||
# color=#acc0cd
|
||||
color=#cbe4ff
|
||||
|
||||
# color=$foreground
|
||||
# color="${foreground}"
|
||||
# color="$(echo $foreground)"
|
||||
|
||||
# [time]
|
||||
# label=
|
||||
# # label=🕓
|
||||
# # command=date '+%H:%M.%a-%m-%d'
|
||||
# interval=30
|
||||
# # color=#acc0cd
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
[volume]
|
||||
interval=once
|
||||
signal=1
|
||||
@@ -30,46 +18,63 @@ label=
|
||||
LONG_NAME=
|
||||
SHORT_NAME=
|
||||
interval=5
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "x1-carbon" }}
|
||||
[battery]
|
||||
label=⚡
|
||||
interval=30
|
||||
|
||||
[wifi]
|
||||
label=
|
||||
instance=wlp3s0
|
||||
interval=10
|
||||
|
||||
[backlight]
|
||||
label=
|
||||
interval=5
|
||||
{{ end }}
|
||||
|
||||
[calendar]
|
||||
interval=30
|
||||
label=
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
DATEFMT=+%H:%M
|
||||
{{ else }}
|
||||
DATEFMT=+%H:%M.%a-%m-%d
|
||||
{{ end }}
|
||||
# SHORTFMT=+%H:%M:%S
|
||||
HEIGHT=180
|
||||
WIDTH=220
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
[temperature]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
# unbold this?
|
||||
# [load_average]
|
||||
# label=
|
||||
# interval=5
|
||||
# color=#990000
|
||||
{{ end }}
|
||||
|
||||
[temperature]
|
||||
label=
|
||||
interval=5
|
||||
|
||||
# [cpu_usage -w 50 -c 80]
|
||||
[cpu_usage]
|
||||
label=
|
||||
# color=#990000
|
||||
interval=5
|
||||
|
||||
{{ if eq .chezmoi.fullHostname "nzxt" }}
|
||||
[memory]
|
||||
label=
|
||||
# color=#3da061
|
||||
interval=5
|
||||
|
||||
# [wifi]
|
||||
# label=
|
||||
# instance=wlp4s0
|
||||
# interval=10
|
||||
|
||||
[name]
|
||||
label=
|
||||
interval=30
|
||||
{{ end }}
|
||||
|
||||
# unused blocks {{{ #
|
||||
# unused blocks #
|
||||
|
||||
# [memory]
|
||||
# label=SWAP
|
||||
@@ -149,9 +154,9 @@ interval=30
|
||||
#instance=NUM
|
||||
#interval=once
|
||||
#signal=11
|
||||
# }}} unused blocks #
|
||||
# unused blocks #
|
||||
|
||||
# list of properties {{{ #
|
||||
# list of properties #
|
||||
# i3blocks config file
|
||||
#
|
||||
# Please see man i3blocks for a complete reference!
|
||||
@@ -173,5 +178,5 @@ interval=30
|
||||
# short_text
|
||||
# signal
|
||||
# urgent
|
||||
# }}} properties #
|
||||
# properties #
|
||||
|
||||
@@ -5,5 +5,7 @@ round()
|
||||
echo $(printf %.$2f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc))
|
||||
};
|
||||
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
cur_bl=$(xbacklight -get)
|
||||
echo "$(round "$cur_bl" 0)%"
|
||||
# echo "$(round "$cur_bl" 0)%"
|
||||
printf "$(round "$cur_bl" 0)\n\n%s\n" "$color7"
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
INTERFACE="${BLOCK_INSTANCE:-wlan0}"
|
||||
# echo $INTERFACE
|
||||
# INTERFACE="${INSTANCE}"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
@@ -27,24 +29,23 @@ INTERFACE="${BLOCK_INSTANCE:-wlan0}"
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
QUALITY=$(sudo grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
||||
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
||||
# echo $QUALITY
|
||||
W_inter=$(ip link | grep "[1-9]: wlp" | cut -d " " -f2 | tr -d ':')
|
||||
W_name=$(nmcli d | grep "$W_inter" | awk '{print $4}')
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
|
||||
# echo $QUALITY% "$W_name" # full text
|
||||
# echo $QUALITY% # short text
|
||||
. "/home/kevin/.cache/wal/colors.sh"
|
||||
printf "%s%%\n\n%s\n" $QUALITY $color7
|
||||
echo $QUALITY% "$W_name" # full text
|
||||
echo $QUALITY% # short text
|
||||
|
||||
# color
|
||||
# if [[ $QUALITY -ge 80 ]]; then
|
||||
# echo "#00FF00"
|
||||
# elif [[ $QUALITY -lt 80 ]]; then
|
||||
# echo "#FFF600"
|
||||
# elif [[ $QUALITY -lt 60 ]]; then
|
||||
# echo "#FFAE00"
|
||||
# elif [[ $QUALITY -lt 40 ]]; then
|
||||
# echo "#FF0000"
|
||||
# fi
|
||||
if [[ $QUALITY -ge 80 ]]; then
|
||||
echo "#00FF00"
|
||||
elif [[ $QUALITY -lt 80 ]]; then
|
||||
echo "#FFF600"
|
||||
elif [[ $QUALITY -lt 60 ]]; then
|
||||
echo "#FFAE00"
|
||||
elif [[ $QUALITY -lt 40 ]]; then
|
||||
echo "#FF0000"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user