I got stuck into conky. With great pleasure . . .
Maybe it will inspire or entertain others …
My goal was to see how to use icons with conky.
And placement of these elements.
Finally, I managed to make the font visible using a script (printf).
Rules (font awesome) added directly to .conkyrc kept empty sqaure characters.
|---------------- Scripts used for this conky ------------------------------------------------------------|
user … ~/bin/
- Noblank-conky.sh - monitors whether dpms is on or not. (caffeine cup)
- Conky-icons-default.sh - to use icons.
- Mabox_days_installed.sh - check mabox installed days.
mabox … /usr/bin/
- conkymountpoints.sh.
- Checkupdates.sh.
If not installed : Font Awesome
yay awesome-terminal-fonts
~/.config/conky/rename.conkyrc
conky.config = {
own_window = true,
own_window_type = 'desktop',
own_window_transparent = false,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_colour = '#1f1520',
own_window_class = 'Conky',
own_window_title = 'Mabox Sysinfo Bar Conky',
alignment = 'top_left',
gap_x = 1631,
gap_y = 127,
minimum_width = '180',
use_xft = true,
font = 'Ubuntu:size=10',
xftalpha = 1,
override_utf8_locale = true,
draw_shades = false,
default_shade_color = '#222222',
draw_outline = false,
default_outline_color = '#222222',
default_color = '#80e365',
color0 = '#5bbe5d',
color1 = '#7aa15d',
color2 = '#c7162b',
cpu_avg_samples = 2,
draw_borders = true,
stippled_borders = 1,
border_inner_margin = 8,
border_outer_margin = 8,
border_width = 1,
draw_graph_borders = true,
background = true,
no_buffers = true,
imlib_cache_size = 0,
short_units = true,
double_buffer = true,
update_interval = 2,
};
conky.text = [[
$color${font Cantarell:size=18}${time %A}$font\
${voffset -10}${goto 199}$color0${font Cantarell:size=50}${time %e}$font${voffset -25}
$color${voffset -30}${goto 150}$color0${font Cantarell:size=18}${time %b}$font${voffset -20}
${voffset +15}${goto 100}$color${font Cantarell:size=20} ${time %Y}$font${voffset +15}
${goto 20}${execpi 2 noblank-conky.sh}${color}
${goto 75}${color0}$hr
${execpi 20000 conky-icons-default.sh -cpu}${color}
${font}${voffset -20}${goto 18}${color}$alignr$cpu%
${voffset -2}$color$alignr${cpubar 4,200 -l -t}${voffset -2}
${goto 18}$font$color0${top name 1}${alignr}$color${top cpu 1}%
${goto 18}$color0${top name 2}$alignr$color${top cpu 2}%
${goto 18}$color0${top name 3}$alignr$color${top cpu 3}%
${goto 18}$color0${top name 4}$alignr$color${top cpu 4}%
${goto 18}$color0${top name 5}$alignr$color${top cpu 5}%
#
${execpi 20000 conky-icons-default.sh -ram}${color}
${voffset -20}${goto 18}${color}${alignr}$legacymem / $memmax
${voffset -2}$color$alignr${membar 4,200 -l -t}${voffset -2}
${goto 18}$color0${top_mem name 1}$alignr$color${top_mem mem_res 1}
${goto 18}$color0${top_mem name 2}$alignr$color${top_mem mem_res 2}
${goto 18}$color0${top_mem name 3}$alignr$color${top_mem mem_res 3}
${goto 18}$color0${top_mem name 4}$alignr$color${top_mem mem_res 4}
${goto 18}$color0${top_mem name 5}$alignr$color${top_mem mem_res 5}
#${exec cd ~/.config/conky/Noise-vector ; /usr/bin/convert -format png -resize 160x120 "`/bin/ls *.png *.jpg 2>/dev/null | /usr/bin/shuf -n1`" /dev/shm/current.png}${image /dev/shm/current.png -p 20,300 -s 150x100 -n}${voffset 100}
${execpi 20000 conky-icons-default.sh -disk}${color}
${voffset -20}${color}${goto 75}${color0}$hr
${color}${execpi 3 conkymountpoints.sh}${color}$hr
${execpi 20000 conky-icons-default.sh -temp}${color}
${voffset -20}${color}${goto 75}${color0}$hr
${goto 75}${color0}Core 0 $alignr ${color}${exec sensors | grep 'Core 0' | awk '{print $3}'}
${goto 130}${voffset -2}${color}${execbar 4 sensors | grep 'Core 0' | awk '{print $3}' | cut -c 2-3 | tr -d '\n' | sed -e 's/.../\n&/g'}${voffset -2}
${goto 75}${color0}Core 1 $alignr${color}${exec sensors | grep 'Core 1' | awk '{print $3}'}
${goto 130}${voffset -2}${color}${execbar 4 sensors | grep 'Core 1' | awk '{print $3}' | cut -c 2-3 | tr -d '\n' | sed -e 's/.../\n&/g'}${voffset -2}
${execpi 20000 conky-icons-default.sh -fan}${color}
${voffset -20}${color}${goto 75}${color0}$hr
${goto 75}${color0}processor $alignr ${color}${exec sensors | grep 'Processor Fan' | awk '{print $3,$4}'}
${goto 130}${voffset -2}${color}${execbar 4 sensors | grep 'Processor Fan' | awk '{print $3}' | cut -c 2-3 | tr -d '\n' | sed -e 's/.../\n&/g'}${voffset -2}
${goto 75}${color0}video $alignr ${color}${exec sensors | grep 'Video Fan' | awk '{print $3,$4}'}
${goto 130}${voffset -2}${color}${execbar 4 sensors | grep 'Video Fan' | awk '{print $3}' | cut -c 2-3 | tr -d '\n' | sed -e 's/.../\n&/g'}${voffset -2}
${execpi 20000 conky-icons-default.sh -mem}${color}
${voffset -20}${color}${goto 75}${color0}$hr
${goto 70}${color0}${alignr}${color}${legacymem} - ${memmax}
${voffset -2}$alignr$color${membar 5,85 -l -t}${voffset -2}
${voffset +9}$alignr${color} Mabox Linux ${execi 10000 awk -F'=' '/DISTRIB_RELEASE=/ {printf $2" "} /CODENAME/ {print $2}' /etc/lsb-release}
$alignr${execi 10000 whoami}@${nodename}
${alignr}${color0}system ${color}${execpi 5 uptime -p}
${alignr}${color0}${alignr}kernel ${color}${kernel}
${alignr}${color0}${alignr}arch ${color}${machine}
${alignr}${color0}${alignr}filesystem ${color}${fs_type}${voffset 10}
${alignr}${color}${execpi 1800 checkupdates.sh -s}${font}${color}
${alignr}${color}${alignr}day's installed: ${color0}${execpi 20000 mabox_days_installed.sh}${font}${color0}
${alignr}${color} installed pkgs: ${color0}${execi 10000 pacman -Q | wc -l}
${alignr}${color} branch: ${color0}${execi 10000 pacman-mirrors -G | tail -n 1}
${image ~/.config/conky/images/mabox_3d.png -p 5,750 -s 64x64}${voffset -20}
]];
noblank-conky.sh
#!/bin/bash
DELAY="$(xset q | grep "Standby" | awk '{ print $2 }')"
function DPMS_check {
! xset q | grep Enabled > /dev/null
}
if DPMS_check
then
printf "\${voffset -35}\${font FontAwesome:style=Solid:pixelsize=22}\${color1}\${goto 60}\uf0f4\${font}"
else
printf "\${color green}\${goto 75} screen blanking ON: "
printf "\${color yellow}\$alignr[$DELAY s]"
fi
conky-icons-default.sh [ -mem | -ram | -disk | -temp | -fan ]
#!/bin/bash
# Dependency Font Awesome icons
cpu () {
printf "\${voffset +10}\${font FontAwesome:style=Solid:pixelsize=20}\${color}\${goto 15}\uf2db\${font} cpu"
exit 1
}
ram () {
printf "\${voffset +10}\${font FontAwesome:style=Solid:pixelsize=20}\${color}\${goto 15}\uf145\${font} ram"
exit 1
}
mem() {
printf "\${voffset +10}\${font FontAwesome:style=Solid:pixelsize=20}\${color}\${goto 15}\uf2db\${font} mem"
exit 1
}
fan() {
printf "\${voffset +10}\${font FontAwesome:style=Solid:pixelsize=20}\${color}\${goto 15}\uf285\${font} fan"
exit 1
}
temp() {
printf "\${voffset +10}\${font FontAwesome:style=Solid:pixelsize=20}\${color}\${goto 15}\uf2c8\${font} temp"
exit 1
}
disk() {
printf "\${voffset +10}\${font FontAwesome:style=Solid:pixelsize=20}\${color}\${goto 15}\uf1c0\${font} disk"
exit 1
}
case "$1" in
-cpu) cpu "$2";;
-mem) mem "$2";;
-ram) ram "$2";;
-disk) disk "$2";;
-temp) temp "$2";;
-fan) fan "$2";;
*)
exit 1
mabox_days_installed.sh
#!/bin/bash
INST="$(sed 1q /var/log/pacman.log)"
INST="${INST/ */}"
INST="${INST/T*/}" # newer pacman adds a different timestamp (TXX:XX:XX+0000), we just want the date
INST="${INST/\[/}"
# Days ago ($DIFF)
TODAY=$(date +%F)
let DIFF=($(date +%s -d ${TODAY})-$(date +%s -d ${INST}))/86400
echo "$DIFF"
/tips/trix/alway’s welcome/…
edit:2 - correction + pic