VSIDO Community

VSIDO Support => Conky => Topic started by: PackRat on December 26, 2016, 09:34:42 PM

Title: Conky as a window -
Post by: PackRat on December 26, 2016, 09:34:42 PM
From the conversation toward the end of this thread - pages 4 & 5 mostly - (http://vsido.org/index.php?topic=1237.msg13912#msg13912)

one should keep in mind that conky is a special type of window - one that displays system information - and as such, can be manipulated by the window manager, In this case fluxbox.

So lets create some conky mayhem keeping in mind these rules will typically apply to other special windows.

In the ~/.fluxbox/apps file create an entry like:

[group]  (workspace=[current])
[app] (name=TConky.*) (class=TConky.*)
  [Layer] {12}
  [Deco]    {TAB}
[end]


This entry creates the condition where all windows begining with "TConky" in the name and class will be grouped on the current workspace, placed on Layer 12 (the Desktop), and have a TAB only decoration.

Next create some conkyrc files for whatever information you want to display. In each conkyrc use the settings:

own_window = true,
own_window_type = 'normal',       # desktop will work, override does not
own_window_hints = 'below,sticky,skip_taskbar,skip_pager',      # window doesn't necessarily need to be below, but you do want it decorated for the tabs to show
own_window_class = 'TConky<some text string>',
own_window_title = 'TConky<some text string>',


the name and class can be anything as long as it begins with TConky - i.e. TConkyCPU, TConkyclock .....

Now, when those conkrc files are called by conky, they will all tab together, and clicking on the tab - or using a key binding - will allow you to cycle through the various conky windows:

(http://en.zimagez.com/miniature/scrot-shot-december261482787799.png) (http://en.zimagez.com/zimage/scrot-shot-december261482787799.php)

So now there is way to manage all your conky windows on your desktop by unleashing the power of fluxbox (pekwm also has window grouping so it shoud do this as well.) Some finagling with the window and font size will pretty it up for you.

Of course just substitute whatever special windows you like to run and the same basic rules apply.

Edit - did some more testing, If Deco is set to {BORDER} or {NONE} in the ~/.fluxbox/apps file, the conky windows do group together with the appropriate decor and a key binding will cycle through them - I was worried that wouldn't work becuase of conky window hints (own_window_hints) restrictions. If you have ever used screen or tmux cycling through the conky windows with a key binding is a familiar exercise.
Title: Re: Conky as a window -
Post by: Snap on December 27, 2016, 07:31:24 AM
Really interesting. Thanks, PackRat.
Title: Re: Conky as a window -
Post by: VastOne on December 27, 2016, 03:04:08 PM
Good stuff PackRat.. There is so much I have yet to explore in Fluxbox

As usual..

FUCK CONKY!

;D
Title: Re: Conky as a window -
Post by: PackRat on December 27, 2016, 04:28:54 PM
something a bit more useful - transmission set up with a port monitoring conky:

(http://en.zimagez.com/miniature/scrot-shot-tue271482856034.jpg) (http://en.zimagez.com/zimage/scrot-shot-tue271482856034.php)  (http://en.zimagez.com/miniature/scrot-shot-tue271482856047.jpg) (http://en.zimagez.com/zimage/scrot-shot-tue271482856047.php)
Title: Re: Conky as a window -
Post by: hakerdefo on December 27, 2016, 05:33:42 PM
As ever PackRat proves that his knowledge of anything & everything related to WMs is great!
Can you share the config for port-monitor conky? Many will find it useful.
P.S. Avoid using port in the range of 6881-6999 in torrent clients, Instead choose a port in the range of 49160-65534. Most ISP's monitor-throttle network traffic in the 6881-6999 range.

Cheers!!!
Title: Re: Conky as a window -
Post by: PackRat on December 27, 2016, 06:20:36 PM
^ I do use a port range outside of that. Those ports were just copied fromm the conky docs.

netconkyrc

conky.config = {
--#############################################
-- Settings
--#############################################
background = true,
use_xft = true,
    font = 'Ubuntu:Semibold:size=12',
xftalpha = 1.0,
update_interval = 1.0,
-- update_interval_on_battery = 30.0,
total_run_times = 0,

own_window = true,
own_window_colour = '#111111',
own_window_transparent = false,
own_window_type = 'normal',
own_window_hints = 'sticky,skip_taskbar,skip_pager',
own_window_class = 'NetConky',
own_window_title = 'NetConky',
--#############################################
-- Compositing tips:
-- Conky can play strangely when used with
-- different compositors. I have found the
-- following to work well, but your mileage
-- may vary. Comment/uncomment to suit.
--#############################################
--#
own_window_argb_visual = true,
own_window_argb_value = 100,

--#############################################

no_buffers = true,
uppercase = false,
cpu_avg_samples = 2,
override_utf8_locale = true,
short_units = true,
imlib_cache_size = 0,
pad_percents = 1,
max_user_text = 3200,
text_buffer_size = 1024,
no_buffers = true,
uppercase = false,
if_up_strictness = 'address',
double_buffer = true,
minimum_width = 500, minimum_height = 500,
maximum_width = 500,
draw_shades = false,
draw_outline = false,
draw_borders = false,
draw_graph_borders = false,
border_inner_margin = 1,
border_outer_margin = 1,

default_color = '#DAC79C',
default_shade_color = '#000000',
default_outline_color = '#828282',
color0 = '#FFFFFF',
color1 = '#000000',
color2 = '#FF0000',-- - red
color3 = '#FFFF00',-- - yellow
color4 = '#0000FF',-- - blue
color5 = '#00FF00',-- - green
color6 = '#FFA500',-- - orange
color7 = '#00CDCD',-- - cyan3
color8 = '#FFD700',-- - gold
color9 = '#F00F16',-- - reddish

alignment = 'top_left',
gap_x = 8,
gap_y = 100,

-- ${offset 44}Network:${if_up wlp3s0}${offset 16}${wireless_bitrate wlp3s0}${endif}${offset 16}${wireless_link_qual wlp3s0}/${wireless_link_qual_max wlp3s0}${offset 16}${if_match ${wireless_link_qual_perc wlp3s0}<=30}${color9}${blink ${wireless_link_qual_perc wlp3s0}%}${color}${else}${if_match ${wireless_link_qual_perc wlp3s0}<=50}${color8}${wireless_link_qual_perc wlp3s0}%${else}${if_match ${wireless_link_qual_perc wlp3s0}>50}${color7}${wireless_link_qual_perc wlp3s0}%${endif}${endif}${endif}${color}${offset 16}${if_up wlp3s0}Up:${offset 8}${upspeedf wlp3s0}${offset 16}Down:${offset 8}${downspeedf wlp3s0}${endif}${color}\

};

conky.text = [[
Network:${offset 8}Up:${offset 8}${upspeedf enp2s0}${offset 16}Down:${offset 8}${downspeedf enp2s0}${voffset 6}
Ports:
1-1024:${offset 10}${tcp_portmon 1 1024 count}
22:${offset 10}${tcp_portmon 22 22 count}
6881-6999:${offset 10}${tcp_portmon 51400 52400 count}
]];


it's just a quick hack for illustrative purposes.

Feel free to clean it up and make it usefull  :)

And tabbed windows in fluxbox do respect real transparency so compton and the ARGB settings in the conkyrc work.
Title: Re: Conky as a window -
Post by: Snap on December 28, 2016, 05:22:35 AM
Nice! I guess this could be adapted (stripped down) to set a small port monitoring pane via conky-cli in tmux under the transmission-remote-cli pane.

Thanks, PackRat.