How to get Show Desktop working for use by all users?
New install of Ubuntu desktop 22.04. I’m trying to get Show Desktop script working for use by all users, with icon in Left Panel of apps. I’ve put both a shell script show-desktop.sh permissions of 644) using wmctrl and a desktop file show-desktop.desktop with permissions of 744 in /usr/share/applications. However, I don’t get Show Desktop found in Activities or Apps. Here is show-desktop.desktop:
Type=Application Name=Show Desktop Exec=/usr/share/applications/show-desktop.sh Icon=desktop Here is show-desktop.sh:
status=»$(wmctrl -m | grep «showing the desktop» | sed -r ‘s/(.*)(ON|OFF)/\2/g’)» if [ $status == «ON» ]; then wmctrl -k off else wmctrl -k on fi What am I doing wrong?
3 Answers 3
.desktop launchers are only included in the overview if the minimum of required fields is valid. In this case, the exec= entry is not valid: the permission of the script are set to «read only» for others. Therefore, the script is not recognized as a valid executable for users that are not the owner. Thus, make the script executable by «others».
I changed permissions of desktop file in /usr/share/applications to 777, but app still not found in Activities or Apps.
I copied your files exactly, and «Show Desktop» for me appears in the application overview, with a generic icon though because I do not have a «desktop» icon.
Now working. Here is my ShowDesktop.desktop file (with permissions 644) in /usr/share/applications/: [Desktop Entry] Version=1.0 Type=Application Terminal=false Exec=/usr/bin/ShowDesktop.sh Name=Show Desktop Comment=Show Desktop Icon=/usr/share/pixmaps/ShowDesktop.jpeg
Here is my ShowDesktop.sh file (with permissions 755) in /usr/bin/: #!/bin/bash
status=»$(wmctrl -m | grep «showing the desktop» | sed -r ‘s/(.*)(ON|OFF)/\2/g’)»
if [ $status == «ON» ]; then wmctrl -k off else wmctrl -k on fi
My icon ShowDesktop.jpeg (with permissions 644) is in /usr/share/pixmaps/
The directories I used for the Exec and the Icon lines in the ShowDesktop.desktop file (/usr/bin/, /usr/share/pixmaps) were culled from previous AskUbuntu answers: Standard place for custom scripts Icon Path in Desktop File
Well, it seems like you’re having some trouble getting the «Show Desktop» feature to work for all users on your fresh installation of Ubuntu desktop 22.04. Let’s see if we can figure out what might be going wrong here.
First off, the shell script and desktop file you’ve created seem to be in the right place, but there might be a couple of issues with them. Let’s take a closer look.
In your show-desktop.desktop file, there are a couple of things to check. Make sure that the Type field is set to «Application» (which you have already done correctly). Next, ensure that the Name field is properly set to «Show Desktop». Double-check that the Exec field points to the correct location of your shell script, which seems to be /usr/share/applications/show-desktop.sh . Lastly, verify that the Icon field references a valid icon file, perhaps one named «desktop» as you have specified.
Now, let’s examine your show-desktop.sh script. It looks like you’re using the wmctrl command to manipulate the desktop status. However, there might be a small mistake in the script itself. When comparing the value of the $status variable, you need to enclose it in double quotes to prevent issues with empty or multi-word values. So, instead of [ $status == «ON» ] , you should use [«$status» == «ON»] . This ensures that the comparison works as expected.
Here’s an updated version of your script with the correction:
#!/bin/bash status="$(wmctrl -m | grep "showing the desktop" | sed -r 's/(.*)(ON|OFF)/\2/g')" if [ "$status" == "ON" ]; then wmctrl -k off else wmctrl -k on fi
Once you’ve made these adjustments, try logging out and logging back in to see if the «Show Desktop» icon appears in your Activities or Apps. Hopefully, this will resolve the issue and allow all users to access the feature conveniently.
Give it a shot, and if you encounter any further troubles, feel free to ask for more assistance!
How to create a shortcut for all users?
Ingles Dear, Good morning, we want to implement in the user profiles already generated a shortcut on the desktop where an OpenVPN terminal is being run with the following command:
openvpn --config sample.ovpn
Is it possible to find something similar to windows C:\Users\Public\Desktop ? I checked the following thread and I don’t think it meets what we need: How to create a desktop shortcut for all users in ubuntu 14.04 for ad joined mac Sorry for the bad wording in English. Version: Ubuntu 18.04 Thanks! UPDATE 22/07/2020 Español: Estimados, Al final terminamos optando por hacerlo desde Ansible. Si bien con lo del directorio Skel que en cada perfil nuevo que se crea, se genera el acceso directo, nos está faltando el playbook/config para que dicho acceso sea copiado a todos los perfiles existentes. El destino del archivo sería home//Desktop(Escritorio) pero me termina generando una carpeta el nombre ««. ¿Algún experto en Ansible que pueda guiarme? Gracias! Ingles: Dears, In the end we ended up choosing to do it from Ansible. Although with the Skel directory that in each new profile that is created, the direct access is generated, we are missing the playbook/config so that said access is copied to all existing profiles. The destination of the file would be home//Desktop(Escritorio) but it ends up generating a folder with the name ««. Any Ansible expert who can guide me? Thank you!
Thread: Create dekstop shortcut to programs for all users
Gee! These Aren’t Roasted!
Create dekstop shortcut to programs for all users
Does someone know how to create desktop shortcuts to programs (e.g to rdesktop) to all users on Ubuntu 10.04 ?
Where (in which file) do I put the shortcut so it will appare (clickable) on the dekstop for all users logging into the machine ?
Gee! These Aren’t Roasted!
Re: Create dekstop shortcut to programs for all users
I created a launcher on the desktop. I copied this launcher from /home/myUser/Desktop/ to /etc/skel/.
Now anybody new logging into the system gets the shortcut from /etc/skel/.
If anybody wants to copy the desktop preferences so that all new users gets the same settings, they also have to copy the /home/myUser/.gconf folder to /etc/skel/ aswell.
- Site Areas
- Settings
- Private Messages
- Subscriptions
- Who’s Online
- Search Forums
- Forums Home
- Forums
- The Ubuntu Forum Community
- Ubuntu Official Flavours Support
- New to Ubuntu
- General Help
- Installation & Upgrades
- Hardware
- Desktop Environments
- Networking & Wireless
- Multimedia Software
- Ubuntu Specialised Support
- Ubuntu Development Version
- Security
- Virtualisation
- Ubuntu Servers, Cloud and Juju
- Server Platforms
- Ubuntu Cloud and Juju
- Gaming & Leisure
- Emulators
- Wine
- Development & Programming
- Packaging and Compiling Programs
- Development CD/DVD Image Testing
- Ubuntu Application Development
- Ubuntu Dev Link Forum
- Programming Talk
- Repositories & Backports
- Ubuntu Backports
- Bug Reports / Support
- Ubuntu Backports
- System76 Support
- Apple Hardware Users
- Ubuntu Community Discussions
- Ubuntu, Linux and OS Chat
- Recurring Discussions
- Full Circle Magazine
- The Cafe
- Cafe Games
- Market
- Mobile Technology Discussions (CLOSED)
- Announcements & News
- Weekly Newsletter
- Membership Applications
- The Fridge Discussions
- Forum Council Agenda
- Forum Feedback & Help
- Request a LoCo forum
- Resolution Centre
- Ubuntu, Linux and OS Chat
- Other Discussion and Support
- Other OS Support and Projects
- Other Operating Systems
- Ubuntu/Debian BASED
- Debian
- MINT
- Arch and derivatives
- Fedora/RedHat and derivatives
- Mandriva/Mageia
- Slackware and derivatives
- openSUSE and SUSE Linux Enterprise
- Mac OSX
- PCLinuxOS
- Gentoo and derivatives
- Windows
- BSD
- Any Other OS
- Other Operating Systems
- Assistive Technology & Accessibility
- Art & Design
- Education & Science
- Documentation and Community Wiki Discussions
- Tutorials
- Outdated Tutorials & Tips
- Ubuntu Women
- Ubuntu LoCo Team Forums
- Americas LoCo Teams
- Argentina Team
- Software
- Hardware
- Comunidad
- Arizona Team — US
- Arkansas Team — US
- Brazil Team
- California Team — US
- Canada Team
- Centroamerica Team
- Chile Team
- Comunidad
- Hardware
- Software
- Instalaci�n y Actualizaci�n
- Colombia Team — Colombia
- Georgia Team — US
- Illinois Team
- Indiana — US
- Kentucky Team — US
- Maine Team — US
- Minnesota Team — US
- Mississippi Team — US
- Nebraska Team — US
- New Mexico Team — US
- New York — US
- North Carolina Team — US
- Ohio Team — US
- Oklahoma Team — US
- Oregon Team — US
- Pennsylvania Team — US
- Peru Team
- Texas Team — US
- Uruguay Team
- Utah Team — US
- Virginia Team — US
- West Virginia Team — US
- Argentina Team
- Asia and Oceania LoCo Teams
- Australia Team
- Bangladesh Team
- Hong Kong Team
- Myanmar Team
- Philippine Team
- Singapore Team
- Europe, Middle East, and African (EMEA) LoCo Teams
- Albania Team
- Catalan Team
- Portugal Team
- Egypt Team
- Georgia Team
- Ireland Team — Ireland
- Kenyan Team — Kenya
- Kurdish Team — Kurdistan
- Lebanon Team
- Morocco Team
- Saudi Arabia Team
- Sudan Team
- Tunisia Team
- Other Forums & Teams
- LoCo Archive
- Afghanistan Team
- Alabama Team — US
- Alaska Team — US
- Algerian Team
- Andhra Pradesh Team — India
- Austria Team
- Bangalore Team
- Bolivia Team
- Cameroon Team
- Colorado Team — US
- Connecticut Team
- Costa Rica Team
- Delhi Team
- Ecuador Team
- El Salvador Team
- Florida Team — US
- Galician LoCo Team
- Greek team
- Hawaii Team — US
- Honduras Team
- Idaho Team — US
- Iowa Team — US
- Jordan Team
- Kansas Team — US
- Libya Team
- Louisiana Team — US
- Maryland Team — US
- Massachusetts Team
- Michigan Team — US
- Missouri Team — US
- Montana Team — US
- Namibia Team
- Nevada Team — US
- New Hampshire Team — US
- New Jersey Team — US
- Northeastern Team — US
- Panama Team
- Paraguay Team
- Qatar Team
- Quebec Team
- Rhode Island Team — US
- Senegal Team
- South Carolina Team — US
- South Dakota Team — US
- Switzerland Team
- Tamil Team — India
- Tennessee Team — US
- Trinidad & Tobago Team
- Uganda Team
- United Kingdom Team
- US LoCo Teams
- Venezuela Team
- Wales Team
- Washington DC Team — US
- Washington State Team — US
- Wisconsin Team
- Yemen Team
- Za Team — South Africa
- Zimbabwe Team
- Americas LoCo Teams
- Other OS Support and Projects
- Ubuntu Official Flavours Support
Bookmarks
Bookmarks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts