Workspace grid (2D) and switcher

by hernejj

UUID: workspace-grid@hernejj
Score: 24
Last edited: 4 days ago
Last commit: 89329a1489cc1e6231bc904bddb2b7255ee4e105



2D workspace grid and switcher for Cinnamon

Workspace grid (2D) and switcher v0.8

2D workspace grid and switcher for Cinnamon Desktop Environment

Author: Jason J. Herne (hernejj@gmail.com) Homepage: http://github.com/hernejj/workspace-grid-cinnamon-applet

Description

This is a Cinnamon applet that implements a 2D workspace grid and provides a workspace switcher that understands multiple rows. In addition, the standard keyboard shortcuts for workspace up/down navigation are modified to actually switch workspaces instead of bringing up the Cinnamon Workspace Expo and Overview.

Portions of this code were adapted from the workspace-switcher@cinnamon.org applet created by the Cinnamon Team: http://cinnamon.linuxmint.com/

Portions of this code were adapted from the Gnome Shell Frippery Bottom Panel extension created by rmyorston: https://extensions.gnome.org/extension/3/bottom-panel/

Compatibility

This applet has been tested to be compatible with the following versions of Cinnamon and Linux distributions: Linux Mint 17 - Cinnamon 2.2 Linux Mint 16 - Cinnamon 2.0

Installing

  1. Place the "workspace-grid@hernejj" folder in the ".local/share/cinnamon/applets" folder in your home directory.

  2. Restart Cinnamon either by using Alt+F2, then hit 'r' then the enter key. Or simply log out and log back in.

  3. Start the "Cinnamon Settings" program, go to the Applets section and look for the entry named "Workspace grid (2D) and switcher". Check the checkbox to the left of this entry to enable this applet.

Setting the Number of Workspaces

This applet allows you to configure the number or rows and columns in your workspace grid. Just right click on the applet and choose "Configure..." and a dialog will appear. Enter the number of columns and rows you want and click the close button. The maximum number of workspaces supported by this applet is 12 columns by 6 rows.

Choosing the Style

There are currently two visual styles to choose from.

Single Row: Workspaces are shown to you a single row at a time. A Row indicator is present to let you know what row you are in.

Grid: A grid view of all existing workspaces. The workspaces in this style can get quite small if you have more than a few rows.

Navigating

You can navigate between your workspaces using the standard system keyboard shortcuts. By default they are as listed:

switch-to-workspace-up      Ctrl+Alt+Up_Arrow
switch-to-workspace-down    Ctrl+Alt+Down_Arrow
switch-to-workspace-left    Ctrl+Alt+Left_Arrow
switch-to-workspace-right   Ctrl+Alt+Right_Arrow

You can also click on the workspace or the row indicator lines within the switcher to navigate directly to a specific workspace or row.

You can also place your mouse over the switcher and use the scroll wheel to navigate forward and backward in the workspace grid.

By default, this applet conflicts with and disables the Expo and Scale keyboard shortcuts. There is a setting in the settings dialog to disable this behavior.

WARNING: Using Expo (or anything other than this applet) for adding/removing workspaces will cause Cinnamon to crash! While using this applet ONLY add/remove desktops via the applet's settings window.

License

This application is released under the GNU General Public License v2. A full copy of the license can be found here: http://www.gnu.org/licenses/gpl.txt
Thank you for using free software!

Change Log

v0.8:

  • Bugfix: Fixed mouse scrolling when scrolling by column. v0.7:
  • Added setting to choose direction to move when using mouse wheel
  • Bugfix: Stop trying to handle externally +/- desktops. Was broken!
  • Bugfix: Deregister event handlers when switching ui styles v0.6:
  • Multiple visual styles to choose from: single row and grid
  • Maximum number of columns increased from 6 to 12.
  • Remove reliance on external stylesheet and performance limiting hack
  • Applet colors now based on Cinnamon theme
  • Bugfix: Watch for and correct any externally added/removed desktops v0.5:
  • Added support for Cinnamon Settings API.
  • Added option to keep original scale/expo keyboard shortcuts
  • Removed hackish "configuration icon".
  • Removed old style key binding registration. Breaks on very old distros. v0.4:
  • compat: Remove right-click to configure for Cinnamon 2.2 compatibility
  • Compat: Add configuration via left-click on new icon.
  • Don't override theme style for better theme integration.
  • Workaround for "theme change makes row indicator disappear" bug. v0.3:
  • Bugfix: Removed css junk that was messing up bottom panel style.
  • Bugfix: Allow applet to properly resize with bottom panel. v0.2:
  • Added key binding support for Linux Mint 13 & Cinnamon 1.4.0.
  • Added some debug logging to assist with future incompatibility problems. v0.1:
  • Initial release.

41 Comments

-
1 year ago
Ok, so simply replacing 'switch-to-workspace-up' and 'switch-to-workspace-down' by 'switch-to-workspace-11' and 'switch-to-workspace-12' in the "applet.js"-file , assigning shortcuts to them via "keyboard shortcuts" in "system settings" and checking the "Use Keyboard shortcuts (Ctrl+Alt+Up/Down) to switch desktop rows" option in the applet settings got everything to work. Now I can specify shortcuts for expo/scale and move up/down separately. Nice!
-
1 year ago
Is there a way to keep custom shortcuts for toggling expo and scale? As soon as I activate the "Use Keyboard shortcuts (Ctrl+Alt+Up/Down) to switch desktop rows" option, none of my shortcuts for toggling expo and scale are working anymore.

In 17.2 you can specify the shortcuts for expo and scale. Shouldn't it be possible to keep these user defined shortcuts and still move up and down between workspaces via a shortcut?
-
1 year ago
varanasi, This is an often requested feature. we have discussed some ways of doing this on the bug tracker on GitHub. Perhaps someday I'll work on it :) If you know how to code, I'd be willing to accept patches.
-
1 year ago
Is there a way to make this applet work as the image on the main applet page shows, i.e. to show windows in the workspaces rather than just a number? Perhaps gnome 3 removed the ability to do this?
-
2 years ago
JBJB, nope, no way to change them. Sorry :-/. You can disable them if that helps. Check the settings for that option.

What would you set them to? I've never found a better set of keys then Ctrl+arrows. I could consider adding an option to remap them.
-
2 years ago
Works well, thanks! Is there any way to change the keyboard shortcuts for navigating within the grid? The usual methods work for left and right, but I can't see any way to change the up and down shortcuts.
-
2 years ago
Leng, Thanks for the words of encouragement :).
-
2 years ago
I created an account just to say:

Thank you so much for this applet! I adore it.
-
2 years ago
mrmacman2u, thanks :) I'll look into adding the standard configure option in place of the unsightly icon. Thanks for the info!
-
2 years ago
Excellent update overall, I have a few ideas for possible improvements and just an FYI, there is some form of "right click to configure" option in Cinn 2.2, all the "default" apps have the option.

Screenshots and further info going to your email.

Thanks again for adding much needed functionality to Mint!
-
2 years ago
Hi luigino, I read the thread you linked to and saw you solved the problem. Glad things are working out :).

For future reference, if you update this applet, it now has an icon to configure it. You no longer right click to access the configuration menu. Just click the "gear" icon to the right of the applet.
-
2 years ago
Feedback to author: I feel this applet would meet my needs, but I am unable to install it in Linux Mint 17 (Qiana). I get an error 404 when i attempt to install it. Kindly refer to my post in the Linux Mint forums:
http://forums.linuxmint.com/viewtopic.php?f=47&t=170423&p=875837#p875837

respectfully
-
2 years ago
d5xtgr, this problem is fixed with v0.4. Please update :) Thanks for reporting.
-
2 years ago
Based on a bit more tinkering, I think the root cause of the problem is the lack of the right-click dialog. I inspected the code and made a file in my home directory called ".workspace-grid.prefs" which consisted of a 2, followed by a newline, followed by another 2, and restarted Cinnamon. The applet now correctly displays a 2x2 grid. My conclusion is that on loading, the applet overwrites the Expo settings with a hardcoded 1x2 layout, and then if it finds a user config, overwrites it again with that. Since the user can't access the right-click menu, he never creates a config file and only 1x2 will work. If I get time this week I will figure out what needs to be done to get the right-click menu working again.
-
2 years ago
Hi, this does not appear to be working correctly with the new Mint 17:
- Only the top row of workspaces are shown, e.g. "Expo" shows 4 workspaces in a 2x2 grid (when your applet is removed- you still successfully intercept the ctrl-alt-up keystroke), but your applet shows 1 row by 2 columns without the row switcher to the left.
- Right-clicking does not bring up the dialog to set the dimensions, but gives only the option to remove the applet from the panel.
Restarting Cinnamon does not fix the problem.
-
2 years ago
wedeluxe, I don't think I ever did that :). I just never got around to writing up a nice proper description of the problem. Probably not a bad idea. I'll put it on my todo list.
-
3 years ago
This applet really is great work!

Abusing the "switch"-bindings is a severe usability bug in Cinnamon.
Have you already reported this one to the bug tracker?
-
3 years ago
Geoffm, yes this is indeed anoying :) Cinnamon actually hard codes expo and scale bindings to 'switch-desktop-up' and 'switch-desktop-down'. I am able to repurpose those indings but when you manually set different key combinations yourself using Cinnamon preferences (or gnome preferences) you are actually just switching the bindings for 'switch-desktop-up' and 'switch-desktop-down'. Cinnamon really needs to stop abusing the 'switch...' bindings and just create their own.
-
3 years ago
On my system (LM16 cinnamon 2.0.14) this applet causes the keyboard shortcuts for Expo and Scale to stop working.
-
3 years ago
jimbudler, Thanks for the report :).
-
3 years ago
Still works with ubuntu 13.10 and Cinnamon 2.0.6
-
3 years ago
Serged,

If I understand correctly you are asking for a preview to be displayed on switch? If so, that is do-able. I'll consider it for future releases.
-
3 years ago
When a true worksapce switcher whith a "preview" of workspaces? As in the old Gnome 2 ?
-
3 years ago
Bought a new machine. Loaded Fedora 19 on it. Still have the trouble where columns only take from 1 to 6. I need one row and eight columns!!!!!
-
3 years ago
jadekraut, yep, knwon issues with the row indicator bars not always drawing correctly. I have a temporary fix checked into git with a much better solution coming with the next release of Cinnamon. I'll try to get the temp fix rolled up into a release soon. In the mean time if anyone wants to resolve this issue please just restart Cinnamon: Alt+F2, type 'r' without the quotes and hit enter.
-
4 years ago
Using LM 14, Cinnamon 1.6.7, single panel at the top: icon on the panel only reflects columns, never rows. Using Hot corner (which I prefer to turn off), I can see that changing the number of rows does indeed change the number of workspaces, but the number of rows is never reflected in the icon. For example, 2 columns, 3 rows does indeed create 6 worskspaces, but the icon only shows 2. 3 columns, 2 rows does indeed create 6 workspaces, but the icon only shows 3. It always, only, reflects the columns. (I only need 2 workspaces, it's just that I was hoping to have 1 column with 2 rows, in order to take up less space on the panel.) Thanks for your work!
-
4 years ago
rickrich, do you have a need for more than 6x6?? I figured that was a safe bet for a maximum. In the "height" dimension adding more than 6 makes it quite difficult to distinguish between the indicator bars that tell you which row you are on.

As far as moving it goes, I turn on panel edit mode and I have no trouble moving it.
-
4 years ago
1) I edited the souce and changed 6 to 8 in TWO places (need a one constant up front!)
2) I used edit in dconf-editor the value of org.cinnamon.enabled-applets with the help of a text editor. Since I use the classic layout (top+bottom panel) I also had to specify "panel2" by hand when editing the value because the applets, for the life of them, don't seem to indulge me when I drag them between panels.
-
4 years ago
Hmm, works nice, but:

1) cols 1 to 6 works, cols greater than 6 don't.
2) can't move it from the top panel to the bottom panel in Cinnamons Classic View. All applets can be moved except this one!
-
4 years ago
Update - It has suddenly started working!! I had already re-started the system and that had not helped. Tried for the umpteenth time and suddenly the screen cleared, the workspaces updated to 4 and all is good.
-
4 years ago
Cinnamon 64. Workspace grid and switcher does not work. On attempt to change number of workspaces whole system freezes; can only crash out!!!! Ugly!!
-
4 years ago
one of the best applets, i wish it was the default behavior of the stock workspace applet
-
4 years ago
bondhuPaul, yes this is indeed anoying :) Cinnamon actually hard codes expo and scale bindings to 'switch-desktop-up' and 'switch-desktop-down'. I am able to repurpose those indings but when you manually set different key combinations yourself using Cinnamon preferences (or gnome preferences) you are actually just switching the bindings for 'switch-desktop-up' and 'switch-desktop-down'. Cinnamon really needs to stop abusing the 'switch...' bindings and just create their own. perhaps I'll whip up a patch to fix this and propose it to Clem.
-
4 years ago
Sorry for the late reply. It works but, still getting in the way of Expo and Scale. Whatever I fix my expo-scale key binding to be grid-workspace grabs that for moving to up-down workspaces.
-
4 years ago
bondhuPaul, it works for me in Fedora 18 running Cinnamon 1.6.7.
-
4 years ago
Ok bondhuPaul, I've fixed it in Cinnamon 13 so I think you should be good to go. I'm still waiting for Fedora 18 to finish installing so I can test in your actual environment. Let me know how it works for you.

If it fails, please some how capture and report the debugging output that can be found by pressing Alt+F2 then typing lg in the command line that pops up then hitting enter. Click the "Error" tab and look for any line that starts with "debug ... workspace-grid@hernejj". You can log it to a file with Cinnamon 1.6. using the Cinnamon Settings application, under the General section there is an option titled "Log LookingGlass output to ~/.cinnamon/glass.log (Requires Cinnamon Restart)". Sorry I do not have an easier method for capturing this data.
-
4 years ago
bondhuPaul, never mind :) I was able to reproduce this bug directly on Linux Mint 13 which is based on ubuntu 12.04. I, myself, have been running Ubuntu 12.10. The exact method used to register keybindings appears to have changed. Hang in there and I'll find a solution. I'm downloading a Fedora-18 ISO so I can test it there too. Thanks for reporting this!! it is likely that many users will run into this problem if not fixed.
-
4 years ago
bondhuPaul, what is the problem you are seeing? After you enable the applet your ctrl+alt+up and ctrl+alt+down keys are still bringing up expo and scale and NOT switching your desktop row?
-
4 years ago
Hello hernejj. Its cinnamon version 1.6.7. in Fedora 18.
-
4 years ago
Hi bondhuPaul, what version of Cinnamon are you running? (from termainal, execute command cinnamon --version)
-
4 years ago
It seems 'changing row' is bound with 'expo and scale applet'. Is it the case or am I facing some aberration? Since its only the initial version, I'n sure it'll get better. Thanks.