Powered By

Powered by Blogger

Tampilkan postingan dengan label show desktop. Tampilkan semua postingan
Tampilkan postingan dengan label show desktop. Tampilkan semua postingan

Rabu, 13 April 2011

Show Desktop Icon For The Ubuntu Unity Launcher

Show Desktop Unity

Currently there's no "Show desktop" applet / icon for the Unity panel in Ubuntu 11.04 and while you can use Super + D to toggle Show Desktop, many are used to using an icon for this. So here's how to get such an icon on your Unity panel.


Instead of an actual applet you can use a small script we've posted a long time ago (back then, Docky was still a part of Gnome DO and it didn't have a "Show desktop" icon). To get it running, simply follow the steps below.


1. Firstly install wmctrl:
sudo apt-get install wmctrl

2. Download the script and .desktop file, extract it and place the "showdesktop" script in the /usr/local/bin folder using the commands below:
cd
wget http://webupd8.googlecode.com/files/showdesktop.tar.gz
tar -xvf showdesktop.tar.gz && rm showdesktop.tar.gz
sudo mv showdesktop /usr/local/bin/

If you want to manually download the file, get it from HERE.

3. Now you should see a file called "showdesktop.desktop" in your home folder - you can move it wherever you want (or leave it there) and then simply drag it to the Unity launcher and you'll have a "Show desktop" icon.

Known issue: when clicking the "Show Desktop" icon in the Unity launcher, you'll have to wait until the icon stops pulsating before clicking it again (that's about 10 seconds) or else the it doesn't do anything. If you know a way to fix this, please let us know in the comments! Update: you can middle click when the icon is pulsating if you don't want to wait (thanks to Mahdi for the tip!).


Post idea thanks to soee!

Rabu, 14 Oktober 2009

'Show Desktop' Applet For Docky (Gnome-Do)

docky show desktop

Update: Docky now has it's own "Show Desktop" applet, but Docky and Gnome DO are separate applications for a while and a lot of people are still using the old Docky integrated into Gnome DO, so this should still be useful.

I know a lot of you are using Gnome Do for quite some time, but I've only recently switched to it. One of the most annoying things when running it in Docky mode (Dock bar) is that it doesn't have to many applets, and I can live with that but now without a "Show Desktop" shortcut.

Yes, you can use a keyboard shortcut for showing the desktop, but I wanted this in Gnome Do / Docky and managed to create an applet (actually a script) to use in Docky.

The main challenge was to find a way to show / hide the windows from within a terminal. Then I found wmctrl, a tool which can hide / restore your windows from the command line.

The following instructions are for Ubuntu / Gnome, but should work for other Linux distributions / desktop environments too.

1. Install wmctrl:
sudo apt-get install wmctrl


2. Create an empty file and call it whatever you want. I have a Scripts folder in my Home directory where I keep all these scripts, so you can do the same. Let's say we call the script "show_desktop.sh". Paste the following code inside this file:
#!/bin/sh
if wmctrl -m | grep "mode: ON"; then
exec wmctrl -k off
else
exec wmctrl -k on
fi


And make it executable. To do this, open a terminal and:
chmod +x /path/to/show_desktop.sh

Replace /path/to with the path to where you created the script.

3. Now right click on your Gnome panel and select "Add to panel" and select a new "Custom application launcher". Choose whatever icon you want for it, name it "Show Desktop" (this name will be displayed when hovering the icon in Docky) and in the command field, enter the full path to the show_desktop.sh file you just created.

You can play with this new custom launcher to see if it's working.

4. We're basically done, all you have to do is drag and drop this launcher to Docky.