You are not logged in.
Pages: 1
I'll admit, my first encounter with tint2 was on #!. Before that I'd just run Openbox without any panels, perhaps with trayer in the dock on autohide or some such. I want to go back to the panel-less look (esp. on my netbook) but I enjoyed using tint2 and still want to keep it around. I threw together this quick & dirty script and bound it to 'Super+b' to give my panel a toggle-by-keystroke functionality. It's nothing special but I thought I'd share it with you folks incase any of you like the idea 
#!/usr/bin/python
import commands
import subprocess
output = commands.getoutput('ps -A')
if 'tint2' in output:
subprocess.call( ["killall", "tint2"] )
else:
subprocess.call( ["tint2"] )then in rc.xml:
<keybind key="W-b">
<action name="Execute">
<startupnotify>
<enabled>true</enabled>
<name>Toggle tint2</name>
</startupnotify>
<command>toggletint</command>
</action>
</keybind> Now pressing Win+B when the panel is running will terminate it. Pressing the same when the panel is not running will summon it. It's magic!
Offline
Does killing and restarting tint2 repeatedly effect your system tray? For me I lose some icons that is only rectified by logging out and back in again.
Offline
For me it depends on what I've got in the tray. It's most usually populated with nm-applet, xpad, and skype. I can kill and restart tint2 repeatedly and they don't seem effected whatsoever.
I have had issues though, for example, quod-libet loses its tray icon when tint2 is killed. I have to reenable it through the plugins menu to get it back.
Pidgin simply unhides the buddylist window when tint2 is killed, but the icon is restored on the tint2 restart. Rhythmbox seems to work the same as nm-applet/xpad/skype. I'm sure there are programs that don't like losing their icon and behave very badly when it happens, but I'm not sure which ones they are because I have not come across them 
Last edited by rsw (2009-09-26 21:40:51)
Offline
I tend to lose volman and parcellite whenever tint2 is killed and restarted.
Offline
Hmm... you sure are right. Parcellite actually seems to not have a problem with it on my machine but I definitely lose volwheel between tint2 instances. Clearly my script needs some more work 
Offline
that is a problem with tint2, you can just add a line to also restart volwheel.
Sigs do it better
Offline
I had tried that, just adding another subprocess.call for volwheel; but I was monitoring with htop and after toggling a few times I noticed a few concurrent volwheel instances... I'm not sure that's what I want 
Offline
Thanks rsw!
I tend to lose volman and parcellite whenever tint2 is killed and restarted.
Here's what I'm trying for my gamepad (nostromo_daemon), it's inconsistent but works most of the time:
(note: don't know python, this was first answer found on Google)
#!/usr/bin/python
import commands
import subprocess
import time
output = commands.getoutput('ps -A')
if 'tint2' in output:
subprocess.call( ["killall", "tint2"] )
else:
subprocess.call( ["killall", "nostromo_daemon"] )
subprocess.call( ["tint2"] )
time.sleep(4)
subprocess.call( ["nostromo_daemon"] )
Last edited by jobester (2009-11-01 02:14:10)
Offline
So, rsw... what do you think of jobester's code?
Rsw, I'm assuming that the first code you shared in the original post (the python) is saved as toggletint, or saved as a file for which toggletint is set as an alias?
I'm not a coder myself, and I'd love to have a simple, easy-to-follow guide to use and share, so I'm hoping for an authoritative version.
Many thanks to rsw & jobester!
Learning Linux slowly because I'm busy with Appropedia
Offline
you can do this in bash... just alter "whatever" and the rest works out
MYAPP=whatever
if [ `pidof $MYAPP` ]
then
killall $MYAPP
exit 1
else
$MYAPP
fi
exitThe problem with tint2 is that we can't force it to load a new config or else you could force it to load a config with 2px height rather than kill it.
ADComp has some nice tools that work better than this hack - until someone comes across a way to load new tint2 configs without logout.
I blog too much.... geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao
Offline
Cool, thanks tawan!
ADComp has some nice tools that work better than this hack
Are there particular tools you'd recommend for a semi-novice?
Learning Linux slowly because I'm busy with Appropedia
Offline
the top 3 of the user made programs listed here
I blog too much.... geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao
Offline
The problem with tint2 is that we can't force it to load a new config.
you can force tint2 to reload the config file since version 0.8.
try the command line killall -SIGUSR1 tint2
and autohide are done in SVN. You can try the release candidate 0.9RC here
http://code.google.com/p/tint2/downloads/list
Last edited by thil77 (2010-01-14 13:14:14)
Offline
you can force tint2 to reload the config file since version 0.8.
try the command line killall -SIGUSR1 tint2
Problem solved cheers! 
I blog too much.... geek stuff LinuxMintDebian | linux noob stuff LinuxMintNoob | spiritual stuff Daily Cup of Tao
Offline
Here is a little oneliner to do so:
pkill -SIGUSR1 -x tint2 && [ $(pgrep -f "perl /usr/share/volwheel/volwheel") ] && pkill -f "perl /usr/share/volwheel/volwheel" && (sleep 2 && /usr/bin/volwheel) &
Overall killing processes like this is not really suggested but tracking them from start.
Best Regards
Marcus
Offline
This would be great to put this in #! by defalt:D
The only thing that would be if it automatically came out when the mouse was near, of course this is probally simple but I just started learning Phyton.
Offline
Pages: 1
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.