You are not logged in.

#1 2015-10-24 14:55:31

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 1,020
Website

[Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

Been looking the Internet to find a feature that will switch Workspaces 1 2 3 4 5 6 7 8 9 with mouse on spectrwm panel.

Not very important with double click (left/right) or middle scrolling.

dwm already have this feature enough a a single click to the number to pass in another workspace.

I can do with keyboard ALT+1 / ALT+2 etc... but i'm looking for a mouse feature.

Do spectrwm have opportunity to make such action?

Thanks in advance,
Nili

Last edited by Nili (2015-11-08 16:28:58)


Devuan // CWM
Fedora // GNOME

Offline

#2 2015-10-24 18:09:01

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,498

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

Not natively. I am pretty sure that spectrwm is like i3, and wmii in that the workspace is not created until you switch to it and will only remain if there is an open application.

dzen2 can be set up to simulate clickable workspaces - take a look at Thayer Williams' xmonad setup for clickable workspaces in xmonad - he uses dzen2 and xdotool to simulate the keystrokes necessary to switch workspaces. That may work with spectrwm.


You must unlearn what you have learned.
    -- yoda

Offline

#3 2015-10-24 19:33:15

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 1,020
Website

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

Hi PackRat, I read something that could be done with dzen2.

I thought there were any possibility or trick doing by spectrwm alone. dzen2 is beyond my interest on spectrwm.
Anyway i'm using keyboard as usual to switch.

Thanks for your answer and suggestion.

Didn't know about "the not created workspaces" except that active. Spectrwm create a workspace only when required...
...(wow that's amazing to save some spaces from RAM usage) what a nice small hack trick.

Regards,

Nili

Last edited by Nili (2015-10-25 17:46:15)


Devuan // CWM
Fedora // GNOME

Offline

#4 2015-11-02 02:43:21

hhh
Meep!
Registered: 2015-09-17
Posts: 12,524
Website

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

Moving this thread to GUI & Applications, sorry for the shuffling around! See the Announcement for an explanation, and thanks to PackRat for the heads-up!

Offline

#5 2015-11-08 02:38:37

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,498

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

I have a partial solution for this; uses dzen2.

You need to have xdotool installed (by default in VSIDO, I don't know about BL).

Create a clickable area in dzen2 and use xdotool to issue the key binding for switching desktops:

echo "^ca(1,xdotool key super+1)1^ca() | ^ca(1,xdotool key super+2)2^ca() | ^ca(1,xdotool key super+3)3^ca() | ^ca(1,xdotool key super+4)4^ca()" | dzen2 -p

"super + 1" is the key binding to switch desktops, the 1, 2, 3, 4, are the workspace numbers - add additional workspaces as needed. If you name your workspaces - i.e. One, Two, WEB, Art .... - use those instead.

here is a working conky for 4 desktops:

conky.config = {
	out_to_console = true,
	out_to_x = false,
	background = false,
	update_interval = 1,
	total_run_times = 0,
	use_spacer = 'none',

};

conky.text = [[
 ^ca(1,xdotool key super+1)1^ca()  ^ca(1,xdotool key super+2)2^ca()  ^ca(1,xdotool key super+3)3^ca()  ^ca(1,xdotool key super+4)4^ca()  ^ca(1,~/bin/menuxy -c)Run^ca()  ^ca(1,urxvt)Term^ca()  Uptime: ${uptime_short} | CPU: ${cpu cpu0}%  ${loadavg} | Mem: ${memperc}% | Net: ${if_up wlo1} ${wireless_link_qual_perc wlo1}%  ${upspeedf wlo1}  ${downspeedf wlo1}${endif} | Battery: ${if_match ${battery_percent BAT0}<=15}${blink ${battery_percent BAT0}%}${else}${battery_percent BAT0}%${endif}  ${execpi 60 acpi | awk '{print $3}' | cut -c1-4} | ${time %a %e %b %k:%M}
]];

usage -

conky -c <file> | dzen2

Use it as the bar_action in .spectrwm.conf


You must unlearn what you have learned.
    -- yoda

Offline

#6 2015-11-08 09:52:00

shot-in-the-head
Member
Registered: 2015-10-28
Posts: 61

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

Five star answer/solution from PackRat, thanks for taking the time to show us the light  smile

Offline

#7 2015-11-08 13:26:24

PackRat
jgmenu user Numero Uno
Registered: 2015-10-02
Posts: 1,498

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

No problem

Now I have to find a way to make the active desktop a different color.


You must unlearn what you have learned.
    -- yoda

Offline

#8 2015-11-08 13:50:34

Nili
Member
From: $HOME/♫♪
Registered: 2015-09-30
Posts: 1,020
Website

Re: [Solved / "dzen2" Fix] SpectrWM mouse clickable to switch workspaces

Excellent PackRat, thank you very much for this needed opportunity smile


Devuan // CWM
Fedora // GNOME

Offline

Board footer

Powered by FluxBB