Skip to content

Instantly share code, notes, and snippets.

@ElGuillermo
Last active April 28, 2024 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ElGuillermo/4c915bc7d3f55a698c6ed70e938958b7 to your computer and use it in GitHub Desktop.
Save ElGuillermo/4c915bc7d3f55a698c6ed70e938958b7 to your computer and use it in GitHub Desktop.
A Conky script for my Sony laptop
--[[
# My Sony VAIO laptop conky script
# Author : https://github.com/ElGuillermo
# Release date : october 7th 2022
# Tested on : Mint 21 - Cinnamon
# Feel free to modity this script ;)
]]
conky.config = {
lua_load = '/home/guillaume/.config/conky/scripts_guillaume.lua',
alignment = 'top_right',
background = true,
border_width = 0,
color1 = '#eeaa00',
color2 = '#ff6633',
cpu_avg_samples = 10,
default_bar_width = 106,
default_bar_height = 10,
default_color = 'white',
default_graph_width = 106,
default_graph_height = 50,
default_outline_color = 'white',
default_shade_color = 'white',
double_buffer = true,
draw_borders = false,
draw_graph_borders = true,
draw_outline = false,
draw_shades = false,
extra_newline = false,
font = 'Ubuntu Mono:size=11',
gap_x = 5,
gap_y = 5,
minimum_height = 1025,
minimum_width = 360,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = true,
out_to_x = true,
own_window = true,
own_window_class = 'Conky',
own_window_transparent = false,
own_window_argb_visual = true,
own_window_argb_value = 128,
own_window_type = 'desktop',
own_window_hints ='undecorated,sticky,skip_taskbar,skip_pager,below',
pad_percents = 2,
show_graph_range = false,
show_graph_scale = false,
stippled_borders = 0,
text_buffer_size = 2048,
top_name_width = 12,
update_interval = 5,
uppercase = false,
use_spacer = 'left',
use_xft = true,
}
conky.text = [[
# ----------
${color2}${font ConkySymbols:size=18}u${font} ${voffset -7}GNU/Linux $hr${color}
${goto 36}${color1}OS${color}${alignr}${execi 86400 cat /etc/issue|cut -c 1-21}\
${goto 36}${color1}Kernel${color}${alignr}$kernel ${color1}on${color} $machine
# ----------
${color2}${font ConkySymbols:size=16}f${font} ${voffset -7}System $hr${color}
${goto 36}${color1}Uptime ${color}$uptime_short ${alignr}${color1}Battery${color} ${battery BAT1} \
${if_match ${battery_percent BAT1} < 25}${color red}$else\
${if_match ${battery_percent BAT1} < 50}${color orange}$else\
${if_match ${battery_percent BAT1} < 75}${color yellow}$else\
${color green}\
$endif\
$endif\
$endif\
${battery_bar 10,100 BAT1}${color}
${goto 36}${color1}Load ${color}${loadavg}${alignr}${color1}Remaining ${color}${battery_time BAT1}
# ----------
${color2}${font ConkySymbols:size=16}h${font} ${voffset -7}Temperature $hr${color}
${goto 36}${color1}CPU ${color}${exec sensors | grep 'Package' | awk '{print $4}' | cut -b2,3}°C\
${goto 144}${color1}GPU ${color}${execi 60 nvidia-settings -query [gpu:0]/GPUCoreTemp -t}°C\
${goto 252}${color1}Fan ${color}${exec cat /sys/devices/platform/sony-laptop/fanspeed}%
${goto 36}${execgraph "sensors | grep 'Package' | awk '{print $4}' | cut -b2,3" 00ff00 ff0000 -t}\
${goto 144}${execgraph "nvidia-settings -query [gpu:0]/GPUCoreTemp -t" 00ff00 ff0000 -t}\
${goto 252}${execgraph "cat /sys/devices/platform/sony-laptop/fanspeed" 00ff00 ff0000 -t}
${voffset -7}\
${color2}${font ConkySymbols:size=16}n${font} ${voffset -7}Processes $hr${color}
${goto 36}C0\
${goto 76}C1\
${goto 116}C2\
${goto 156}C3\
${goto 196}C4\
${goto 236}C5\
${goto 276}C6\
${goto 316}C7
${goto 36}${cpugraph cpu0 33,40 00ff00 ff0000 -t}\
${goto 76}${cpugraph cpu1 33,40 00ff00 ff0000 -t}\
${goto 116}${cpugraph cpu2 33,40 00ff00 ff0000 -t}\
${goto 156}${cpugraph cpu3 33,40 00ff00 ff0000 -t}\
${goto 196}${cpugraph cpu4 33,40 00ff00 ff0000 -t}\
${goto 236}${cpugraph cpu5 33,40 00ff00 ff0000 -t}\
${goto 276}${cpugraph cpu6 33,40 00ff00 ff0000 -t}\
${goto 316}${cpugraph cpu7 33,40 00ff00 ff0000 -t}
${voffset -7}\
${goto 36}${freq_g 1}\
${goto 76}${freq_g 2}\
${goto 116}${freq_g 3}\
${goto 156}${freq_g 4}\
${goto 196}${freq_g 5}\
${goto 236}${freq_g 6}\
${goto 276}${freq_g 7}\
${goto 316}${freq_g 8}
# ----------
${color1}${goto 36}Processes ${color}$processes ${color1}Running ${color}$running_processes
${goto 36}${top name 1} ${goto 140}${top cpu 1}% ${goto 198}${top_mem name 1}${alignr}${top mem_res 1}
${goto 36}${top name 2} ${goto 140}${top cpu 2}% ${goto 198}${top_mem name 2}${alignr}${top mem_res 2}
${goto 36}${top name 3} ${goto 140}${top cpu 3}% ${goto 198}${top_mem name 3}${alignr}${top mem_res 3}
${goto 36}${top name 4} ${goto 140}${top cpu 4}% ${goto 198}${top_mem name 4}${alignr}${top mem_res 4}
${goto 36}${top name 5} ${goto 140}${top cpu 5}% ${goto 198}${top_mem name 5}${alignr}${top mem_res 5}
${goto 36}${top name 6} ${goto 140}${top cpu 6}% ${goto 198}${top_mem name 6}${alignr}${top mem_res 6}
${goto 36}${top name 7} ${goto 140}${top cpu 7}% ${goto 198}${top_mem name 7}${alignr}${top mem_res 7}
${goto 36}${top name 8} ${goto 140}${top cpu 8}% ${goto 198}${top_mem name 8}${alignr}${top mem_res 8}
${goto 36}${top name 9} ${goto 140}${top cpu 9}% ${goto 198}${top_mem name 9}${alignr}${top mem_res 9}
${goto 36}${top name 10} ${goto 140}${top cpu 10}% ${goto 198}${top_mem name 10}${alignr}${top mem_res 10}
# ----------
${color2}${font ConkySymbols:size=16}J${font} ${voffset -7}Memory $hr${color}
${goto 36}${color1}RAM${goto 87}${color}$mem / $memmax ${alignr}$memperc% \
${if_match $memperc>75}${color red}$else\
${if_match $memperc>50}${color orange}$else\
${if_match $memperc>25}${color yellow}$else\
${color green}\
$endif\
$endif\
$endif\
${membar 10,100}${color}
${goto 36}${color1}Swap${goto 87}${color}$swap /$swapmax $alignr}$swapperc% \
${if_match $swapperc>75}${color red}$else\
${if_match $swapperc>50}${color orange}$else\
${if_match $swapperc>25}${color yellow}$else\
${color green}\
$endif\
$endif\
$endif\
${swapbar 10,100}${color}
# ----------
${color2}${font ConkySymbols:size=16}k${font} ${voffset -7}Storage $hr${color}
${goto 36}${color1}/${color}${goto 87}${fs_used /} /${fs_size /} ${alignr}${fs_used_perc /}% ${fs_bar 10,100 /}
# ----------
${color2}${font ConkySymbols:size=16}b${font} ${voffset -7}Wireless $hr${color}
${goto 36}${color1}SSID ${color}${wireless_essid wlp2s0}
${goto 36}${color1}Bitrate ${color}${wireless_bitrate wlp2s0}${alignr}${color1}Signal ${color}${wireless_link_qual_perc wlp2s0}% ${wireless_link_bar 10,100 wlp2s0}
${goto 36}${color1}Download${color} ${downspeed wlp2s0}\
${goto 200}${color1}Upload ${color}${upspeed wlp2s0}
${goto 36}${downspeedgraph wlp2s0 50,162 ff0000 00ff00 -t}\
${goto 200}${upspeedgraph wlp2s0 50,162 ff0000 00ff00 -t}
${voffset -7}\
${goto 36}${color1}Total ${color}${totaldown wlp2s0}\
${goto 198}${totalup wlp2s0}
#
#${exec iwlist wlp2s0 scan | grep 'Quality'| awk '{print $1}' | while read a ; do a=${a#*=}; b=$(( ${a%/*}*100 /${a#*/})) ; echo "$b" ; done}%
#${execigraph 60 "iwlist wlp2s0 scan | grep 'Quality'| awk '{print $1}' | while read a ; do a=${a#*=}; b=$(( ${a%/*}*100 /${a#*/})) ; echo "$b" ; done" 00ff00 ff0000 -t}
# ----------
${if_running boinc}\
${color2}${font ConkySymbols:size=16}F${font} ${voffset -7}Boinc $hr${color}
${color1}Proj. URL WorkUnit % ETA${color}
${execi 60 boinccmd --get_tasks | awk -F': |://|/' '\
/WU/ {found++; w=$2}\
/URL/ {found++; u=$3}\
/estimated/ {found++; e=strftime("%d/%m %Hh%M",$2+systime())}\
/fraction/ {found++; p=$2}\
found==4 {printf "%.9s %.18s %3.1f %s %s", u, w, p*100, e, "\n ";found=0}\
'}
$endif
# ----------
]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment