RedBearAK / toshy

Keymapper config to make Linux work like a 'Tosh!
https://toshy.app
GNU General Public License v3.0
357 stars 17 forks source link

(Question) Permanently hide icon? #202

Closed a-plastic-bag closed 7 months ago

a-plastic-bag commented 7 months ago

Hey again, Do you know how I can permanently hide Toshy's tray icon? The "Remove Icon from Tray" button does hide the icon, but it returns upon logging out/in. I searched through the readme and past issues and couldn't find anything about it.

RedBearAK commented 7 months ago

@a-plastic-bag

Sure, it's just a symlink located in ~/.config/autostart/ that loads the tray icon when it reads Toshy_Tray.desktop. So if you go into any GUI Autostart/Startup items manager panel you'd be able to remove it from there. Or if you just go into the terminal and remove the Toshy_Tray.desktop file from that location, the tray icon should no longer appear at each login.

rm ~/.config/autostart/Toshy_Tray.desktop

I considered the tray icon enough of a necessary component (to allow the user to stop or restart the services with the mouse in case of a problem with the keymapper) that I never bothered to make a script to automate disabling or re-enabling the tray icon app. And on some desktop environments like GNOME it can give a visual indication of whether the services are running or failing to start.

To get it back, you'd need to either re-run the Toshy setup script or manually do what the setup script does, which is create a symlink back to the original .desktop file that causes the "Toshy Tray" app to show up in your regular app launcher menu:

lrwxrwxrwx. 1 kris kris   55 Mar 12 22:09 Toshy_Tray.desktop -> /home/kris/.local/share/applications/Toshy_Tray.desktop

This command should take care of putting it back in place, if desired:

ln -s ~/.local/share/applications/Toshy_Tray.desktop ~/.config/autostart/Toshy_Tray.desktop

Or you can pick it again from ~/.local/share/applications/ in the GUI Startup items manager provided by your desktop environment. (I think that would make a copy of the original file rather than a symlink, but the effect will be the same, autostarting the app when you log in.)

Removing the symlink from the XDG autostart location won't remove the app from the application menu, so you'd still be able to manually access both the tray icon app and the Toshy Preferences app that (mostly) replicates the tray icon menu.

a-plastic-bag commented 7 months ago

Thanks so much for the help! That did the trick.

RedBearAK commented 7 months ago

@a-plastic-bag

I added a couple of FAQ entries dealing with this, in case someone else needs the info:

image

They are near the bottom of the FAQ section, but as you can see from the screenshot anyone searching the README or the handy GitHub table of contents for "tray" or "icon" should be able to find the new entries.

Thanks!

RedBearAK commented 7 months ago

@a-plastic-bag

And now those FAQ entries are kind of obsolete because I just merged in some changes that will put a new menu item in the tray icon menu to enable or disable autostarting the tray icon app with one click. The setting will be saved in the same sqlite3 database file that saves user preferences for config features.

You would need to download a new zip and do a reinstall in order to see the new menu item. After that, once you disable the icon from the menu item the setting will be saved, and the icon will no longer autostart or be (re)started by the installer script if you have the autostart disabled.

But the tray icon app will still be available to start manually from the app menu/launcher, and launching it manually won't re-enable the autostart until you use the menu item to change it.

image