adapted from here.
this is the thread formerly known as Geany as Launcher and Bookmarks Manager
open programs, files, folders and web sites; reshape and resize windows from within a text document.
update, 8/13: teaming up with browsers to provide word processing capabilities. (includes newer way (though i still prefer alt+z) of launching the vtg (launcher can run vtg without necessitating any window manager fiddling; it can be made a keycut with rox right click, jwm file editing, or a tool like xbindkeys. personally, i like
Code: Select all
<Key mask="S" key="space">exec:/nwp/p</Key>
Code: Select all
<Key mask="A" key="z">exec:xdotool key alt+1 Down Return</Key>
requiresxdotool-2.20110530.1-3.pet
64 bit version: xdotool-2.20110530.1-3.1.2.x86_64.rpm
the following guide assumes jwm. you can use rox panels or alter the menu code for other windows managers if you don't have it/prefer not to use it. if you can get geany's macro function to work correctly then you're a step ahead of the set up and don't need anything other than geany itself to use the tweak the following script automates. just record the steps as a macro (tools menu). you'll have a shortcut key that's at least as convenient as any other, but you don't get the tray button or menu item without some window manager adjustments of one sort or another.
______________
with a few adjustments, you can launch anything from within any geany document as if it were itself a menu or a terminal. below is a screenshot of partview being opened by clicking on the VTG button i added to a top middle hideaway tray. place the cursor and the line gets sent to the terminal, focus is switched to the terminal, the line is entered, and then focus is returned/the program, script, folder etc is run, launched, opened.
you'll need the following script and some tweaking of the geany menu.
Code: Select all
#!/bin/sh
# name vtg and place in /root/my-applications/bin
# requires xdotool and a few menu adjustments
#geany as launcher and bookmarks manager
#open programs, files and web sites; reshape and resize windows from within a text document.
xdotool key ctrl+9 ctrl+8 Return ctrl+7
#for jwm root menu(s): <Program label="Geany VTE Line Launch" icon="">vtg</Program>
#or <Program label="VTG"">vtg</Program> . for a tray button you could use <TrayButton popup="geanylauncher" label="VTG">exec:vtg</TrayButton> . add an icon (icon="path/to/icon.jpg.or.whatever") for it if you like. add to /root/jwmrc-tray or any other
at this point, this xdotool script is pointing to shortcuts in geany which do not yet exist. to make them,
edit > preferences > keybindings (or help > keyboard shortcuts > edit)
step 1: send selection (or line--just place the cursor; you don't need to highlight anything) to terminal:
ctrl+9 (this one is already built in as F4--you can set the shortcuts to whatever you like--just keep the order the same as in the script above)
step 2: switch focus to terminal:
ctrl+8
step 3: enter command obtained in step 1
Return
step 4: return focus to page/close message window and terminal so that you're back to the original page as it was before you launched the script. you'll need to alter this if you want to keep the terminal open or otherwise change the interface:
ctrl+7
you'll need to find the slots for the above commands and set the shortcut keys (the pop up will call ctrl primary), optionally leaving F4 and changing the ctrl+9 in the script above to match.
the following line of code launched with VTG will make a text file of all the files and their paths in /root/my-applications/bin (swap out the blue for the location of your choice) and then open it (named on the fly--choose whatever you like for the location and name in red) in geany:
find $PWD /root/my-applications/bin > /root/myapbin1; geany /root/myapbin1
the following code will automatically take any path highlighted and convert it into a rox bookmark (when activated with VTG, whether it's a menu item, tray button, or panel script--shortcut keys (other than those that access the menu) don't work very well with this script so i suggest putting VTG atop a root menu for quick key access). you can highlight multiple lines at a time and the script will correctly place the "rox" and quotation marks where they need to be.
Code: Select all
#! /bin/sh
# based on ht-b by miriam
# name rxmkr and place in /root/my-applications/bin
# turn a path into a rox bookmark when used with nwpt/vtg
# swap out the rox to have other file managers open the folder/other programs open the file.
xclip -o | sed 's/^/rox "/' | sed 's/$/\"/' | xclip -selection clipboard
xdotool type "`xclip -out -selection clipboard`"
#<Program label="RXMKR">vtg</Program> as menu suggestion
Code: Select all
ls /usr/share/applications > /root/pupaps1; geany /root/pupaps1
edit > select all > format > toggle case, and search > find and replace > [.desktop] [space, blank, or return all work] > whole document
and you be able to launch puppy's apps from menus that can be altered and expanded as you're using them.
to get an idea of the control this gives you, play around with the following code:
Code: Select all
#!/bin/sh
# pos+
wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz && wmctrl -r :SELECT: -e 0,1176,460,-1,-1
# value of -1 means don't change; gravity, position on x axis, position on y axis, width of x, height of y.
#currently set to snap windows between two monitors. change :SELECT: to :ACTIVE: to have it work on the currently activated window rather than giving you cross hairs to zap windows with.
#requires wmctrl.
# wmctrl -G -l gives you geometry of current windows--use as a guide.
# to use in with vtg, you don't need it as a script--just the line of code: wmctrl -r :SELECT: -b remove,maximized_vert,maximized_horz && wmctrl -r :SELECT: -e 0,1176,460,-1,-1
helpful hint: make shortcut menus from your bash-history and gexec history files. use program1| program2| program3| to launch things simultaneously as the VTE will ordinarily wait for something to be closed before launching the next thing. the program path/to/file1 path/to/file2 path/to/file3 format will allow most applications to open more than one file at a click.
(position script requires wmctrl, which you can get here)
____
i think this may have appeal beyond my little precise spinoff and it's not necessarily dependent on JWM, so i'm making it its own thread as opposed to placing it here, which is where i document most of my jwm fiddling. feedback welcomed and encouraged--this seems to me a good way to learn and play around with code and at the very least become more familiar with it, or at least less put off by it, if not more appreciative of it--knowing it makes life easier and there's nothing wrong with that. my appreciation for linux, puppy, rox, jwm, and geany grows every day.
i'm serious.
enjoy.