The time now is Wed 19 Jun 2013, 10:25
All times are UTC - 4 |
| Author |
Message |
lithpr

Joined: 10 Mar 2011 Posts: 186
|
Posted: Wed 25 May 2011, 09:40 Post subject:
Simple Quake-Terminal alike script Subject description: because what the world needs is another quake-terminal script |
|
Here's a quake-terminal script for Puppy, using the standard urxvt console. The only dependency that isn't common on Puppy is wmctrl, which can be found here: http://www.murga-linux.com/puppy/viewtopic.php?t=67987
Resolution Independent
Transparency used if available, urxvt psuedo-transparency used if not
Name this script "quake-terminal", and put it somewhere in your path, like /usr/local/bin . Needs to be made executable. Do not name the script rexquakeurxvt, that name needs to be unique to the console that this script opens.
| Code: |
#!/bin/sh
quakewindow=rexquakeurxvt
if [ "$(wmctrl -l | grep $quakewindow)" == "" ] ; then
if [ "$(pidof xcompmgr)" != "" ] ; then
exec urxvt -depth 32 +sb -fg White -bg rgba:0000/0000/0000/9999 -name $quakewindow &
else
exec urxvt -tr +sb -fg White -bg Black -sh 40 -name $quakewindow &
fi
dataline=$(wmctrl -d | grep '*')
originX=$(echo "$dataline" | cut -d ' ' -f 11 | cut -d \, -f 1)
originY=$(echo "$dataline" | cut -d ' ' -f 11 | cut -d \, -f 2)
width=$(echo "$dataline" | cut -d ' ' -f 12 | cut -d \x -f 1)
height=$(echo "$dataline" | cut -d ' ' -f 12 | cut -d \x -f 2)
originXFramed=$((width/8))
targetWidthFramed=$(( width - $(( width/8*2)) ))
targetHeight=$((height/2))
wmctrl -F -r $quakewindow -b add,hidden
wmctrl -F -r $quakewindow -e 0,$originXFramed,$originY,$targetWidthFramed,$targetHeight
wmctrl -F -r $quakewindow -b remove,hidden
wmctrl -F -R $quakewindow
elif [ "$(xwininfo -name $quakewindow | grep IsViewable)" == "" ] ; then
wmctrl -F -r $quakewindow -b remove,hidden
wmctrl -F -R $quakewindow
else
wmctrl -F -r $quakewindow -b add,hidden
fi
|
In ~/.config/openbox/rc.xml, add this to <applications> section for a better experience:
| Code: |
<application name="rexquakeurxvt">
<decor>no</decor>
<skip_pager>yes</skip_pager>
<skip_taskbar>yes</skip_taskbar>
<iconic>yes</iconic>
<desktop>all</desktop>
<layer>above</layer>
</application>
|
These are the keybindings i use, also found in rc.xml
| Code: |
<keybind key="Pause">
<action name="Execute">
<command>quake-terminal</command>
</action>
</keybind>
<keybind key="F11">
<action name="Execute">
<command>quake-terminal</command>
</action>
</keybind>
|
|
|
Back to top
|
|
 |
harii4

Joined: 30 Jan 2009 Posts: 444 Location: La Porte City, IA , U.S.A.
|
Posted: Sat 28 May 2011, 23:32 Post subject:
|
|
too bad it didn't use Xdotool instead of wmctrl.
Its great that it uses standard urxvt console.
_________________ 3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.
|
|
Back to top
|
|
 |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|