You are not logged in.

#751 2017-10-23 21:48:45

misko_2083
Member
Registered: 2016-05-24
Posts: 59

Re: Show us your conky

After reading the freedesktop specifications
I came up with this:

#!/bin/bash

while read -r win_id <&3
  do
     if xprop -id $win_id | grep -e "^_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL" \
                                 -e "^_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG" &>/dev/null
     then
         wm_class=$(xprop -id $win_id | grep "^WM_CLASS(STRING)" | awk -F '"' '{print $4}')

         if [[ "${wm_class}" == "Wrapper" ]]
         then
             xprop -id $win_id | grep "^_NET_WM_NAME(UTF8_STRING)" | awk -F '"' '{print $2}'
         else
             echo "$wm_class"
         fi
     fi
done 3< <(wmctrl -l -x | awk '{print $1}')

exec 3<&-

Probably needs more testing and/or work.
wmctrl -l prints all windows so we filter out these two atoms:
_NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_WINDOW_TYPE_DIALOG
They are most likely to display in window list.

Offline

#752 2017-10-24 06:26:38

Head_on_a_Stick
Moderator
From: London
Registered: 2015-09-29
Posts: 7,383
Website

Re: Show us your conky

^ No need for grep if you're already using awk smile

So this:

wm_class=$(xprop -id $win_id | grep "^WM_CLASS(STRING)" | awk -F '"' '{print $4}')

Can be replaced with:

wm_class=$(xprop -id $win_id | awk -F'"' '/^WM_CLASS\(STRING\)/{print $4}')

This also seems to work:

wm_class=$(xprop -id $win_id | awk -F'"' '/WM_CLASS/{print $4}')

"The first principle is that you must not fool yourself - and you are the easiest person to fool" — Richard Feynman

Forum Rules   •   How to report a problem   •   bunsenlabs(7)

Offline

#753 2017-10-24 08:57:49

nore
>2⁹
From: Timberland
Registered: 2015-09-29
Posts: 331

Re: Show us your conky

Snowball keeps rolling.  smile Excellent job, misko.

What I (read we) need to do next is document the whole thing. I can't understand half of what the script is doing monkey atm, but it surely is looking good.

(Going to read xprop manual.)

Last edited by nore (2017-10-24 09:18:37)

Offline

#754 2017-10-29 10:41:30

unklar
Member
Registered: 2015-10-31
Posts: 534

Re: Show us your conky

@Teo, if you have time, please check why the script doesn't update the data anymore.
Thank you very much!  smile

Offline

#755 2017-10-30 16:48:02

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 626

Re: Show us your conky

Because the page has unfortunately stopped updating since last May unklar.
Bad luck.


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#756 2017-10-30 17:28:57

Sector11
Tpyo Knig
From: 77345 ¡#
Registered: 2015-08-20
Posts: 5,083
Website

Re: Show us your conky

Too bad it was such a nice idea too.  OH well, time to edit it, removing the Chinese connection and use the times and dates with cloud cover and sunlight and night time shadow.


BunsenLabs Forum Rules ---== I'm a Conky 1.9'er ==---
System:    Host: s12 Kernel: 3.16.0-4-amd64 x86_64 (64 bit gcc: 4.8.4)
Desktop: Openbox 3.5.2 dm: (startx) Distro: Debian GNU/Linux 8

Offline

#757 2017-10-31 03:29:50

misko_2083
Member
Registered: 2016-05-24
Posts: 59

Re: Show us your conky

Head_on_a_Stick wrote:

^ No need for grep if you're already using awk smile

smile thanks

@nore here it is

#!/bin/bash

# With process substitution output from "wmctrl -l | awk '{print $1,$2}'" is redirected to file descriptor 3
# while loop reads  "win_id" and "display" variables from file descriptor 3

while read -r win_id display <&3
  do
     # Check if window with win_id has X window properties of type normal or dialog
     # this is also a filter
     if xprop -id $win_id | grep -e "^_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL" \
                                 -e "^_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DIALOG" &>/dev/null
     then
         # Get WM_CLASS X window property
         wm_class=$(xprop -id $win_id | awk -F'"' '/^WM_CLASS/{print $4}')

         # if WM_CLASS is a "Wrapper"
         if [[ "${wm_class}" == "Wrapper" ]]
         then
             printf "%s" "$display"
             # Get WM_CLASS X window property _NET_WM_NAME
             xprop -id $win_id | awk -F '"' '/^_NET_WM_NAME/{print $2}'
         else
             # print display and wm_class
             echo "$display $wm_class"
         fi
     fi
done 3< <(wmctrl -l | awk '{print $1,$2}')

# Close file descriptor 3
exec 3<&-

This one prints out workspace/display number too

0 Firefox-esr
0 Xfce4-terminal
0 Mousepad
1 Ristretto

Offline

#758 2017-10-31 03:54:40

misko_2083
Member
Registered: 2016-05-24
Posts: 59

Re: Show us your conky

Sector11 wrote:

Too bad it was such a nice idea too.  OH well, time to edit it, removing the Chinese connection and use the times and dates with cloud cover and sunlight and night time shadow.

I've played with this cloud-based microservice to get weather info.
http://thisdavej.com/consuming-web-api- … conditions
Just needs jq (sudo apt install jq)
"jq" is sed for the structured data like JSON data.

With wget is much simpler

wget --spider --user-agent="Mozilla/5.0 Gecko/20100101" --timeout=30 -q "https://f.stdlib.com/thisdavej/weather/current?loc=San Diego, CA&deg=C" -O - | jq -r '. | "\(.temperature)°\(.degType) \(.skytext)"'

Output:
17°C Mostly Cloudy

wget --spider --user-agent="Mozilla/5.0 Gecko/20100101" --timeout=30 -q "https://f.stdlib.com/thisdavej/weather/forecast?loc=San Diego, CA&deg=C" -O - | jq -r '.[] | "\(.shortday) \(.low)-\(.high)°\(.degType) \(.skytextday) ~ Rain: \(.precip)% \(if (.precip | tonumber > 20) then "(Bring umbrella!)" else "" end)"'

Output:
Sun 17-21°C Cloudy ~ Rain: 0%
Mon 17-20°C Mostly Cloudy ~ Rain: 80% (Bring umbrella!)
Tue 17-20°C Cloudy ~ Rain: 80% (Bring umbrella!)
Wed 16-20°C Partly Sunny ~ Rain: 20%
Thu 15-20°C Sunny ~ Rain: 20%

Offline

#759 2017-10-31 08:15:30

unklar
Member
Registered: 2015-10-31
Posts: 534

Re: Show us your conky

TeoBigusGeekus wrote:

Because the page has unfortunately stopped updating since last May unklar.
Bad luck.

^^Oh, man, I could've figured that out myself. On this page I never scrolled to the bottom of the page.

Thanks, Teo, for your help.  smile

Offline

#760 2017-10-31 14:11:46

TeoBigusGeekus
BL DieHard
From: /Greece/Kastoria
Registered: 2015-10-04
Posts: 626

Re: Show us your conky

Anytime unklar wink


Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!
Please make Autocad Civil 3D and Archicad work on Linux!

Offline

#761 2017-10-31 15:27:22

nore
>2⁹
From: Timberland
Registered: 2015-09-29
Posts: 331

Re: Show us your conky

misko_2083 wrote:

@nore here it is
This one prints out workspace/display number too

Great job, misko, thank you! Script squirreled.

Offline

#762 2017-11-27 17:34:52

PackRat
Member
Registered: 2015-10-02
Posts: 577

Re: Show us your conky

sshot-123212_2017-11-27.th.png


It is difficult to get a man to understand something when his salary depends upon his not understanding it.
                                                                                                                                       Upton Sinclair

Offline

#763 2017-12-05 16:29:13

unklar
Member
Registered: 2015-10-31
Posts: 534

Re: Show us your conky

Today very bad weather....
So it's obvious to deal with Conky. wink

Here I found a very interesting, individual configuration .

Conky Version 1.10

conky -v
conky 1.10.6_pre compiled Tue Nov 21 19:25:25 UTC 2017 for Linux 4.13.8-1-ARCH x86_64

Compiled in features:

System config file: /etc/conky/conky.conf
Package library path: /usr/lib/conky


 General:
  * math
  * hddtemp
  * portmon
  * IPv6
  * Curl
  * RSS
  * Weather (METAR)
  * Weather (XOAP)
  * wireless
  * support for IBM/Lenovo notebooks
  * builtin default configuration
  * old configuration syntax
  * Imlib2
  * apcupsd
  * iostats
  * ncurses
  * Internationalization support
  * PulseAudio
 X11:
  * Xdamage extension
  * Xinerama extension (virtual display)
  * XDBE (double buffer extension)
  * Xft
  * ARGB visual
  * Own window

 Music detection:
  * MPD
  * MOC

 Default values:
  * Netdevice: eth0
  * Local configfile: $HOME/.conkyrc
  * Localedir: /usr/share/locale
  * Maximum netdevices: 64
  * Maximum text size: 16384
  * Size text buffer: 256

After a few adjustments, the first start with the "known errors"appears, if lua-scripte application find here, which call cairo.

conky1.10 in archlinux

conky -c /DATEN/francescoPC/Conky/derivantArt/urgo/conky/.conkyrc &
[1] 25862
[unklar@archhost ~]$ conky: llua_load: ...N/francescoPC/Conky/derivantArt/urgo/conky/.lua/urgo.lua:11: module 'cairo' not found:
	no field package.preload['cairo']
	no file '/usr/share/lua/5.3/cairo.lua'
	no file '/usr/share/lua/5.3/cairo/init.lua'
	no file '/usr/lib/lua/5.3/cairo.lua'
	no file '/usr/lib/lua/5.3/cairo/init.lua'
	no file './cairo.lua'
	no file './cairo/init.lua'
	no file '/usr/lib/conky/libcairo.so'
	no file '/usr/lib/lua/5.3/cairo.so'
	no file '/usr/lib/lua/5.3/loadall.so'
	no file './cairo.so'
conky: desktop window (2000012) is subwindow of root window (4a5)
conky: window type - normal
conky: drawing to created window (0x3c00002)
conky: drawing to double buffer
conky: Unknown setting 'pozycja_y'
conky: Unknown setting 'pozycja_x'
conky: forked to background, pid is 25863

conky: llua_do_call: function conky_main execution failed: attempt to call a nil value
conky: llua_do_call: function conky_main execution failed: attempt to call a nil value

I'd really like to know what package is missing. I haven't found out yet.
If I rewrite the configuration to version 1.9, it works fine. big_smile
ugro1.th.jpg ugro2.th.jpg

.conkyrc9

# conky-version1.9
    background yes
    use_xft yes
    font monofur:size=10
    xftalpha 1 
    update_interval 1.0
    total_run_times 0
    own_window yes
    own_window_transparent yes
    own_window_type normal
    own_window_hints undecorated,below,skip_taskbar,skip_pager  #sticky,
    double_buffer yes
    minimum_size 800 900
#minimum_height = 900,
#maximum_width = 900,
    draw_shades no
    draw_outline no
    draw_borders no
    draw_graph_borders no
    default_color 48192D
    default_shade_color 000000
    default_outline_color 828282
    alignment top_left
    no_buffers yes
    uppercase no
    cpu_avg_samples 2
    net_avg_samples 1
    temperature_unit celsius
    override_utf8_locale yes
    imlib_cache_size 0
    default_color FFFFFF
    color0 FFFFFF
    color1 48192D
    color2 333333
    color3 414569
    color4 1994D1
    color5 000000
    color6 C22E14
    template9 de_DE.UTF-8
#own_window_argb_value = 0,
    own_window_argb_visual yes
#own_window_colour = '000000',
    gap_x 50
    gap_y 20
    if_up_strictness address
#pozycja_x=400,
#pozycja_y=400,
    lua_load /media/DATEN/francescoPC/Conky/derivantArt/urgo/conky/.lua/urgo.lua
    lua_draw_hook_post main


TEXT
${font monofur:weight=Bold:size=90}${color4}\
${alignc}${time %H:%M}\
${font}${color}
${font Liberation Sans Narrow:weight=Bold:size=28}${color4}\
${voffset 10}\
${alignc}${execi 10 LANG=${template9} LC_TIME=${template9} date +"%A, %d. %B"}\
${font}${color}


#${color4}SYSTEM ${hr 2}
#${offset 15}$sysname $kernel
#${offset 15}$nodename
#${offset 15}Uptime: $uptime
#${offset 120}${cpugraph 40,183 666666 666666}${voffset -25}



#Battery: ${battery_percent BAT1}% ${battery_bar BAT1}
#${offset 90}ETHERNET
#${offset 15}Up: ${upspeed enp2s0} / ${totalup}
#${offset 15}${upspeedgraph enp2s0 40,285 4B1B0C FF5C2B 100 -l}
#${offset 15}Down: ${downspeed enp2s0} / ${totaldown}
#${offset 15}${downspeedgraph enp2s0 40,285 324D23 77B753 100 -l}
#${offset 15}Up: ${upspeed wlp3s0} / ${totalup}
#${offset 15}Down: ${downspeed wlp3s0} / ${totaldown}
#${color4}${hr 2}
 

Last edited by unklar (2017-12-06 14:29:18)

Offline

#764 2017-12-07 10:08:01

loutch
Member
Registered: 2015-12-12
Posts: 182

Re: Show us your conky

hello

@ unklar i permice me to change  your conky (1.09) a little  beat .

A little french  & hard drive temp & card temp .It look like this

1512641213.png


1512641489.png



@+

Last edited by loutch (2017-12-07 10:12:01)

Offline

#765 2017-12-07 14:31:52

unklar
Member
Registered: 2015-10-31
Posts: 534

Re: Show us your conky

loutch wrote:

hello

@ unklar i permice me to change  your conky (1.09) a little  beat .

Hello, my friend, it's an honor to  smile

and this on Mandriva, the distribution that brought me to Linux in 2009

Offline

#766 2017-12-07 14:40:45

loutch
Member
Registered: 2015-12-12
Posts: 182

Re: Show us your conky

unklar wrote:
loutch wrote:

hello

@ unklar i permice me to change  your conky (1.09) a little  beat .

Hello, my friend, it's an honor to  smile

and this on Mandriva, the distribution that brought me to Linux in 2009

Not mandriva (it's also this distribution that makes me come to linux) just any mageia who look like , a little revamped (a little moment of nostalgia) .

@+

Last edited by loutch (2017-12-07 14:42:47)

Offline

#767 2017-12-07 14:47:46

unklar
Member
Registered: 2015-10-31
Posts: 534

Re: Show us your conky

I knew it   lol  lol

Offline

#768 2017-12-08 11:22:39

BLizgreat!
Resident Babbler - vll!
Registered: 2015-10-03
Posts: 779

Re: Show us your conky

I need to steal ... errrrrr, borrow ? Errrr, respectfully appropriate some of these good looking conky's ! Dang ! big_smile

Offline

Board footer

Powered by FluxBB