regolith-desktop icon indicating copy to clipboard operation
regolith-desktop copied to clipboard

Dynamic workspaces rename based on content

Open ostanislaw opened this issue 3 years ago • 7 comments

Is your feature request related to a problem? Please describe. Not easy to remember what is on which workspace especially if opening some applications at 5 or more workspaces. I think it's very useful to have workspaces renamed based on opened applications dynamically. Yet it is eye caching and extremely useful feature. Lot's of people are impressed seeing my desktop and ask me what my window manager is. I use below solution for more than 1 year, and I think it's most important customization of my regolith desktop so I would like to share it and improve regolith experience. https://github.com/mh21/i3-renameworkspaces There is also another implementation (but not tried it): https://github.com/roosta/i3wsr

Describe the solution you'd like

  • maybe extras apt package with workspaces rename script integrated with regolith
  • example configuration file with list of applications names with matching icon glyphs
  • alternatively some HowTo might be also welcome, but ready package with some regolith integration out of the box might be better

Describe alternatives you've considered Alternative solution is that the the functionality is exclusively available to those who searched the web and happily configured it ;)

Additional context

  • Please see the screenshot of my desktop.
  • And for more explanation. If I open a new workspace it's just number ex. "7", then opening terminal I see "7: [T]", opening text editor on the same workspace I see "7: [T][E]".
  • By [X] I mean some glyph assigned to application, these are from FontAwesome in my case.
  • In case some application name has no glyph assigned then only its class name is displayed like "XTerm" for example. Screenshot from 2021-06-09 11-01-12

ostanislaw avatar Jun 09 '21 09:06 ostanislaw

Looks cool @ostanislaw , thanks for sharing and the suggestion! I will play around with it and see if it makes sense to package for easy consumption of other users.

kgilmer avatar Jun 11 '21 04:06 kgilmer

What change did you make to the i3 config file to show the workspace index in the bar? I don't get this after running the perl script directly from a terminal (for testing):

image

kgilmer avatar Jun 11 '21 04:06 kgilmer

  • It's simple to configure it in ~/.config/regolith/Xresources For sure this one is needed:
i3-wm.bar.stripworkspacenumbers: no
  • And I needed to override the default fancy naming like regolith has "1: [COLOURED_RECTANGLE]" One possibility is to modify some macro responsible for that in /etc/regolith if I remember correctly, which is just one line change but quite dirty solution. I discovered another possibility with using Xresources, which is just setting "" empty name to each workspace.
i3-wm.workspace.01.name:
i3-wm.workspace.02.name:
i3-wm.workspace.03.name:
i3-wm.workspace.04.name:
i3-wm.workspace.05.name:
i3-wm.workspace.06.name:
i3-wm.workspace.07.name:
i3-wm.workspace.08.name:
i3-wm.workspace.09.name:
i3-wm.workspace.10.name:
i3-wm.workspace.11.name:
i3-wm.workspace.12.name:
i3-wm.workspace.13.name:
i3-wm.workspace.14.name:
i3-wm.workspace.15.name:
i3-wm.workspace.16.name:
i3-wm.workspace.17.name:
i3-wm.workspace.18.name:
i3-wm.workspace.19.name:
  • BTW, I see you already skipped that naming, do you have any better solution for that? If not then maybe that is another improvement to consider. You know, to have a single Xresources setting which overrides each workspace name to default "", or something like that.

  • Let me share you my full Xresouces file as it is now: Xresources.txt

  • Please also see my config for https://github.com/mh21/i3-renameworkspaces It should be typically stored at:

~/.i3workspaceconfig

dot_i3workspaceconfig.txt please remove extension '.txt', and replace 'dot_' with '.'. Github does not allow to attach hidden files, and files without extension.

  • In that file you simply assign original window class name(use xprop for that) to other name friendly name (or icon glyph). And for unknown reason I always needed to use the latest entry which is capital letter:
 xprop | grep WM_CLASS                                                                                                 1419ms
WM_CLASS(STRING) = "brave-browser", "Brave-browser"
  • And I start it simply by i3 config:
 cat ~/.config/regolith/i3/config | grep i3-renameworkspaces.pl
exec_always --no-startup-id i3-renameworkspaces.pl
  • I've cloned mh21 repo in ~/bin and symlinked the script:
 which i3-renameworkspaces.pl 

/home/sos/bin/i3-renameworkspaces.pl
 ~/b/i3-renameworkspaces  
 ls -lah /home/sos/bin/i3-renameworkspaces.pl
lrwxrwxrwx 1 sos sos 42 sie 29  2019 /home/sos/bin/i3-renameworkspaces.pl -> i3-renameworkspaces/i3-renameworkspaces.pl*

ostanislaw avatar Jun 11 '21 09:06 ostanislaw

This would be a nice addition. Sadly, I was unable to reproduce the look after following all the steps. At first, I had errors because the i3 config file uses '$ws1' and I needed to change to plain hardcoded '1' to make the keys of moving between workspaces, and moving windows to work without errors. So now, I see no errors, but also I am unable to see the glyphs... I have FontAwesome installed on my system, but I am missing where shall I instruct i3 to use them... I changed the obvious, i3 bar font, but that breaks the glyphs from i3xrocks (using JetBrains)... which I found rather odd... since the Jetbrains font is a setting in the fields in the scripts (i.e. /usr/share/i3xrocks/memory)....

EDIT: I should check if the 'broken' glyphs come from scripts that lack the aforementioned span html tag. Anyway, I didn't see the glyphs at all... and I did add the '-c' pointing to the mapping... so...

adRn-s avatar Feb 19 '22 19:02 adRn-s

Describe alternatives you've considered Alternative solution is that the the functionality is exclusively available to those who searched the web and happily configured it ;)

Haha! I can relate most definitely to this situation. Still, is a lot of fiddling between scripts, and configurations. An actual PR to merge would be really nice addition to regolith. Sourcing a community mapping of application classes and glyphs might be something that is already done (I didn't search yet).

adRn-s avatar Feb 19 '22 19:02 adRn-s

@adRn-s So you have finally managed to configure it?

  1. For workspace names into numbers you should be able to have that with 2 Xresources changes (first 2 dots in my post).
  2. I think I had these issues with glyphs rendering and that was probably related with some of the regolith themes but I've found a workaround by defining the glyphs for i3xrocks in Xresources: See my attached file, you need the file at following path (remove .txt extension from my original file): ~/.config/regolith/Xresources

ostanislaw avatar Apr 19 '22 07:04 ostanislaw

Thank you very much @ostanislaw, thanks to you I got the dynamic renaming working on my regolith installation! There was only one setting I had to adjust:

  • In your Xresources there is the line i3-wm.bar.font: "pango:JetBrains Mono Medium 14, FontAwesome 14" which I had to changed to i3-wm.bar.font: DejaVu Sans Mono, Font Awesome 6 Free Regular 11

The important difference is that I needed to remove the brackets aswell as the prefix "pango". This is because in my regolith installation there is the file usr/share/regolith/i3/config.d/70_bar with the line font pango:$i3-wm.bar.font, so pango is already specified

develNor avatar Mar 25 '23 07:03 develNor