Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 25 Oct 2014, 18:19
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Simple Quake-Terminal alike script
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
lithpr


Joined: 10 Mar 2011
Posts: 186

PostPosted: Wed 25 May 2011, 09:40    Post_subject:  Simple Quake-Terminal alike script
Sub_title: 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
View user's profile Send_private_message 
harii4


Joined: 30 Jan 2009
Posts: 444
Location: La Porte City, IA , U.S.A.

PostPosted: 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. Cool

_________________
3.01 Fat Free / Fire Hydrant featherweight/ TXZ_pup / 431JP2012
----------------------------------------------------------------------------------------
Peace and Justice are two sides of the same coin.
Back to top
View user's profile Send_private_message Visit_website 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0464s ][ Queries: 11 (0.0036s) ][ GZIP on ]