27 Sep 2016

Conky - Widget Linux

Widget untuk info di desktop linux memang menyenangkan. Dengan ini kita langsung tahu informasi yang secara umum sangat dibutuhkan.

Yaitu :
- Waktu
- Suhu Komputer
- Kapasitas Partisi Harddisk
- Load CPU
- Proses CPU
- RAM
- Program Pengakes RAM terbesar
- Swap
- Network (dalam hal ini saya seting ke wifi), yakni IP Public, Upstream Downstream, dan Total Bandwidth nya selama uptime
- Uptime PC
- Hostname
- Distro
- Dan statistik network harian, pekanan, bulanan.

Bawaan dari si Conky Manager ketika saya pasang, baik di Distro Linux Ubuntu, Peppermint, maupun Deepin, banyak yang tidak bekerja. Karena itu harus disesuaikan.

Sebenarnya mau bikin baru, tapi saya rasa biar mudah kalau pas install baru dengan conky manager tinggal edit saja dari yang ada saja.

Conky Manager
Disini saya memodif 2 widget bawaannya, yakni Network Panel dan Proses Panel.

Network panel saya jadikan Statistik Network.
Proses Panel, tetap jadi Proses Panel lengkap dengan info time, dan lain-lainnya.

Pertama tentu kita harus install conky nya terlebih dahulu.
Di debian base, saya pakai begini:

sudo apt-add-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install conky-manager


biasanya itu saja sudah cukup, tapi biar mantap kalau ada modif-modif lainnya saya tambahkan paket conky-all (ini asli gak penting) :

sudo apt-get install conky-all

Satu lagi paket yang harus diinstall adalah vnstat, caranya :
sudo apt-get install vnstat

Selanjutnya jalankan conky-manager nya, tambahkan (dengan klik / centang) 2 nama widget seperti diatas.

Kemudian edit masing-masing:

Network Panel


# **********************************************************************
# "CPU Panel (8-core)" theme for Conky by Tony George (teejee2008@gmail.com)
#
# Webpage: http://teejeetech.blogspot.in/
#
# Edit dan Update
# Hasanudin H Syafaat
# Email : banghasan@gmail.com
# Twitter dan Telegram: @hasanudinhs
# Website: www.banghasan.com
# **********************************************************************


default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no

gap_x 250
gap_y 40
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no

own_window yes
own_window_type normal
own_window_transparent no
own_window_colour 000000
own_window_argb_visual yes
own_window_argb_value 153
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

minimum_size 150 0
stippled_borders 0
update_interval 2.0
uppercase no
use_spacer none

show_graph_scale no
show_graph_range no

use_xft yes
xftalpha 0.1
xftfont GE Inspira:pixelsize=15
color0 white
color1 EAEAEA
color2 FFA300
color3 grey
color4 yellow
color5 brown

alignment top_right
TEXT
${color2}Statistik Network

${color0}${font Play:pixelsize=12}Today $hr
D: ${execi 60 vnstat | grep "today" | awk '{print $2 $3}'}${alignr}U: ${execi 60 vnstat | grep "today" | awk '{print $5 $6}'}

Week $hr
D: ${execi 60 vnstat -w | grep "current week" | awk '{print $3 $4}'}${alignr}U: ${execi 60 vnstat -w | grep "current week" | awk '{print $6 $7}'}

Month $hr
D: ${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $3 $4}'}${alignr}U: ${execi 60 vnstat -m | grep "`date +"%b '%y"`" | awk '{print $6 $7}'} 



Kemudian Process Panel nya:

# **********************************************************************
# "CPU Panel (8-core)" theme for Conky by Tony George (teejee2008@gmail.com)
#
# Webpage: http://teejeetech.blogspot.in/
#
# Edit dan Update
# Hasanudin H Syafaat
# Email : banghasan@gmail.com
# Twitter dan Telegram: @hasanudinhs
# Website: www.banghasan.com
# **********************************************************************


background yes
double_buffer yes

alignment top_right

border_width 1
cpu_avg_samples 2
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no

gap_x 30
gap_y 40
net_avg_samples 2
no_buffers yes
out_to_console no
out_to_stderr no
extra_newline no

own_window yes
own_window_type normal
own_window_transparent yes
own_window_colour 000000
own_window_argb_visual no
own_window_argb_value 153
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

minimum_size 150 0
stippled_borders 0
update_interval 2.0
uppercase no
use_spacer none

show_graph_scale no
show_graph_range no

use_xft yes
xftalpha 0.1
xftfont GE Inspira:pixelsize=15
color0 white
color1 EAEAEA
color2 FFA300
color3 grey
color4 yellow
color5 brown

TEXT
${alignr 40}${font GE Inspira:pixelsize=15}${color0}${time %d %B %Y}
${voffset 5}${color1}${time %A}${alignr 5}${color4}${time %H:%M} WIB
${voffset -10}$color1$hr
${font GE Inspira:pixelsize=20}${color1}SUHU ${alignr 5} ${color green}${acpitemp} °C
${voffset 5}${font GE Inspira:pixelsize=17}${color0}SYSTEM ${alignr}${font Play:pixelsize=12}${offset 5}${color green}${alignr 5}${fs_free /} ${color0}/ ${fs_size /}
${voffset 1}${color3}${fs_bar 12,200 /}
${font GE Inspira:pixelsize=17}${color0}HOME ${alignr}${font Play:pixelsize=12}${offset 5}${alignr 5}${color green}${fs_free /home} ${color0}/ ${fs_size /home}
${voffset 1}${color3}${fs_bar 12,200 /home}

${font GE Inspira:pixelsize=20}${color4}CPU ${font GE Inspira:pixelsize=15}${color green}${freq_g cpu0}${color0} Ghz ${font Play:pixelsize=20}${color0}${alignr}${cpu cpu0}%
${cpubar cpu0 5,}
${voffset -15}${font GE Inspira:pixelsize=12}${color0}${top name 1} $alignr ${top cpu 1}%
${top name 2} $alignr ${top cpu 2}%
${top name 3} $alignr ${top cpu 3}%
${top name 4} $alignr ${top cpu 4}%

${font GE Inspira:pixelsize=20}${color4}RAM ${font Play:pixelsize=14}${color green}${mem}${alignr} ${color0}${font Play:pixelsize=17}$memmax
${membar 5,}
${voffset -15}${font GE Inspira:pixelsize=12}${color0}${top_mem name 1} $alignr ${top_mem mem_res 1}
${top_mem name 2} $alignr ${top_mem mem_res 2}
${top_mem name 3} $alignr ${top_mem mem_res 3}
${top_mem name 4} $alignr ${top_mem mem_res 4}

${voffset -10}${font GE Inspira:pixelsize=15}${color4}SWAP ${font Play:pixelsize=12}${color0}${alignr}$swap / ${swapmax}
${voffset -7}$color1
#${color0}${font Play:pixelsize=12}IP public $color4$alignr${execi 3600 wget -q -O - http://ip.42.pl/short}
#${color0}IP local $color4$alignr${execi 3600 ip route get 8.8.8.8 | awk '{print $NF; exit}' }
${color pink}${font Play:pixelsize=12}Network WIFI${color0} $hr
Down: ${color green}${downspeed wlo1}/s$alignr ${color0}Up: ${color yellow}${upspeed wlo1}/s${color0}
#Total $alignr${execi 30 cat /proc/net/dev | grep wlo1 | awk '{print "D:" ($2/1024/1024) " MB, U:", ($10/1024/1024) " MB"};'}
Network IP: $alignr ${addr wlo1}
Total $alignr Down:${totaldown wlo1}, Up:${totalup wlo1}
${downspeedgraph wlo1 20,80} $alignr ${upspeedgraph wlo1 20,80}

${voffset -15}${color0}Battery Power: ${battery_percent}% ${color lightgray}${battery_bar BAT0}$color
Time:$alignr${battery_time BAT0}
#${font GE Inspira:pixelsize=15}${color4}Uptime ${font Play:pixelsize=12}${color green}${alignr}${uptime_short}
${color0}IP public $color4$alignr${execi 3600 wget -q -O - http://ip.42.pl/short}
${alignr}${color0}Uptime: ${color green}${uptime_short}
${voffset 5}${color0}${voffset 2}$color1$alignr $sysname $kernel
$alignr $nodename${voffset -35}

Yang perlu diperhatikan adalah, dalam hal widget ini set default adalah wifi laptop saya, yakni wlo1. Jika menggunakan device berbeda, tinggal diubah saja. Misalnya pakai ethernet, tinggal ganti misalnya menjadi eth0.

Tahunya darimana device nya?
Ketikkan saja:

ifconfig

Kira-kira hasilnya di laptop saya:

banghasan@hp-elitebook-8540p:~$ ifconfig
enp0s25: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether b4:99:ba:xx:xx:xx  txqueuelen 4096  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20  memory 0xd7500000-d7520000 

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 103479  bytes 121896589 (116.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 103479  bytes 121896589 (116.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlo1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::224:d7ff:feb6:22bc  prefixlen 64  scopeid 0x20<link>
        ether 00:24:xx:xx:xx:xx  txqueuelen 4096  (Ethernet)
        RX packets 1655194  bytes 2235761900 (2.0 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1363089  bytes 129416427 (123.4 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 



Amati yang cocok device yang mana saat ini sedang dipakai.
Kholashhhh...
5 bangHasan: Conky - Widget Linux Widget untuk info di desktop linux memang menyenangkan. Dengan ini kita langsung tahu informasi yang secara umum sangat dibutuhkan. Yait...

Tidak ada komentar :

Poskan Komentar