Conky anyone?

Get help with XFCE specific problems
donald
Full of knowledge
Full of knowledge
Posts: 1832
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Conky anyone?

Post#1 by donald » 10 May 2021, 09:29

Yes, I like to monitor my system.

CPU usage and Temp is permanently shown in the panel.
There are panel plugins in xfce to do this - nothing new.

But I wanted some more -- time for conky.
(I wanted to know if something gets written onto the usb-stick (it shouldn't))
Note: This conky shows what I wanted to have.(See screenshot)
One can do a lot, and i mean a lot, more / different.
Image
btw
The Network graphs are only shown when the Network is actually up.

So far so good, but I do not want to see this conky all the time.

now what?
I want a clickable switch to toggle conky on/off!
One way would be to create a .desktop file for an menu entry,
but I prefer a launcher in the panel.

Here we go:
First we need a "Function" which can do the on/off -- a script:

Code: Select all

#!/bin/sh

# click to start, click to stop

if pidof conky | grep [0-9] > /dev/null
then
exec killall conky
else
exec conky

fi
give the script a name [toggle-conky.sh] > make it executeable and copy it into /usr/local/bin/

2nd step - create a launcher:
right-click on panel > add new item > add a launcher > right-click the new launcher > properties
> in general tab click "add a new empty item" [see screenshot] > save.
Image
That's it.

User avatar
Ed_P
Contributor
Contributor
Posts: 6360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Conky anyone?

Post#2 by Ed_P » 10 May 2021, 22:46

Code: Select all

pidof
:shock: Where did you find this command?? :o And your function script is very clever donald. :happy62:

So where do I download the conky module?

Added in 3 minutes 55 seconds:
Is there a pidof command that shows all apps running? "pidof *" doesn't do it.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3160
Joined: 20 Mar 2012, 03:42
Distribution: 5.0-current-64bit
Location: australia
Contact:

Conky anyone?

Post#3 by ncmprhnsbl » 10 May 2021, 23:59

Ed_P wrote:
10 May 2021, 22:50
s there a pidof command that shows all apps running? "pidof *" doesn't do it.
pidof -h ;)
what you want for that is:

Code: Select all

ps -A
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 6360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Conky anyone?

Post#4 by Ed_P » 11 May 2021, 04:09

ncmprhnsbl wrote:
10 May 2021, 23:59
pidof -h ;)
I already did this which is why I asked.
ncmprhnsbl wrote:
10 May 2021, 23:59
what you want for that is:

Code: Select all

ps -A
Thank you. :good:

What is kworker?? :hmmm:
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3160
Joined: 20 Mar 2012, 03:42
Distribution: 5.0-current-64bit
Location: australia
Contact:

Conky anyone?

Post#5 by ncmprhnsbl » 11 May 2021, 05:15

Ed_P wrote:
11 May 2021, 04:09
What is kworker?
k is for kernel... so kernel related stuff..
more in depth answer: https://askubuntu.com/questions/33640/k ... -cpu#52299
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

donald
Full of knowledge
Full of knowledge
Posts: 1832
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Conky anyone?

Post#6 by donald » 11 May 2021, 05:16

Ed_P wrote:
10 May 2021, 22:50
So where do I download the conky module?
Hi Ed
There are conky modules in the bundles section with custom made config files.
But I wanted to start fresh so I build my own conky-1.10.8-i586-bundle.xzm via USM.

content: -- (32 Bit but should also be available in 64 Bit x86_64 I think)
conky-1.10.8-i586-1ponce.txz
imlib2-1.5.1-i586-1ponce.txz
libid3tag-0.15.1b-i486-4.txz
lua-5.1.5-i486-1ponce.txz
tolua++-1.0.93-i586-1ponce.txz

This summs up to ~ 1.3MB - documentation included [/usr/doc/conky-1.10.8/html/]

what else do one need? - well,you need config files (conky.conf).
system: /etc/conky/conky.conf ## for now you can leave it as is (default - not nice)
user: /home/guest/.config/conky/conky.conf ## This one we will use / manipulate.

However, here is the one I use (for now)

Code: Select all

conky.config = {
    background = true,
    short_units = true, 

   -- Use double buffering (eliminates flickering)
    double_buffer = true,
 
   -- Update interval in seconds
    update_interval = 1,

    -- Number of samples to take for CPU and network readings
    cpu_avg_samples = 1,
    net_avg_samples = 1,

    draw_graph_borders = true,
    border_width = 2,

    -- Use Xft (anti-aliased font and stuff)
    use_xft = true,
    font = 'DejaVu Sans:size=10',
    xftalpha = 1.0, 

    -- Prevent text from moving around while using a mono font
    use_spacer = 'right',
   
    -- Default color and border settings
    default_color = 'white',
    default_shade_color = 'white',
    default_outline_color = 'white',
    color1 = 'F494B9',
    color2 = '5599cc',
    color3 = '77ccff',
    color4 = '2DF22D',
    
    draw_shades = false,
    draw_outline = false,
    draw_borders = false,
   
    own_window = true,
    own_window_transparent = true,
    own_window_type = 'desktop',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',

    -- Window size and position
    minimum_width = 130,
    minimum_height = 200,
    maximum_width = 130,
    alignment = 'top_right',
    gap_x = 25,
    gap_y = 60,
}

conky.text = [[
${alignc}${color3}${font DejaVu Sans:bold:size=10}Uptime:${color} $uptime_short ${font}

RAM:${alignr}$mem/ $memmax
CPU-freq:${alignr}${freq}

${alignc}${color3}${font DejaVu Sans:bold:size=10}Usb-Disk${color}${font}
Read:${alignr}${diskio_read /dev/sdb}
${diskiograph_read /dev/sdb 5599cc 5599cc}
Write:${alignr}${diskio_write /dev/sdb}
${diskiograph_write /dev/sdb 5599cc 5599cc}

${alignc}${color3}${font DejaVu Sans:bold:size=10}Network${color}${font}
${if_up eth0}eth0 up: $alignr ${upspeed eth0}
${upspeedgraph eth0 5599cc 5599cc}
eth0 down: $alignr ${downspeed eth0}
${downspeedgraph eth0 5599cc 5599cc}${endif}
#${alignc} ${color3} ${font DejaVu Sans:bold:size=10}Total down/ up ${color} ${font}
${color4}Total-down${color}${alignr}${totaldown eth0}
${color1}Total-up${color}${alignr}${totalup eth0}
]]
Note:
to get started you can use this file as a Template.
be aware that wifi is not included in this file you have to add it yourself (easy)
and it is monitoring my porteus USB Thumb-drive (sdb).You surely want to change this.
Open the file in a text editor, change something, press ctrl+s and the result is
instantly shown (if conky is running)

I recommend to study other conky.conf files and the docs. :)

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3160
Joined: 20 Mar 2012, 03:42
Distribution: 5.0-current-64bit
Location: australia
Contact:

Conky anyone?

Post#7 by ncmprhnsbl » 11 May 2021, 05:58

btw, i've used pidof like this:

Code: Select all

if [ "$(pidof conky)" ]; then
if it's not running there's a non zero returncode..
here's my somewhat more complicated tool that switches between configs and adjusts some entries..
(note, that whenever the conky.conf is edited, while conky is running, it detects this and restarts itself)
i just use it via a openbox pipemenu, but it can just as easily be setup via keybinds..
generally though, most people(including me) only need one conky.conf ...

Code: Select all

#!/bin/bash
## simple script to switch conky themes for openbox menu
## requires $HOME/.config/conky to be populated with: 
##  conf[1-4] files that contain various conky configurations 
## one of which will be symlinked to $HOME/.config/conky/conky.conf
##
##  author: ncmprhnsbl 
##

export COMPCONF="$HOME/.config/conky"

func_1 () {
if [ "$(pidof conky)" ]; then
    killall conky && conky &
    exit 0
else
    conky &
    exit 0
fi
}; export -f func_1

func_2 () {
ln -sf $COMPCONF/conky_default $COMPCONF/conky.conf
func_1
}; export -f func_2

func_3 () {
ln -sf $COMPCONF/conky_gotham $COMPCONF/conky.conf
func_1
}; export -f func_3

func_4 () {
ln -sf $COMPCONF/conky_min $COMPCONF/conky.conf
func_1
}; export -f func_4

func_5 () {
ln -sf $COMPCONF/conky_max $COMPCONF/conky.conf
func_1
}; export -f func_5

func_6 () {
if [ "$(pidof conky)" ]; then
    killall conky
    exit 0
else
    exit 0
fi
}; export -f func_6

func_7 () {
/opt/porteus-scripts/xorg/editor $HOME/.config/conky/conky.conf
}; export -f func_7

func_8 () {
echo "usage: 'conkconf <option>'  options: -d default, -g gotham, -m min, -M max, -t toggle wifi/wired, -r restart, -q stop, -h help."
exit 0
}; export -f func_8

func_9 () {
if [ "`grep eth0 ~/.config/conky/conky.conf`" 2>/dev/null ]; then 
   sed -i --follow-symlinks 's/eth/wlan/g' ~/.config/conky/conky.conf ; exit 0
else 
   sed -i --follow-symlinks 's/wlan/eth/g' ~/.config/conky/conky.conf ; exit 0
fi
}; export -f func_9

func_10 () {
if [ "`grep '#MUSIC' ~/.config/conky/conky.conf`" 2>/dev/null ]; then 
   sed -i --follow-symlinks 's/#MUSIC/MUSIC/g' ~/.config/conky/conky.conf ; exit 0
else
   sed -i --follow-symlinks 's/MUSIC/#MUSIC/g' ~/.config/conky/conky.conf ; exit 0
fi		
}; export -f func_10

while getopts ":-d:-g:-m:-M:-r:-q:-e:-t:-a:-h:" o; do
case "$1" in

   -d)
    func_2
    func_1 ;;

   -g)
    func_3
    func_1 ;;

   -m)
    func_4
    func_1 ;;

   -M)
    func_5
    func_1 ;;
    
   -r)
    func_1 ;;
    
   -q)
    func_6 ;;
    
   -e)
    func_7 ;;
    
   -t)
    func_9 ;;
    
   -a)
    func_10 ;;
    
   -h)
    func_8 ;;
    
    *)
    func_8 ;;
     
esac
done
[ -z "$1" ] && func_8 ; exit 1
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 6360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Conky anyone?

Post#8 by Ed_P » 11 May 2021, 14:45

:shock: :w00t:
Ed

User avatar
M. Eerie
Shogun
Shogun
Posts: 338
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce x64

Conky anyone?

Post#9 by M. Eerie » 20 May 2021, 19:50

Have you tried BASHTOP ?
I've been a long time Conky user and being searching thousands of pages for rings and configs, but I feel it something dated now.

Bashtop offers everything I've searched Conky for years, since it allows to show/hide your gadgets at will in a confortable manner.

You can use a drop-down terminal attached to a shortcut key and voilà. You get fancy meters, you can kill processes or get detailed information about resource usage with filters and even themes, all from the terminal and with a low profile. Of course, you get the disk_io activity as well, etc.

In my case, I've my F12 key mapped to the command showed below which delivers a twin terminal with nnn running in one tab and bashtop in the other. Memory usage is about 7Mb each and you can switch the view up & down with the press of a key. Very unobstrusive much in the opposite way of how Conky behaves.

Code: Select all

F12 ===> xfce4-terminal --drop-down -I=nnn -T n³ --command 'bash -ic nnn f%' --tab -T "System Monitor" -e bpytop --zoom=1
Finally, there's also the next-gen Bashtop, called Bpytop (based on python of course), but this obviously needs python and is more resource hungry from my tests. Recently a C++ version called btop seems to be in progress.

2 gems in my opinion. :)
Cheers!

User avatar
Ed_P
Contributor
Contributor
Posts: 6360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Conky anyone?

Post#10 by Ed_P » 21 May 2021, 16:02

You have a module for Bashtop M.?
Ed

User avatar
M. Eerie
Shogun
Shogun
Posts: 338
Joined: 31 Aug 2017, 21:18
Distribution: Nemesis Xfce x64

Conky anyone?

Post#11 by M. Eerie » 22 May 2021, 08:50

Hi Ed.

Bashtop only depends on coreutils and sed packages already in Porteus.
(Depends: bash (>= 4.4),curl (>= 7.16.2), coreutils, sed, awk, grep)

Some other Prerequisites include UTF8 locale set, unicode font and 24bit capable terminal.

Since it only needs standard tools, I'm pretty sure you only need to download the source file from the project page, to make it executable:

Code: Select all

chmod +x ./bashtop

and put it on your $PATH (say $HOME/.bin or $HOME/.local/bin or /usr/bin or /usr/local/bin etc.)

Just try and tell me if it works for you.

Note: When using psutil for data collection, you would also need python, but you can disable it in the options menu.
Cheers!

User avatar
Ed_P
Contributor
Contributor
Posts: 6360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Conky anyone?

Post#12 by Ed_P » 22 May 2021, 18:03

It does indeed run! :o Thanks M.. :)

I clicked on the Menu button and turned it off, didn't see any noticeable impact, so I tried to reenable it and the Menu button simply flashes and disappears. Shutting it down and restarting it resolved the problem.

An interesting app.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3160
Joined: 20 Mar 2012, 03:42
Distribution: 5.0-current-64bit
Location: australia
Contact:

Conky anyone?

Post#13 by ncmprhnsbl » 18 Sep 2021, 22:30

M. Eerie wrote:
20 May 2021, 19:50
Recently a C++ version called btop seems to be in progress.
now available: https://github.com/aristocratos/btop
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Ed_P
Contributor
Contributor
Posts: 6360
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 4.0 & 5.0rc3 ISOs
Location: Western NY, USA

Conky anyone?

Post#14 by Ed_P » 18 Sep 2021, 23:42

ncmprhnsbl wrote:
18 Sep 2021, 22:30
now available: https://github.com/aristocratos/btop
How does one make a xzm file out of a tbz one?

Code: Select all

guest@porteus:~/Downloads$ tbz2xzm *.tbz
bash: tbz2xzm: command not found
guest@porteus:~/Downloads$ su
Password: 
root@porteus:/home/guest/Downloads# tbz2xzm *.tbz
bash: tbz2xzm: command not found
root@porteus:/home/guest/Downloads# ls *.tbz
btop-1.0.1-linux-x86-64.tbz
root@porteus:/home/guest/Downloads# 
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3160
Joined: 20 Mar 2012, 03:42
Distribution: 5.0-current-64bit
Location: australia
Contact:

Conky anyone?

Post#15 by ncmprhnsbl » 19 Sep 2021, 03:01

Ed_P wrote:
18 Sep 2021, 23:42
How does one make a xzm file out of a tbz one?
.tbz is just a tar.bz2 archive... it should just extract (with an archiver if necessary)
as per the instructions: ( https://github.com/aristocratos/btop#installation )

Code: Select all

cd <extracted btop*.tbz>
su
mkdir /tmp/btop
make install DESTDIR=/tmp/btop PREFIX=/usr
#and maybe? can't hurt..
make setuid DESTDIR=/tmp/btop PREFIX=/usr
dir2xzm /tmp/btop /tmp/btop-1.0.1-linux-x86-64.xzm 
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply