-
Notifications
You must be signed in to change notification settings - Fork 0
/
.dzenbarrc.dist
104 lines (94 loc) · 2.35 KB
/
.dzenbarrc.dist
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
#!/usr/bin/env bash
# available scrpts (mod_*):
# battery, cpu, filesystem, mail, mcabber, memory, mpd, rhythmbox, network, sensors, volume, weather, ping, mod_nvidia_smi_gpu_temp
# for one monitor
SCRPTS=(
[0]="cpu memory sensors filesystem battery volume network mail ping"
)
# for multiple monitors, where key is monitor number
#SCRPTS=(
# [0]="sensors memory network ping"
# [3]="filesystem volume mpd"
#)
# mod_battery
BATTERY="/sys/class/power_supply/BAT0"
# callback functions; comment for disable
BATTERY__callback_on_battery() {
notify-send -i battery-good "power" "on battery"
backlight-brightness-control --set 6 > /dev/null
}
BATTERY__callback_on_cable() {
notify-send -i battery-good-charging "power" "on cable"
backlight-brightness-control --set 8 > /dev/null
}
BATTERY_UPDATE=10
# mod_cpu
CPU_UPDATE=1
# mod_filesystem
declare -A FILESYSTEM_DISK_LIST
FILESYSTEM_DISK_LIST=(["root:"]="/dev/nvme0n1p2" ["strg1:"]="/dev/sdb4") # grep of `df`
FILESYSTEM_UPDATE=2m
# mod_mail
MAIL_DIR="${HOME}/Mail"
MAIL_UPDATE=30
# mod_mcabber
MCABBER_STATE="${HOME}/.mcabber/mcabber.state"
MCABBER_UPDATE=10
# mod_memory
MEMORY_UPDATE=10
# mod_mpd, mod_rhythmbox
MUSIC_UPDATE=5
# mod_network
NETWORK_UPDATE=2
# mod_ping
PING_DESTINATION="1.1.1.1"
PING_UPDATE=30
# mod_sensors
declare -A SENSORS
SENSORS=(["CPU:"]=12 ["M2:"]=7 ["GPU:"]=3) # line of `sensors`
SENSORS_UPDATE=2m
# mod_volume
VOLUME_MIXER="Master"
VOLUME_UPDATE=5
# mod_weather
WEATHER_SEARCH="UIII"
WEATHER_UPDATE=30m
#WIDTH=1366
WIDTH=$(xdpyinfo | grep dimensions | cut -d ' ' -f7 | cut -d 'x' -f 1)
HEIGHT=20
X=0
#Y=748
Y=$(echo "$(xdpyinfo | grep dimensions | cut -d ' ' -f7 | cut -d 'x' -f 1) - ${HEIGHT}" | bc)
FONT="Hack:size=10"
BG_COLOR="#002B36"
FG_COLOR="#657B83"
ICON_PATH="xbm\/"
ICON_COLOR="#268BD2"
TEXT_COLOR="#839496"
PIPE_FILE_DIR="/tmp/"
PIDS_FILE="/tmp/dzenbarpids"
putLineToPipeFile() {
local MONITOR=${1}
local PIPE_LINE=${2}
local TEXT=${3}
local PIPE_FILE=$(getPipeFilePath ${MONITOR})
sed -i "${PIPE_LINE}s/.*/${TEXT}/" ${PIPE_FILE}
}
getPipeFilePath() {
local MONITOR=${1}
echo "${PIPE_FILE_DIR}dzenbarpipe_${MONITOR}"
}
icon() {
local ICON=${1}
echo -n "^i(${ICON_PATH}${ICON}.xbm)"
}
iconColor() {
local ICON=${1}
local COLOR="${2:-$ICON_COLOR}"
echo -n "^fg(${COLOR})$(icon ${ICON})^fg()"
}
textColor() {
local TEXT=${1}
local COLOR=${2:-$TEXT_COLOR}
echo -n "^fg(${COLOR})${TEXT}^fg()"
}