SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2010-02-10 20:09:18

Nico3d3
Member
Registered: 2010-02-05
Posts: 16

Show desktop button in Tint2

Is there a way to add a show desktop button in Tint2?

Offline

Be excellent to each other!

#2 2010-02-10 20:22:26

danielrmt
#! CrunchBanger
Registered: 2009-11-13
Posts: 102

Re: Show desktop button in Tint2

You can't really add a button to tint2, but you can tweak openbox to show desktop when you double-click the desktop. This is how I do it:

<mousebind action="DoubleClick" button="Left">
  <action name="ToggleShowDesktop"/>
</mousebind>

add this after the following line in ~/.config/openbox/rc.xml

<context name="Desktop">

Offline

#3 2010-02-10 20:33:15

thil77
#! CrunchBanger
Registered: 2009-01-12
Posts: 193

Re: Show desktop button in Tint2

another solution is to add in your menu.xml an entry with

<item label="Show desktop">
   <action name="ToggleShowDesktop"/>
  </item>

and in tint2rc, use wm_menu = 1.

So when you right clic on the panel openbox's menu popup.
That's why we don't have launcher in tint2. The WM's menu is so easy and so powerful.

Offline

#4 2010-02-10 20:43:19

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,338

Re: Show desktop button in Tint2

Or just press Super-D. wink


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#5 2010-02-10 21:44:48

thil77
#! CrunchBanger
Registered: 2009-01-12
Posts: 193

Re: Show desktop button in Tint2

excellent smile

Offline

#6 2010-02-10 23:40:17

Zwopper
The GIMP Pimp
From: Deep in The Swedish Woods
Registered: 2008-11-28
Posts: 580
Website

Re: Show desktop button in Tint2

...OR...
Use ADeskbar as well and put the button there!
"It's all about choices!" big_smile


My artwork at deviantART   |    My Tweet   | My upcoming web page
Crea diem!
Lenovo ThinkPad E320 | 8GB | 512GB Samsung 840 PRO SSD | Xubuntu 13.04 & #! Waldorf

Offline

#7 2010-02-11 00:51:44

Nico3d3
Member
Registered: 2010-02-05
Posts: 16

Re: Show desktop button in Tint2

danielrmt wrote:

You can't really add a button to tint2, but you can tweak openbox to show desktop when you double-click the desktop. This is how I do it:

<mousebind action="DoubleClick" button="Left">
  <action name="ToggleShowDesktop"/>
</mousebind>

add this after the following line in ~/.config/openbox/rc.xml

<context name="Desktop">

This seemed promising but, why would I want to show desktop if I'm already seeing it? I mean you need to double-click on the desktop to show it. What I want is to be able to minimize all windows at once even if Firefox or Abiword or anything else is maximized. Super+D worked well, but is there a way to prevent it from hiding Conky? I need to minimize all windows at once, but no need to hide conky.

Last edited by Nico3d3 (2010-02-11 00:55:10)

Offline

#8 2010-02-11 00:57:26

Chives
#! CrunchBanger
From: Indiana
Registered: 2009-12-03
Posts: 155
Website

Re: Show desktop button in Tint2

Super-D doesn't seem to hide Conky when I use it.


I really am a nice person until you ask the police.
The first link is to a forum for a kick-ass MMORPG to be
The second is a blog for anyone with an opinion.
|The Hallow Life|DigiMantis|

Offline

#9 2010-02-11 01:00:20

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,338

Re: Show desktop button in Tint2

^ Which brings us back to the keyboard shortcut.  Or are you using a tablet PC or something else that doesn't have a physical keyboard?

Even with the panel shortcut, since Tint2 is on the bottom desktop layer, you might have to move an open window to get to the show desktop button.  You might want to consider an "always on top" panel like xfce4-panel if you really need a panel shortcut.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#10 2010-02-11 01:08:37

anonymous
The Mystery Member
From: Arch Linux Forums
Registered: 2008-11-29
Posts: 9,418

Re: Show desktop button in Tint2

Nico3d3 wrote:

but is there a way to prevent it from hiding Conky? I need to minimize all windows at once, but no need to hide conky.

Edit your conky config and make sure "own_window" is set to no.

Offline

#11 2010-02-11 13:01:10

Eamon
Member
Registered: 2009-06-05
Posts: 13

Re: Show desktop button in Tint2

danielrmt wrote:

You can't really add a button to tint2, but you can tweak openbox to show desktop when you double-click the desktop. This is how I do it:

<mousebind action="DoubleClick" button="Left">
  <action name="ToggleShowDesktop"/>
</mousebind>

add this after the following line in ~/.config/openbox/rc.xml

<context name="Desktop">

Thanks thats just what I've been looking for since I've gone panel-less, I had an entry in the menu but a double click is a much better idea

Nico3d3 wrote:

This seemed promising but, why would I want to show desktop if I'm already seeing it? I mean you need to double-click on the desktop to show it. What I want is to be able to minimize all windows at once even if Firefox or Abiword or anything else is maximized.

I believe that (not 100% sure) by default there is a 1 pixel margin at the top of the screen, so that if you move the mouse to the very top edge of your screen and click you are clicking on the desktop even if you've got something maximised - try right clicking at the very top and you should get the right click menu, if not you can change the margins by menu>Preferences>Openbox Config>GUI Config Tool>Margins

I've now got mine set up with a 1 pixel margin on all sides so the mouse is always close to the right click menu/double click to show desktop. Hope this helps...

Last edited by Eamon (2010-02-11 13:02:09)

Offline

#12 2010-02-11 13:50:40

danielrmt
#! CrunchBanger
Registered: 2009-11-13
Posts: 102

Re: Show desktop button in Tint2

Nico3d3 wrote:

This seemed promising but, why would I want to show desktop if I'm already seeing it? I mean you need to double-click on the desktop to show it. What I want is to be able to minimize all windows at once even if Firefox or Abiword or anything else is maximized.

I never maximize my windows since my first 1024x768 screen, but that's me.

Last edited by danielrmt (2010-02-11 13:50:58)

Offline

#13 2010-03-21 10:13:42

discovery
Member
Registered: 2010-03-21
Posts: 27

Re: Show desktop button in Tint2

Hello,

I like tint2 very much, although I am using crunchbang panel which is everything I need but I miss the transparency of Tint2.

Coming back to the "Show desktop" question. Could it be possible to create a script that shows an icon near the volume icon, and if you click that icon it would issue the command Win+D ?

Cheers
discovery

p.s. waiting eagerly for the final release of CHB 10 based on Debian..

Offline

#14 2010-03-21 13:34:50

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,338

Re: Show desktop button in Tint2

^ You could have an instance of xfce4-panel running in the bottom corner with just the Show Desktop applet.  Expect it to be skinned according to your GTK theme, so you'd probably want to adjust your Tint2 to match.  I do something similar with Weather Update.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#15 2010-03-22 00:15:25

discovery
Member
Registered: 2010-03-21
Posts: 27

Re: Show desktop button in Tint2

pvsage wrote:

^ You could have an instance of xfce4-panel running in the bottom corner with just the Show Desktop applet.  Expect it to be skinned according to your GTK theme, so you'd probably want to adjust your Tint2 to match.  I do something similar with Weather Update.

That is a nice tip. My intention is to get rid of xfce4 in openbox and simply use Tint2. Hmm.. I wished Tint2 was customizable enough to include a "Show Desktop" icon. Well i guess Super+D is my most used key combination in Crunch now...:)

Offline

#16 2010-03-22 02:27:19

johnraff
#!Drunkard
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,870
Website

Re: Show desktop button in Tint2

Another way to input keyboard combinations from a launcher, menu item or even a script is to install xdotool from the repositories. Then use the command eg 'xdotool key super+d' in your launcher.

Now, I'd like to know how to make a custom system tray icon... smile


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#17 2010-03-22 13:36:25

zengrapefruit
#! Junkie
Registered: 2009-12-11
Posts: 278

Re: Show desktop button in Tint2

If you use Tint2, you can add a command to be launched when the clock is clicked.

My configuration looks like this:

# CLOCK---------------------------------------------
time1_format = %a %e
time1_font = sans 16
#time2_format = %k %M
#time2_font = sans 8
clock_font_color = #ffffff 76
clock_padding = 4 4
clock_background_id = 1
clock_lclick_command = catfish
clock_rclick_command = sunbird

and opens, believe it or not, catfish and sunbird respectively.

Last edited by zengrapefruit (2010-03-22 13:37:45)

Offline

#18 2010-03-23 15:38:41

discovery
Member
Registered: 2010-03-21
Posts: 27

Re: Show desktop button in Tint2

@zengrapefruit

Great tip... But what terminal command is to be used in order to show the Desktop? How can we issue Super+D command in terminal?

Offline

#19 2010-03-23 16:37:13

jpope
#! Junkie
From: USA
Registered: 2009-09-20
Posts: 281
Website

Re: Show desktop button in Tint2

The steps in this link will give you a little executable that you can call to toggle the desktop. After completing the steps, place the newly created 'sdtoggle' file in ~/bin and set the right or left click for the tint2 clock to sdtoggle and you should be good to go. smile


--
...old school #! user now mostly running Arch
jpope.org

Offline

#20 2010-03-23 18:05:20

discovery
Member
Registered: 2010-03-21
Posts: 27

Re: Show desktop button in Tint2

well, I think I am good in copying tips from other and google is excellent in helping in this...:D

Here is my method in turning the clock in "show desktop" button.

The following instructions  should work for other Linux distributions / desktop environments too.

1. Install wmctrl:

sudo apt-get install wmctrl

2. Create an empty file "show_desktop.sh".


sudo nano /bin/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

save the file with Control+O in nano and make it executable. To do this, open a terminal and:

sudo chmod +x /bin/show_desktop.sh

Reference : http://www.webupd8.org/2009/10/show-des … me-do.html

Then, we need to modify Tint2 configuration. Following the excelllent tip from zengrapefruit I added the last two lines under clock session:

#---------------------------------------------
# CLOCK
#---------------------------------------------
time1_format = %H:%M
time1_font = sans 8
time2_format = %A %d %B
time2_font = sans 6
clock_font_color = #ffffff 76
clock_padding = 4 4
clock_background_id = 0
clock_lclick_command = /bin/show_desktop.sh
clock_rclick_command = /bin/show_desktop.sh

It works...:)

P.s. Now that I am finding the perfect combination of CB 9.04 I am a little hesitant to move to the Startler although my desire is to move to Debian.

Last edited by discovery (2010-03-23 18:08:16)

Offline

#21 2010-03-23 18:08:07

ottomar
Member
From: France, Vesoul
Registered: 2009-02-20
Posts: 44
Website

Re: Show desktop button in Tint2

discovery wrote:

P.s. Now that I am finding the perfect combination of CB 9.04 I am a little hesitant to move to the Startler although my desire is to move to Debian

+1 ! big_smile

Offline

#22 2010-03-23 21:48:33

discovery
Member
Registered: 2010-03-21
Posts: 27

Re: Show desktop button in Tint2

Another tip, simplier...

After installing xdotool (sudo apt-get install xdotool) you can add these lines to tint2 config on clock section:


clock_lclick_command = xdotool key super+D
clock_rclick_command = xdotool key super+space

Left click will show the desktop and the right click on clock will show the menu...

I think this is a much simpler solution.

cheers

Last edited by discovery (2010-03-23 21:52:15)

Offline

#23 2010-09-14 20:38:51

richjack
Member
Registered: 2010-08-11
Posts: 24

Re: Show desktop button in Tint2

Hello all

I know this thread is quite old, but I was looking for a similar solution and I came across this thread by Googling.

discovery wrote:

Hello,

I like tint2 very much, although I am using crunchbang panel which is everything I need but I miss the transparency of Tint2.

Coming back to the "Show desktop" question. Could it be possible to create a script that shows an icon near the volume icon, and if you click that icon it would issue the command Win+D ?

Cheers
discovery

This is exactly what I thought, so I have done the script. In fact this script can be used to create any similar launcher for tint2. It requires xdotool to work. Simply copy the code into a file and save with a filename of your choice eg showdesktop.py. You can alter the icon if you don't like it. Then make the script executable and add to your openbox autostart.sh.

#!/usr/bin/env python

# Show desktop system tray launcher for use with Openbox & tint2 (or other panels)

import gtk
import os

class StatusIcon:
    def __init__(self):
        self.statusicon = gtk.StatusIcon()
        self.statusicon.set_from_file("/usr/share/icons/gnome/22x22/apps/preferences-system-windows.png")
        self.statusicon.set_tooltip("Show Desktop") 
    
        self.statusicon.connect("activate", self.left_click_event)
        self.statusicon.connect("popup-menu", self.right_click_event)
        
    def right_click_event(self, icon, button, time):
        menu = gtk.Menu()
        about = gtk.ImageMenuItem(gtk.STOCK_ABOUT)
        quit = gtk.ImageMenuItem(gtk.STOCK_QUIT)
        
        about.connect("activate", self.show_about_dialog)
        quit.connect("activate", gtk.main_quit)
        
        menu.append(about)
        menu.append(quit)
        
        menu.show_all()
        
        menu.popup(None, None, gtk.status_icon_position_menu, button, time, self.statusicon)
    
    def left_click_event(self, event):
        os.system('xdotool key super+d')
    
    def show_about_dialog(self, widget):
        about_dialog = gtk.AboutDialog()

        about_dialog.set_destroy_with_parent(True)
        about_dialog.set_program_name("Tint2 Show Desktop Icon")
        about_dialog.set_version("0.1")
        about_dialog.set_comments('A simple system tray icon so that you can show the desktop and iconify all open windows.\n\nDesigned specifically for tint2 and Openbox.\n\nYou will need the keybinding Super+D set up to ToggleShowDesktop in your Openbox rc.xml, but this is the default.')
        about_dialog.set_authors(["richjack, 2010 \nReleased under GPL v2 or later"])
                
        about_dialog.run()
        about_dialog.destroy()

StatusIcon()
gtk.main()

The icon sits in the system tray on any panel including tint2.
Enjoy smile

Offline

#24 2010-09-14 21:23:16

boromeus
#! Junkie
Registered: 2010-09-12
Posts: 254

Re: Show desktop button in Tint2

richjack wrote:

This is exactly what I thought, so I have done the script. In fact this script can be used to create any similar launcher for tint2. It requires xdotool to work. Simply copy the code into a file and save with a filename of your choice eg showdesktop.py. You can alter the icon if you don't like it. Then make the script executable and add to your openbox autostart.sh.

Excellent script! But I don't like your icon! smile

So instead of this one:

self.statusicon.set_from_file("/usr/share/icons/gnome/22x22/apps/preferences-system-windows.png")

better this one (IMHO):

self.statusicon.set_from_file("/usr/share/icons/gnome/22x22/places/user-desktop.png")

cool

Last edited by boromeus (2010-09-14 21:27:01)

Offline

Be excellent to each other!

#25 2010-09-14 22:10:46

richjack
Member
Registered: 2010-08-11
Posts: 24

Re: Show desktop button in Tint2

Is that a grey folder icon (Gnome icon theme 2.30):
vNWprbQ

...or the conventional desktop icon (Gnome icon theme 2.20):
48px-Gnome-user-desktop.svg.png

I've got Gnome 2.30 icons and I can't say I particularly like them.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo