Conky with a little logic
3 posters
:: Forum :: How-tos and Tutorials
Page 1 of 1
Conky with a little logic
I thought I would put a post containing some information regarding my modification of one of the provided conky configurations, I basically added a few pieces of logic to change the images upon different events, in this case when the network connected/disconnected. Here is the conky without network connection.
And with wifi connected
And with a wired connection
If you would like to use this the configuration file is as follows :-
I hope you will like what conky has to offer, if you look through the man pages
Dai
And with wifi connected
And with a wired connection
If you would like to use this the configuration file is as follows :-
- Code:
update_interval 1.0
total_run_times 0
net_avg_samples 1
cpu_avg_samples 1
imlib_cache_size 0
double_buffer yes
no_buffers yes
use_xft yes
xftfont DejaVu Sans:size=9
text_buffer_size 2048
own_window yes
own_window_transparent yes
#own_window_type normal
#own_window_type desktop
#own_window_type dock
#own_window_type panel
own_window_type override
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_argb_visual yes
#own_window_argb_value 0
alignment top_right
gap_x 10
gap_y 10
minimum_size 350 250
maximum_width 350
draw_shades no
default_color efefef
default_shade_color 1d1d1d
short_units yes
TEXT
${voffset 17}${goto 96}CPU1: ${font DejaVu:bold:size=9}${cpu cpu1}%${font} ${alignr 15}Temp: ${font DejaVu:bold:size=9}${execi 30 sensors | grep 'Core 0' | cut -c16-17}°C${font}
${voffset 10}${goto 96}CPU2: ${font DejaVu:bold:size=9}${cpu cpu2}%${font} ${alignr 15}Temp: ${font DejaVu:bold:size=9}${execi 30 sensors | grep 'Core 1' | cut -c16-17}°C${font}
${voffset 34}${goto 96}RAM: ${font DejaVu:bold:size=9}${memperc}%${font} Free: ${font DejaVu:bold:size=9}${memeasyfree} ${font}${alignr 22}Used: ${font DejaVu:bold:size=9}${mem}${font}
${voffset 10}${goto 96}Swap: ${font DejaVu:bold:size=9}${swapperc}%${font} Free: ${font DejaVu:bold:size=9}${swapfree}${font} ${alignr 22}Used: ${font DejaVu:bold:size=9}${swap}${font}
${voffset 28}${goto 96}Down speed${goto 175}: ${font DejaVu:bold:size=9}${downspeed wlx00225f13a266}${font} ${alignr 15}Total: ${font DejaVu:bold:size=9}${totaldown wlx00225f13a266}${font}
${voffset 10}${goto 96}Up speed${goto 175}: ${font DejaVu:bold:size=9}${upspeed wlx00225f13a266}${font} ${alignr 15}Total: ${font DejaVu:bold:size=9}${totalup wlx00225f13a266}${font}
${voffset 12}${goto 96}Down speed${goto 175}: ${font DejaVu:bold:size=9}${downspeed enp2s0}${font} ${alignr 15}Total: ${font DejaVu:bold:size=9}${totaldown enp2s0}${font}
${voffset 10}${goto 96}Up speed${goto 175}: ${font DejaVu:bold:size=9}${upspeed enp2s0}${font} ${alignr 15}Total: ${font DejaVu:bold:size=9}${totalup enp2s0}${font}
${voffset 30}${goto 96}${if_gw}Public WAN Address ${alignr 10}${font DejaVu:bold:size=9}${execi 300 dig +short myip.opendns.com @resolver1.opendns.com}${font}${else}No Wan Connection Available${endif}
${voffset 10}${goto 96}${if_existing /proc/net/route wlx00225f13a266}Wireless LAN Address${alignr 10}${font DejaVu:bold:size=9}${addrs wlx00225f13a266}${font}${voffset -4}${else}${if_existing /proc/net/route enp2s0}Wired LAN Address${alignr 10}${font DejaVu:bold:size=9}${addrs enp2s0}${font}${voffset -4}${endif}${endif}
${image ~/conky/img/base.png -p 10,-3 -s 339x86}${image ~/conky/img/base.png -p 10,70 -s 339x86}${image ~/conky/img/base.png -p 10,137 -s 339x140}${image ~/conky/img/base.png -p 10,257 -s 339x86}${image ~/conky/img/cpu.png -p 24,19 -s 40x40}${image ~/conky/img/ram.png -p 24,92 -s 40x40}${image ~/conky/img/web.png -p 24,279 -s 40x40}${if_existing /proc/net/route wlx00225f13a266}${image ~/conky/img/network-wireless-online.png -p 24,162 -s 40x40}${else}${image ~/conky/img/network-wireless-offline.png -p 24,162 -s 40x40}${endif}${if_existing /proc/net/route enp2s0}${image ~/conky/img/network-wired.png -p 24,207 -s 40x40}${else}${image ~/conky/img/network-wired-disconnected.png -p 24,207 -s 40x40}${endif}
I hope you will like what conky has to offer, if you look through the man pages
- Code:
man conky
Dai
Dai_trying- Posts : 77
Join date : 2016-05-20
Re: Conky with a little logic
Last edited by James Tobin on Fri Jun 03, 2016 4:48 am; edited 1 time in total
Re: Conky with a little logic
k never mind the second one. My problem was that I had to make the overlap like 600 instead of 10 to 30 haha. so what about the first one: wifi thing?
Re: Conky with a little logic
Ok first the wifi, check your adapters address by typing
Second the position can be adjusted by changing the setting "gap_x" to be higher, moving it further from the top bar. The amount will depend on how far down you want to go.
- Code:
ifconfig
Second the position can be adjusted by changing the setting "gap_x" to be higher, moving it further from the top bar. The amount will depend on how far down you want to go.
Dai_trying- Posts : 77
Join date : 2016-05-20
Re: Conky with a little logic
I didn't see anything like that... this is all I got
- Code:
james@chalet:~$ ifconfig
enp5s0f1 Link encap:Ethernet HWaddr 08:9e:01:d5:e8:2d
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:461380 errors:0 dropped:0 overruns:0 frame:0
TX packets:461380 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:28992551 (28.9 MB) TX bytes:28992551 (28.9 MB)
wlp4s0 Link encap:Ethernet HWaddr 48:d2:24:83:38:96
inet addr:192.168.2.144 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::1f31:6846:ac76:6f1/64 Scope:Link
inet6 addr: fe80::4951:ca3e:ad3d:476b/64 Scope:Link
inet6 addr: fe80::904f:381d:7f23:e782/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1853027 errors:0 dropped:0 overruns:0 frame:0
TX packets:820208 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2315496336 (2.3 GB) TX bytes:135537872 (135.5 MB)
james@chalet:~$
Re: Conky with a little logic
Your wifi adapter appears to be wlp4s0
Dai_trying- Posts : 77
Join date : 2016-05-20
Re: Conky with a little logic
thanks. Also any way I can imbed a clock onto this one? also I'm marking as sticky
Re: Conky with a little logic
super, used Find and Replace on mousepad and that worked I appreciate it, thaks a lot
Re: Conky with a little logic
I use a script to start multiple conkies, here is my screenshot.
Here is the script I use at the moment, you can modify it to suit your needs.
to make the script run at startup instead of the current conky you can go to Settings Manager -> Session and Startup -> Application Autostart and select the item named "Start ChaletOS desktop clock(Start only one ChaletOS desktop clock and system monitor)" and click on edit, then replace click the file browser link next to the command and locate and select your script to run it when the system starts instead of the ChaletOS conky.
Here is the script I use at the moment, you can modify it to suit your needs.
- Code:
#!/bin/bash
if pgrep conky > /dev/null
then
killall conky
fi
if [[ $1 ]]; then if [ $1 == nowait ]; then :; else sleep 20; fi; else sleep 20; fi
conky -d -c ~/conky/my01.conkyrc &&
if [[ $1 ]]; then if [ $1 == nowait ]; then :; else sleep 2; fi; else sleep 2; fi
conky -d -c ~/conky/my02.conkyrc &&
if [[ $1 ]]; then if [ $1 == nowait ]; then :; else sleep 2; fi; else sleep 2; fi
conky -d -c ~/conky/my03.conkyrc &&
if [[ $1 ]]; then if [ $1 == nowait ]; then :; else sleep 2; fi; else sleep 2; fi
conky -d -c ~/conky/my04.conkyrc &&
exit
- Code:
chmod +x (scriptname)
- Code:
scriptname nowait
to make the script run at startup instead of the current conky you can go to Settings Manager -> Session and Startup -> Application Autostart and select the item named "Start ChaletOS desktop clock(Start only one ChaletOS desktop clock and system monitor)" and click on edit, then replace click the file browser link next to the command and locate and select your script to run it when the system starts instead of the ChaletOS conky.
Dai_trying- Posts : 77
Join date : 2016-05-20
Re: Conky with a little logic
The clock is in the style changer modified to show day and month, the system info is a modified version of another one from the style changer, the other two are just plain conkies with a background image to make the blend in with the rest.
Dai_trying- Posts : 77
Join date : 2016-05-20
Re: Conky with a little logic
I actually may just use gdesklets instead for the clock and use conky for sys monitor.
Re: Conky with a little logic
That's the thing with Linux, sooo many choices.
Dai_trying- Posts : 77
Join date : 2016-05-20
Re: Conky with a little logic
Choices are great, but every extra conky or gdesklet that is run uses resources. Granted, with modern computers this isn't a terrible burden.
I like Dai_trying's method of launching multiple conkys from a script. Simple and elegant. Still, I prefer desktop simplicity and tend to not run conky. I use gkrellm and the xfce4 panel for most things. Gkrellm can use themes that are easy to create and the program is simple to configure.
If adding the clock or other items to conky is required, then cut and paste from an existing conkyrc file into the user level one. The relevant items are the lines at the bottom of the conkyrc file. Watch for references or definitions to other things in the configuration text. Always work from a backup in case the changes don't give the desired results. The bash script or command line should resemble:
conky -c myconkyrc
OR
conky --config=~/myconkyrc
To keep the theme changer from trashing any changes, launch conky with the your working config, not ~/.conkyrc.
I like Dai_trying's method of launching multiple conkys from a script. Simple and elegant. Still, I prefer desktop simplicity and tend to not run conky. I use gkrellm and the xfce4 panel for most things. Gkrellm can use themes that are easy to create and the program is simple to configure.
If adding the clock or other items to conky is required, then cut and paste from an existing conkyrc file into the user level one. The relevant items are the lines at the bottom of the conkyrc file. Watch for references or definitions to other things in the configuration text. Always work from a backup in case the changes don't give the desired results. The bash script or command line should resemble:
conky -c myconkyrc
OR
conky --config=~/myconkyrc
To keep the theme changer from trashing any changes, launch conky with the your working config, not ~/.conkyrc.
bluphoenyx- Posts : 28
Join date : 2016-05-27
Re: Conky with a little logic
That may be a good idea, I may pursue that in the future, although gdesklets is nice
Re: Conky with a little logic
My only complaint with gdesklets is that they tend to be java apps or python programs and use unnecessary resources. I think the reason that it bugs me is that I'm still used to conserving computer resources even though my current rig has a 4 core cpu and 4 gb or ram. This may also explain why I prefer the XFCE desktop environment to one with a lot of eye candy such as KDE. Plus, I used to help beta test XFCE back when the 4.x series was just beginning and used the 3.x version before that so I have a soft spot for it.
bluphoenyx- Posts : 28
Join date : 2016-05-27
Re: Conky with a little logic
Ok, now you're just bragging .
bluphoenyx- Posts : 28
Join date : 2016-05-27
Similar topics
» more than one conky?
» How to add another conky?
» conky and internet
» conky manager
» Conky appears above other windows
» How to add another conky?
» conky and internet
» conky manager
» Conky appears above other windows
:: Forum :: How-tos and Tutorials
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|