The officially official Devuan Forum!

You are not logged in.

#1 2020-06-19 14:50:47

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

desktop / workspaces

How would one find out what desktop or workspaces are currently in use except for the desktop/workspace in use.

Like for example im using workspace 1 and have xterm open there on screen and then i have say two more xterms open in 2 and 3. I want information on workspaces/desktops 2 and 3 not on screen via the terminal.

xdotool and wmctrl seem to only display info on currently showing or active desktop in use.

Ive been through the manpages on both and cant figure it out, any ideas?

Im trying to hack something together which is pretty cool and im nearly there.

edit: better terminology "list inactive desktops that have programs running"

Last edited by HevyDevy (2020-06-19 15:00:23)

Offline

#2 2020-06-19 16:36:01

Marjorie
Member
From: Teignmouth, UK
Registered: 2019-06-09
Posts: 90  

Re: desktop / workspaces

The "Windows Quick List" applet in Cinnamon shows this information (list of names and an icon, by Workspace).
I've never found any source code for these applets though.

Offline

#3 2020-06-19 23:48:11

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 468  

Re: desktop / workspaces

Hmm wmctrl -l gives me a list of all windows across all workspaces, detailing window id, workspace number (with a - in some cases for some reason), host name(?), and window title.

Online

#4 2020-06-20 06:56:43

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: desktop / workspaces

Thanks Marjorie, i might have to see how some desktop environments do it.

thanks ralph but im interested in someway to list inactive desktops that are being used but hidden from view, similar to how dwm status bar shows all workspaces 1 - 9 but shows you inactive workspaces being used.

I believe wmctrl -l will just list active workspaces but not what workspace number is being used

So right now i have open workspace 1,2 and 9. 1 and 2 have the x-terminal-emulator open and 9 has firefox open.

0x00c00006  0 hostname st
0x00e00006  0 hostname st
0x01200003  0 hostname desktop / workspaces / Off-topic / Dev1 Galaxy Forum - Mozilla Firefox

it would be nice if wmctrl listed the inactive workspace numbers in above output.

Anyhow just curious and the more i think about what i want to achieve with tint2 the more i dont think it is possible. But ill show what ive done so far soon.

Edit: it also might be the window manager im using not having valid/compliant properties.

Last edited by HevyDevy (2020-06-20 07:07:40)

Offline

#5 2020-06-20 07:29:02

ralph.ronnquist
Administrator
From: Clifton Hill, Victoria, AUS
Registered: 2016-11-30
Posts: 468  

Re: desktop / workspaces

Hmm for me it is like:

stolpe% wmctrl -l
0x01000004 -1 stolpe xfce4-panel
0x01200003 -1 stolpe Desktop
0x03000003 -1 stolpe 
0x03400010 -1 stolpe logs - ralph.ronnquist@realthing.com.au - Mozilla Thunderbird
0x030010c7  0 stolpe 
0x02e00003 -1 stolpe gworldclock
0x030013d8  0 stolpe files
0x0360007f  0 stolpe desktop / workspaces / Off-topic / Dev1 Galaxy Forum - Pale Moon
0x0300341e  4 stolpe hello
0x03200003  4 stolpe Xfburn
0x03a00017  3    N/A TkDiff 4.1.4

It appears the second column is the _NET_WM_DESKTOP property of the windows; "-1" means that the window is to be shown on all workspaces, and otherwise it's the workspace where the window is shown. At that time, my monitors show workspace 0.

This is not cinnamon though; it might use some other window property, or it might keep that information elsewhere. The use of _NET_WM_DESKTOP property is in the wm-spec "standard", e.g. at https://specifications.freedesktop.org/ … 6085202544
but there's no compelling reason for cinnamon to  adhere to that standard.

Online

#6 2020-06-20 10:16:22

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: desktop / workspaces

I see, so my issue is with dwm as it is not compliant for _NET_WM_DESKTOP.

Ive discovered a new dwm like window manager called yaxwm that is from one of the devs at archlabs, im not a member there i just like browsing nix forums for new things.

So here is the wm https://bitbucket.org/natemaia/yaxwm/src/master/

Ive managed to get tint2 to display similar to dwm in yaxwm if i was hiding vacant tags or similar to standard i3wm statusbar.

see image here: https://i.postimg.cc/ZnydGdKP/2020-06-2 … -scrot.png

Im not using any taskbar in tint2 instead im using an executor and wmctrl to show me what workspace im on with below command.

wmctrl -d | grep "*" | awk '{print $9}'

Now ive kind of figured out how to list inactive workspace being used with below command, just need to figure out how to integrate it in some sort of script as i will need to factor in workspaces go from 0 - 10 - with 0 being the first workspace.

wmctrl -l | sed 's/^...........//g' | awk '{print $1}' | grep -o ^1

Offline

#7 2020-06-20 11:00:39

Marjorie
Member
From: Teignmouth, UK
Registered: 2019-06-09
Posts: 90  

Re: desktop / workspaces

Looks like my Cinnamon applet is based on wmctrl.

This is the sorted output (stripping Col 1) of wmctrl. The applet  formats this, though in a different order within workspace (and pulls in an app icon). Workspace -1 is my Desktop (shown on all the others too), Workspace 3 and 4 are unused.

$ sudo wmctrl -l | cut -b 11- | sort -n
 -1 grendel Desktop
  0 grendel Inbox (3 unread) — Evolution
  0 grendel John Martyn - Outside In (Paused)
  0 grendel /var/log/syslog.1
  1 grendel BBC iPlayer - Mozilla Firefox
  1 grendel BiPAC 8900X R2 - Mozilla Firefox
  1 grendel Calculator
  1 grendel desktop / workspaces / Off-topic / Dev1 Galaxy Forum - Mozilla Firefox
  1 grendel e-post.meeble.net/rspamd/ - Rspamd Web Interface - Mozilla Firefox
  1 grendel How to create an AppArmor Profile | Ubuntu - Mozilla Firefox
  1 grendel How to enable hibernate option in Ubuntu 20.04? - Ask Ubuntu - Mozilla Firefox
  1 grendel marjorie@grendel: ~
  1 grendel marjorie@grendel: ~
  1 grendel marjorie@grendel: /etc/apparmor.d
  1 grendel Newest 'nftables' Questions - Server Fault - Mozilla Firefox
  1 grendel Online Challenges & Races - British Rowing - Mozilla Firefox
  1 grendel Redis configuration – Redis - Mozilla Firefox
  1 grendel Sound
  1 grendel /var/log/syslog
  1 grendel Your account | PremierPlayer.tv - Mozilla Firefox

Offline

#8 2020-06-20 11:04:58

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 1,142  
Website

Re: desktop / workspaces

Tags in dwm are not the same as workspaces: https://github.com/w0ng/wongdev.com/blo … kspaces.md

You should join the ArchLabs forums and ask Nate about yaxwm, he is an extraordinarily helpful person.

Last edited by Head_on_a_Stick (2020-06-20 11:05:49)


Black Lives Matter

Offline

#9 2020-06-20 11:29:39

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: desktop / workspaces

Yeah i think i will Hoas.

Tint2 is usable with yaxwm but the taskbar needs some work to get it to play nice, not very suited though but something could be hacked together using executors for sure, just not how im doing it probably lol!

Cheers

Offline

#10 2020-08-08 23:16:18

Kelsoo
Member
Registered: 2016-12-09
Posts: 11  

Re: desktop / workspaces

I've been trying to find a light weight workspace notifier for my evilwm install. The lightest is built in to simpleswitcher but requires a keypress.

tint2 and xdotool work well on openbox

# Executor 1
execp = new
execp_command = xprop -root -spy | awk '/^_NET_CURRENT_DESKTOP/ { print "" ($3 + 1) ; fflush(); }'
execp_interval = 1
execp_has_icon = 0
execp_cache_icon = 0
execp_continuous = 1
execp_markup = 0
execp_tooltip = lmb=add-desktop,  rmb=remove-desktop
execp_lclick_command = xdotool set_num_desktops $(( $(xdotool get_num_desktops) + 1 ))
execp_rclick_command = xdotool set_num_desktops $(( $(xdotool get_num_desktops) - 1 ))
execp_mclick_command = 
execp_uwheel_command = 
execp_dwheel_command = 
execp_font = Sans 16
execp_font_color = #00ff00 100
execp_padding = 0 0
execp_background_id = 0
execp_centered = 0
execp_icon_w = 0
execp_icon_h = 0

bmpanel works well and is light but does to much. I only looked at it today and it seems to be made up of c modules so it might be able to be run as a stand alone program.

I used a small xterm for a while but it's to heavy and ugly!

#!/bin/bash
#xterm +sb -bg lightblue -fg blue -g 1x2-22-2 -fs 18 -e dt  #put this in xinit
# another way     wmctrl -d | grep -F '*'  | cut -c1-1 
tput civis #invisable cursor ;
xprop -root -spy | awk '/^_NET_CURRENT_DESKTOP/ { print "" ($3 + 1) ; fflush(); }' ; echo "Name" | echo  

I'm currently using dzen2 which gives me exactly what I want but is again about 6 times heavier than the window manager so it just feels plain wrong

#!/bin/sh
# this puts a tiny workspace number indicator in the top right area of the screen
# Title:    dzen-workspace-notifier.sh
# Author:   
# Version:  
# Source:   
# Depends:  dzen, wmctrl, awk
#   Add:
#        -fn $FONT
# if your dzen is compiled with XFT support.
#FONT="-*-dejavu sans-medium-r-normal-*-9-*-*-*-*-*-*-*"
#FONT='-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*'

#--[ Configuration ]---------------------------------------------------

# x position
#XPOS="-650"
# y position
#YPOS="+5"
# title width
#TWIDTH=200
# details area width
#DWIDTH=150
#WIDTH="500"
# font
FONT='-*-profont-*-*-*-*-11-*-*-*-*-*-iso8859'
# fg color
FG="white"
# bg color
BG="blue"
# events & actions
ACT='button1=togglecollapse;button3=exit'

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


while true ; do
wmctrl -d | awk '/*/ {print $1+1}'
    sleep .1
done | dzen2 -e '' -x -15   -y +5 -h '20' -w '10' -ta r -fg $FG -bg $BG -fn $FONT  -e $ACT

If you're in to conky then this works well

conkyrc
TEXT
${if_match ${execi  60 wmctrl -d | awk '{print $6}' | sed 's/,0//'}}    #/
${color1}Machine:${color2}${machine}    #/
${if_match ${desktop}==1}     #/
${color1}Workspace: ${color2}one
${else}${if_match ${desktop}==2}     #/
${color1}Workspace: ${color2}two
${else}${if_match ${desktop}==3}     #/
${color1}Workspace: ${color2}three
${else}${if_match ${desktop}==4}     #/
${color1}Workspace: ${color2}four
${else}${if_match ${desktop}==5}     #/
${color1}Workspace: ${color2}five
${else}${if_match ${desktop}==6}     #/
${color1}Workspace: ${color2}six
${else}${if_match ${desktop}==7}     #/
${color1}Workspace: ${color2}seven
${else}${if_match ${desktop}==8}     #/
${color1}Workspace: ${color2}eight
${else}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}

wmpager is very light but you need so gnome libs

If anyone finds a notifier using less resources than my window manager give me a shout :-)

Last edited by Kelsoo (2020-08-08 23:18:05)

Offline

#11 2020-08-09 04:12:47

HevyDevy
Member
Registered: 2019-09-06
Posts: 358  

Re: desktop / workspaces

Thanks Kelsoo, i shall give one or two of those suggestions a try.

Cheers

Offline

Board footer