Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-10-15 12:05:39

k3dAR
Member
From: Czech Republic
Registered: 2022-07-27
Posts: 16
LinuxChrome 130.0

systray panel plugin - hotkey for show/hide hidden

Hi all :-)

Is please any way for systray panel plugin, use hotkey to show/hide hidden items?
Same as with mouse click to > or < icon on right systray applet edge.

Thanks...

Offline

#2 2024-10-15 19:54:30

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,481
LinuxFirefox 131.0

Re: systray panel plugin - hotkey for show/hide hidden

Not out of the box.

You have two potential options that I can think of:

  1. Use xdotool to move the mouse to the location of the arrow ad force a click:

    xdotool mousemove X Y click 1

    ...replace X and Y with the actual X Y coordinates of the centre of the systray arrow.
    .

  2. Use xfconf-query. The systray plugin has known-items, hidden-items, known-legacy-items, hidden-legacy-items keys that list all of the tray apps that are known or known/hidden. You can write a script to empty and populate the contents of those array fields.

You can assign both commands/scripts to a keyboard shortcut. Option #1 will be easier, assuming your systray doesn't move position.

Edit: removed the "--sync" option as it was interfering.

Last edited by ToZ (2024-10-15 20:28:36)


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2024-10-16 14:16:08

k3dAR
Member
From: Czech Republic
Registered: 2022-07-27
Posts: 16
LinuxChrome 130.0

Re: systray panel plugin - hotkey for show/hide hidden

Thanks for tips :-)

1. this work, only need move icons of power management and left of libsystray, as while fully charged is shorter than while charging/discharging smile
and also weather icon move left of libsystray, as temp <=9 Vs >=10 is different size :-)
here is full script for others:

#!/bin/sh

# coordinates of center of libsystray arrow, can get by 'xdotool getmouselocation'
SYSTRAY_ARROW_X="1698"
SYSTRAY_ARROW_Y="15"

# get currect mouse location and store it to variables
eval $(xdotool getmouselocation --shell --prefix CURRENT_)

# click on libsystray arrow
xdotool mousemove  ${SYSTRAY_ARROW_X} ${SYSTRAY_ARROW_Y} click 1

# restore previous mouse cursor position
xdotool mousemove  ${CURRENT_X} ${CURRENT_Y}

2. this work too, although is "little" dirty :-) while first script run dump hidden's to file and reset property, when next run check if hidden is empty and fill from file, if not empty dump actuall to file again, anyway big stop for usage is: libsystray not autoreload changes via xfconf-query, then is need pkill -HUP and if using >1x in <60s, then panel show dialog about crash with Run/Remove :-) second way (and without crash dialog) is reload whole panel, but with maximized window jump up/wait/down :-) or is please any other/decent method to reload libsystray config?

EDIT: to 1) add weather icon info

Last edited by k3dAR (2024-10-17 00:31:05)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.007 seconds, 7 queries executed - Memory usage: 530.32 KiB (Peak: 531.6 KiB) ]