Kirjoittaja Aihe: conky toimimaan  (Luettu 2119 kertaa)

Jakke77

  • Käyttäjä
  • Viestejä: 3933
  • Oulu (Oinaansuo)
    • Profiili
conky toimimaan
« : 02.10.17 - klo:09.06 »
en saa tässä toimiin tuota now playing juttua, olen koittanut säädellä conkya ties miten mutta ei vaan toimi, tiedostoa olen koitellut säätää audacioukselle ja clementinelle mutta jokin ei täsmää

mediaplayer.rc
Koodia: [Valitse]
background no
font sans:size=10
#xftfont sans:size=10
use_xft yes
xftalpha 0.9
update_interval 2
total_run_times 0
own_window yes
own_window_type dock
#own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_argb_visual true
own_window_argb_value 180
own_window_colour 224466
double_buffer yes
minimum_size 225 120
#maximum_size 220
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
default_color 101010
default_shade_color 101010
alignment top_left
gap_x 40#320
gap_y 353#510
no_buffers yes
cpu_avg_samples 1
uppercase no
border_inner_margin 15
default_bar_size 144 6

#colors
color1 96A0DF
color2 aaa
color3 ddd

TEXT
${color FFA300}${font Oswald:size=12:bold}MEDIA PLAYER ${color2} ${hr 2}
${if_match "${execi 10 python3 ~/Projects/conky-cards/mediaplayer.py clementine -i}"=="yes"}
${color3}${font Open Sans:size=9}${execpi 4 python3 ~/Projects/conky-cards/mediaplayer.py clementine -tamlr -w 45}
${if_match "${execi 4 python3 ~/Projects/conky-cards/mediaplayer.py clementine -p}"=="Unknown"}\
Progress: ${alignr}Unknown
${else}\
Progress:${alignr}${color FFA300}${execibar 4  python3 ~/Projects/conky-cards/mediaplayer.py clementine -p}
${endif}\
${else}
${color FFA300}${font Open Sans:size=9}Ei soi nyt\
${endif}

READ_ME_Ohje
Koodia: [Valitse]
conky-cards
===========

This conky setup consists of eight individual conky scripts ("cards") which display
* Date and time
* General system information
* Processes (top processes and usage)
* Memory and swap usage
* A "fortune" message from `fortune`
* Disk usage
* Network usage
* Metadata of the current track playing

Screenshots
===========

![Screenshot 0](https://i.imgur.com/9eBtSKl.png)
![Screenshot 1](screenshots/screenshot1.jpg)
![Screenshot 2](screenshots/screenshot2.jpg)

Installation
===========

####Requirements####

Install `conky` , preferably the package `conky-all` if in the future you want to use some exotic features 
For the mediaplayer "card", you need `python3` 
For the fortune "card", you need `fortune` 
The script uses the following fonts, install them
(see Customization if you wish to use your fonts)
* Antipasto [Download here](http://www.dafont.com/antipasto.font)
* Open Sans [Download here](http://www.fontsquirrel.com/fonts/open-sans)
* Oswald [Download here](http://www.fontsquirrel.com/fonts/oswald)

Copy/Move the contents to a directory of your liking and edit the following files to specify this directory by replacing `INSERT_PATH` to your directory. e.g. if the scripts are in `/home/foo/path/to/my/dir` then run
```
$ cd /home/foo/path/to/my/dir
$ sed -i 's:INSERT_PATH:/home/foo/path/to/my/dir:' mediaplayer_rc launch_all.sh
```

Now, set `launch_all.sh` as executable (`chmod u+x launch_all.sh`) and add it to your startup applications. If you don't know how, Google is your friend.
If **after** 10-15 seconds, you don't see conky on your desktop, try running:
```
sed -i -r 's/own_window_type .*/own_window_type normal/' *_rc
```


Customization
=================

**Network**

You might want to replace `enp0s20u1` or `wlp3s0` in `network_rc` with the device you are connected to the internet with  e.g.
```
$ sed -i 's/enp0s20u1/enp0s20u3/' network_rc
```

**Media Player**

Replace `clementine` in `mediaplayer_rc` with the name of your media player (e.g. `vlc`, or `audacious`, or `amarok`). 
This should probably just work (after replacement) if the media player you are using implements MPRIS 2.0 (most players do).
To customize the output, you might want to see `python3 mediaplayer.py --help`

**Fortune**

See `man fortune` and edit the arguments to the fortune call in `fortune_rc`


**Colors**

Each script uses a set of three colors, defined as
* color1 (color) 
Color of the Card heading
* color2 (color) 
Color of the horizontal line stretching from the heading to the right end
* color3 (color) 
Text color 
Here, (color) can be specified using the hexadecimal notation (without the preceding #) or a color name specified in `/usr/share/X11/rgb.txt` 
Examples of legit colors : red, blue, 20efef 
You can change any of the above colors to suit your liking/theme
Examples: 
If you want headings in blue, then run 
```
$ sed -i -r 's/color1 [a-z0-9]+$/color1 0000ff/' *_rc

```
(the [a-z0-9] in the above pattern also matches color names besides the hexadecimal colors)

Similarly, you can change the background color of the 'cards' specified by the variable `own_window_colour (color)`
For transparency, uncomment the lines `#own_window_transparent yes` (by removing the #). 
Background opacity is specified by `own_window_argb_value (value between 0 and 255)`


**Fonts**

The following fonts are used
* Antipasto [Download here](http://www.dafont.com/antipasto.font) 
Font in the which the clock is displayed
* Open Sans [Download here](http://www.fontsquirrel.com/fonts/open-sans) 
Font for the general text
* Oswald [Download here](http://www.fontsquirrel.com/fonts/oswald) 
Font for the Cards' headings

Substitue them using sed like above.



Author
========
Amish Naidu  http://amhndu.github.io
U_G_H

Aspire E5-575G V1.27 CPU: Intel i3-6100U (4) @ 2.300GHz GPU: Intel® HD Graphics 520 GPU: NVIDIA GeForce 940MX Samsung SSD 970 EVO Plus 500GB

Jakke77

  • Käyttäjä
  • Viestejä: 3933
  • Oulu (Oinaansuo)
    • Profiili
Vs: conky toimimaan
« Vastaus #1 : 02.10.17 - klo:12.34 »
eipä näytä tuo network ikkunakaan toimivan oikein, ei näytä download eikä upload nopeuksia lainkaan

Koodia: [Valitse]
# **********************************************************************
# "CPU Panel (8-core)" theme for Conky by Tony George (teejee2008@gmail.com)
#
# Webpage: http://teejeetech.blogspot.in/
# **********************************************************************


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 380
gap_y 240
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 yes
own_window_argb_value 0
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

minimum_size 170 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 Droid Sans:size=10
color0 white
color1 EAEAEA
color2 FFA300
color3 grey

TEXT
${color2}Download ${color0}${alignr}${downspeedf eth0} KiB/s
${downspeedgraph eth0 80,}
${color2}Upload ${color0}${alignr}${upspeedf eth0} KiB/s
${upspeedgraph eth0 80,}
${color2}Local${color0}${alignr}${addrs}
${color2}Public${color0}${alignr}${execi 3600 wget -q -O /dev/stdout http://checkip.dyndns.org/ | cut -d : -f 2- | cut -d \< -f -1}
U_G_H

Aspire E5-575G V1.27 CPU: Intel i3-6100U (4) @ 2.300GHz GPU: Intel® HD Graphics 520 GPU: NVIDIA GeForce 940MX Samsung SSD 970 EVO Plus 500GB

Hajakenttä

  • Käyttäjä / moderaattori
  • Viestejä: 1547
    • Profiili
Vs: conky toimimaan
« Vastaus #2 : 03.10.17 - klo:16.00 »
Verkkolaitteen nimi voi olla muukin kuin tuossa eth0:
Lainaus
${color2}Download ${color0}${alignr}${downspeedf eth0} KiB/s

Sen saa selville kun klikkaa yläpalkista verkkokouvaketta ja sen pudotusvalikosta katsoo "tietoja yhteydestä", siinä heti ylimmällä rivillä. Siinä voi olla vaikka eno1, virbr0 tai vlp2s0 tai jotain muuta riippuen laitteista ja WiFi ja ethernet erilaiset. Minulla on nuo vastaavat kohdat näin:

Koodia: [Valitse]
${color}VIESTILIIKENNE:
#{color}internet ip:${goto 100}${execi wget -O - http://whatismyip.org/ | tail}
${color}LAN osoite: ${goto 100}${addr eno1}
${color}  sisään: ${downspeedf eno1} kiB/s ${alignr} ulos: ${upspeedf eno1} kiB/s
${color}  ${downspeedgraph eno1 18,140 000000 0077ff 1000 -l} ${alignr}${upspeedgraph eno1 18,140 000000 0077ff 1000 -l}
${color}  yhteensä: ${totaldown eno1}       ${alignr}yhteensä: ${totalup eno1}
${color}WLAN osoite:${goto 100}${addr wlp2s0}
${color}  ssid: ${goto 100}${wireless_essid wlp2s0}
${color}  sisään: ${downspeedf wlp2s0} kiB/s ${alignr} ulos: ${upspeedf wlp2s0} kiB/s
${color}  ${downspeedgraph wlp2s0 18,140 000000 0077ff 1000 -l} ${alignr}${upspeedgraph wlp2s0 18,140 000000 0077ff 1000 -l}
${color}  yhteensä: ${totaldown wlp2s0}       ${alignr}yhteensä: ${totalup wlp2s0}

(Internet ip on kommentoitu pois kun se toimii vain pätkittäin.)

Musiikkisoittimia en ole Conkyyn laittanut. Onhan sinulla tämä sivu tiedossa:
http://conky.sourceforge.net/variables.html

Onnea säätöön  :)
DELL Latitude E6220 Xubuntu 20.04, DELL Latitude 5480 Xubuntu 22.04.
– Memento Vivere – Terv: Timo

Jakke77

  • Käyttäjä
  • Viestejä: 3933
  • Oulu (Oinaansuo)
    • Profiili
Vs: conky toimimaan
« Vastaus #3 : 03.10.17 - klo:16.36 »
Verkkolaitteen nimi voi olla muukin kuin tuossa eth0:
Lainaus
${color2}Download ${color0}${alignr}${downspeedf eth0} KiB/s

Sen saa selville kun klikkaa yläpalkista verkkokouvaketta ja sen pudotusvalikosta katsoo "tietoja yhteydestä", siinä heti ylimmällä rivillä. Siinä voi olla vaikka eno1, virbr0 tai vlp2s0 tai jotain muuta riippuen laitteista ja WiFi ja ethernet erilaiset. Minulla on nuo vastaavat kohdat näin:

Koodia: [Valitse]
${color}VIESTILIIKENNE:
#{color}internet ip:${goto 100}${execi wget -O - http://whatismyip.org/ | tail}
${color}LAN osoite: ${goto 100}${addr eno1}
${color}  sisään: ${downspeedf eno1} kiB/s ${alignr} ulos: ${upspeedf eno1} kiB/s
${color}  ${downspeedgraph eno1 18,140 000000 0077ff 1000 -l} ${alignr}${upspeedgraph eno1 18,140 000000 0077ff 1000 -l}
${color}  yhteensä: ${totaldown eno1}       ${alignr}yhteensä: ${totalup eno1}
${color}WLAN osoite:${goto 100}${addr wlp2s0}
${color}  ssid: ${goto 100}${wireless_essid wlp2s0}
${color}  sisään: ${downspeedf wlp2s0} kiB/s ${alignr} ulos: ${upspeedf wlp2s0} kiB/s
${color}  ${downspeedgraph wlp2s0 18,140 000000 0077ff 1000 -l} ${alignr}${upspeedgraph wlp2s0 18,140 000000 0077ff 1000 -l}
${color}  yhteensä: ${totaldown wlp2s0}       ${alignr}yhteensä: ${totalup wlp2s0}

(Internet ip on kommentoitu pois kun se toimii vain pätkittäin.)

Musiikkisoittimia en ole Conkyyn laittanut. Onhan sinulla tämä sivu tiedossa:
http://conky.sourceforge.net/variables.html

Onnea säätöön  :)


kiitti, toi network alko toimiin tolla sun vinkillä, oli toki enp4s0f1 toi eth0, itellä toi ip toimii noilla mitä on... täytyy tota soittimen conkyaki tässä etiskellä, ei se voi kovin monen mutkan päässä olla :)
U_G_H

Aspire E5-575G V1.27 CPU: Intel i3-6100U (4) @ 2.300GHz GPU: Intel® HD Graphics 520 GPU: NVIDIA GeForce 940MX Samsung SSD 970 EVO Plus 500GB