6 Jan 2009

screenshot of pgsystray with the menu showing

Hey well as I've been on holidays over xmas I've been doing some of my own coding again - basically doing stuff I've wanted to do for ages like cleaning up (packaging better) my 'pgpanel' application and getting it ready for the masses to use (because 4 years later, it is still the only desktop panel application which does all these things which I want it to do). I figure lots of people won't use it though, unless it has some of this standard crap like a 'system tray'.

So I've written a system tray application in perl gtk which is nearly fully functional now and then I'll add it into pgpanel. For now though, it works fine as a standalone application.

Here it is: systray-gtk-working.tbz.

Eventually I'll put it on freshmeat/sourceforge/etc as a standalone application.
To run it, you'll need to have the perl X11::Protocol module installed as well as the perl GTK2 bindings.

Here is an example of how to run it:

  tar xjvf systray-gtk-working.tbz
  cd systray-gtk-working

screenshot showing off the features of pgpanel

And while I'm at it, here is an annotated screenshot showing off the features of my pgpanel app, namely that:

  • you can have text on your launchers instead of having to find icons for them and remember what all the different icons do
  • panels can autohide and you can show/hide them with your mouse scroll wheel.
  • panels can embed other applications (for example gkrellm) and thereby impart auto-hiding to those applications.
  • you can enter commands in launchers with the flexibility of the bash command line.
  • launcher buttons can accept dropped files
  • launcher buttons can run commands with modified (or even removed) environment variables
  • panels can be permanently or temporarily pinned to stop the autohide (if it is enabled)
  • it features a 'VersatileAction' and 'CustomScrollAction' button on which you can assign actions to different mouse buttons and scroll events.
  • pre-release pgpanel3 version download link: pgpanel3-20090105.tbz And a quick list of requirements:
    • perl Gtk2 bindings (called Gtk2Perl or perl-gtk2 or libperl-gtk depending on your distro)
    • ImageMagick (used to resize icons)
    • X11::Protocol perl module (needed for systray and embedding support).
    The systray stuff hasn't really been integrated yet, even though it shows up in the menu.

    One of the really good things about it is that it is simple enough to create a button which seeks back/forward in your currently playing Amarok song by running 'dcop amarok player seekRelative -5' and 'dcop amarok player seekRelative 5'.

    The VersatileAction items also support running a periodic command and displaying the text of the output.

    For example the item showing green text in the skinny screenshot does the following:

    • periodically (at a configurable timeout) display the current track and time within '<' and '>' by executing a few dcop commands and formatting the output
    • scroll up: seek forward 5 seconds by runing a dcop amarok player seekRelative 5
    • scroll up: seek back 5 seconds by runing a dcop amarok player seekRelative -5
    • left-click: executes my program (which allows higher resolution seeking within the song without showing the amarok user interface)
    The configuration for those button actions are all done via two properties (the timeout is a third one):
    The action list defines different commands which can then be assigned to mouse events.
    So, the following action list (which has been wrapped at the commas to make it clearer):
      time=capture:dcop amarok player currentTime,
      song=capture:dcop amarok player nowPlaying,
      forw=exec:dcop amarok player seekRelative 5,
      back=exec:dcop amarok player seekRelative -5,
    defines 'time', 'song', 'forw', 'back', and 'slider'. The actions prefixed with 'capture:' will be executed in the foreground and their output captured. The actions prefixed with 'exec:' will be executed in the background and will produce no text.

    And then the event mapping:

      mouse:up=%back%%250<%song %time>,
      mouse:down=%forw%%250<%song %time>,
      idle=<%song %time>
    assigns actions to mouse up,down, and button 1 release. When any of the events occur, the string shown in the mapping is used to produce text for the panel item display. So when mouse:up occurs, it runs the 'back', 'song', and 'time' actions and any captured text is displayed. The '%%250' inserts a delay of 250 milliseconds so that the seek has had time to take effect when song and time are captured

    That's enough for now. I have to go to work tomorrow :(

    6 July 2008

    Well lock-keyboard-for-baby (lk4b) now has mouse locking support too (thanks to a user contributed patch). Check out its page or the sourceforge page for the updated file.

    In other news, lately I've been working on a poker hand history viewer / tournament history viewer. I'll make a page for it and put some screenshots up soon (hopefully).

    Also I've discovered all downloads of '.pl' files that I've linked to won't work because my stupid ISP is denying access to them (instead of just configuring their server properly). Ive renamed all the files to remove the extension, but I can't be bothered fixing all the links right now. So if a you get a failed download of a '.pl' file try it again without the '.pl'.

    26 April 2007

    Here is a snippet to get a listing of your favourite tracks out of amarok (assuming amarok is running):
    dcop amarok collection query "select '^',playcounter,url from statistics where playcounter > 0 order by playcounter desc" \
    	      |tr '\n' '\t'|tr '^' '\n' > ~/favourite-tracks-listing.txt 
    I've just noticed, however, that the file paths in the 'url' field of that table don't seem to actually correspond to current existing files.

    How to find out the schema for the amarok database tables (assuming you are using sqlite, not mysql):
    (Note, I also had to update to a newer version of sqlite 3 after getting the error 'unsupported file format' for any sqlite commands such as '.tables' or '.schema')

    $ cd ~/.kde/share/apps/amarok
    $ sqlite3 collection.db
    SQLite version 3.3.12
    Enter ".help" for instructions
    sqlite> .tables
    admin              embed              magnatune_tracks   tags
    album              genre              playlists          tags_labels
    amazon             images             podcastchannels    uniqueid
    artist             labels             podcastepisodes    year
    composer           lyrics             podcastfolders
    devices            magnatune_albums   related_artists
    directories        magnatune_artists  statistics
    sqlite> .schema statistics
    CREATE TABLE statistics (url VARCHAR(1024),deviceid INTEGER,
    	       createdate INTEGER,accessdate INTEGER,percentage FLOAT,
    	      rating INTEGER DEFAULT 0,playcounter INTEGER,uniqueid VARCHAR(32) UNIQUE,
    	      deleted BOOL DEFAULT 0,PRIMARY KEY(url, deviceid) );
    CREATE INDEX percentage_stats ON statistics( percentage );
    CREATE INDEX playcounter_stats ON statistics( playcounter );
    CREATE INDEX rating_stats ON statistics( rating );
    CREATE INDEX uniqueid_stats ON statistics( uniqueid );
    CREATE UNIQUE INDEX url_stats ON statistics( deviceid, url );
    sqlite> .exit

    Also today I added two scripts psfindexec and start-unless-already-running. psfindex is like a 'ps' grep but without the complication of having to exclude your grep from the results. For example instead of doing something like this:

      ps -wef|grep /sylpheed-claws |grep -v grep  || sylpheed-claws &
    you can just do:
      psfindexec sylpheed-claws || sylpheed-claws &
    which is sort of what start-unless-already-running does, except that it also sets an exit status. The difference between psfindexec and the command above is that psfindexec does not use ps at all - instead it just looks for a process which has /proc/pid/exe which matches the pattern specified.

    22 March 2007

    Today I added a few pictueres of my pet turtle in my gallery.

    10 March 2007

    I am pretty happy today. I just did a google search for GNOME rubbish and the top three results were somehow related to me. I dunno - it is nice to see that my GNOME rubbishing is making it's way out into the world, but it is a bit disappointing that the google results didnt show more of other people with the same opinion :(

    I also discovered today that someone has added my pigs and xpc programs to Because of this, I've done another release of xpc(XPilot Control Center) - it fixes a few bugs and should work with the current version of xpilot.

    I am thinking it is also time I created a page for my pgpanel program. It is a handy desktop panel application. I wrote it as a replacement for the GNOME 1.4 panel when GNOME 1.4 became too old to use, since GNOME 2 is and has always been useless rubbish, and the kde kicker is more of a windows-style taskbar and doesn't really do what I want it to do (all the things the GNOME 1.4 panel used to do before GNOME 2 removed all the features). As the years have gone by I've added more and more features and I now reckon it is the best panel application available. If you want status bar widgets (or whatever those things are called) then you might still want to run kicker or something like that too. Some features of my pgpanel application are:

    • You can hide/show panels using your mouse scroll wheel.
    • You can pin panels to stop them auto-hiding.
    • You can have TEXT buttons so you DONT need to find an icon for every button and then remember what that icon is for.
    • Each panel can contain child panels (like with the original GNOME 1.4 panel drawers), which can themselves contain other drawers, and so on.
    • It can embed applications which understand the XEMBED protocol and take a '--embedded $xid' command line parameter.
        (for example gkrellm if you apply my gkrellm patch, or pigs).
    • As well as your standard launchers for just clicking and launching applications, it has a configurable item which you can use to assign actions to different events. For example I have one that runs dcop commands on scroll wheel events to tell amarok to change songs, and a click to toggle the playlist.

      Anyway, today I added a page for pgpanel and my DVB/TV stuff. I also added some handy scripts to my scripts page and got rid of some old cruft.

    19 February 2007

    Wow. I added a freshmeat and sourceforge entry for my program blahps two days ago, and already someone has gone and added me to with their own screenshots! It looks like they are a KDE user which is not surprising really because most GNOME users would not want to use any utility which had any utility left in it. I did a GNOME version of blahps by simplifying away all useful features. Here is a screenshot of it:

    Anyway, I think this means that there is now somebody other than my brother actually using my software... Suddenly I feel a weight of responsibility on my shoulders. I guess I'd better fix the bug in the tree expansion which I noticed isn't working since I added the sorting.

    My site is now showing up in google, which is great because now I can start putting political commentary and insults on here. Here goes:

    • John Howard (the corrupt Prime Minister of Australia, not the Australian actor) sucks balls whenever he is visiting the Bush.
    How was that for a start? Don't worry I'm not thinking of starting a career in comedy.

    I will check in a few days and see if my comments are google-able. For now, I will fix a few bugs in blahps before bed. OK I have fixed one or two and done another release on sourceforge. There is still an annoying bug which is eluding me but this release at least doesn't die when you hit enter in the show filter (a small bug which snuck in to my initial sf release).

    16 February 2007

    I've added a sourceforge page and a freshmeat page for my blahps program. Along with that I did a slighly cleaned up (less verbose) release of blahps. You can now download that through the sourceforge page.

    13 February 2007

    My sourceforge page for lock-keyboard-for-baby shows 3 downloads this week (that's the first I've seen since I tested it after I started the project, though I haven't checked until now), and looking back at the stats it looks like I have probably had 11 legitimate (ie by someone other than me) downloads!

    I've added a separate page for blahps and config-mplayer. I am going to start a sourceforge page for blahps and put it on freshmeat. Well that is the plan but who knows if I will get around to it.

    Also, there is another update for blahps. I added a few properties (columns) to the data model - cwd,exe,environ,mounts etc. So you can see or filter on the current working directory of the processes or their environment variables. I have split the menu of available properties up into a few submenus, since it is so big.

    Here is a screenshot of it showing the columns menu.Note also the pane in the bottom half which is showing deceased/dead processes.My blahps is, as far as I know, the only process manager/viewer to let you look at the old dead processes (very handy for short-lived processes that come and go quickly).

    Here is a screenshot of it showing filtering on the current working directory 'cwd'.

    12 February 2007

    Another update for blahps. It have finally added the pane which shows dead processes (one of my ideas which prompted me to write this program) and a status bar.

    6 February 2007

    Another update for blahps. In this one you can add and remove columns using a right-click menu,and you can reorder columns till your heart is content. It also now remembers the column orders and sorting between runs.

    5 February 2007

    An update for blahps

    31 January 2007

    Here is a screenshot of one of my other apps, pgviewps. I may rename it to blahsplit or something like that. It is a program that I use for splitting/chopping/truncating recorded mpeg program streams. I will add a download for it sometime soon once I do it up into a package. It uses a utility program mpegcat written by someone else and I need to submit a few bug fixes first.

    30 January 2007

    Here is another update to blahps. It is working wickedly now. One example of its nice features is that you can filter including the process age and whether the process belongs to you. So, I have as my default filter 'mine & age <1h' because I am not really likely to be interested in a process that isn't a recent one. I believe that although sorting is great - for things like this what you really want is to just see less stuff that you arent interested in. ie sorting by age is great - filtering by age is even better. I plan to add a toolbar with all sorts of customisable filters so that you can instantly show 'recent' processes or 'hogs' or whatever instead of showing everything and having to sort by pid or age or %CPU.

    The tree model bug that existed in the previous version is now fixed and it works beautifully (in tree mode or flat mode).

    Here is a screenshot of the flat view (ideal for sorting).

    What you can't see from a screenshot is that this program catches new processes very quickly as they are created and die, without disturbing the user interface much (ie without causing all the expanded nodes in the tree to collapse etc etc).

    Here is another screenshot of it showing the tree view.

    27 January 2007

    Here is an update to blahps It is coming along nicely now - it has a separate show, hide, and expand filters a the top, it has an autorefresh toggle, and the filters even allow you to filter to (for example) nchildren <20. So I use that in my expand filter so that it expands everything which has less than 20 child processes. It occasionally dies when the model gets out of sync with the view (which I am convinced is due to a bug in GTK (or due to crappy documentation not describing how exactly the model/view should interact).

    Also I've done a small program diskchecker, which I have set to run daily. It checks if any of my ext2/ext3 partitions are soon going to want to be checked, and if so, it pops up a gui allowing me to check them at my convenience instead of having to wait for them to be checked the next time I boot my computer.

    And here is a small program I just wrote to synchronise my local web site directory with my ISP's ftp server. It watches the local directory for changes (using gamin) and then uses ncftp to upload the changes. While I am on the subject, I will just state for the record that I believe Gamin is the only good thing to have come out of the GNOME project since the days of GNOME 1.4, after which the bastards behind GNOME took it over and dedicated themselves unashamedly to their new aim of making it progressively more and more useless.

    Here is my DVB channels config file for Adelaide, South Australia, in case it will help anyone.

    A while back, I wrote a small program to show a very wide slider for amarok. It allows much finer grained seeking within a song than the control within the amarok gui.Very useful for long audio files like audio books. Also it is more flexible - you can drag the position and it will update as you drag whereas the one in amarok will not change the position of the song until you let go. Look in the script to see what the key bindings are.

    26 January 2007

    I got a 5 cm thick porterhouse steak yesterday, and cooked it beautifully. Photos are coming soon - just as soon as I fix gphoto2 to actually have a brain instead of behaving like a piece of GNOME-inspired rubbish. (Update: I have given up on any of that gphoto2 rubbish. It is much simpler just to plug my SD card into a card reader and mount it. I am amazed that anyone uses gphoto2 for PTP cameras that can do video files.It is only good for copying files the size of a single image without barfing.)

    15 January 2007

    Here is a new program i am working on - a gui tool for viewing/killing processes - like psui except hopefully it (blahps) will be better. Here is a list of some of the aims I have for it. It uses a custom Gtk2 TreeModel so it might also serve someone as an example of one of those, which I have not been able to find on the internet to date (other than an example of a flat list model).

    Today, i am making a determined effort to get up and to work early or at least on time. It is now 8:26am and I may succeed if I get off the computer now. bo!

    As of a few days ago, I have 6 tadpoles (Australian native) in my pond. I'll stick a pic on my gallery later.

    Also, i have added in-process dcop support to pgpanel. I haven't done a tarball yet but one should be coming soon.

    17 December 2006

    An update to pgpanel.

    14 December 2006

    I have done a small patch to gkrellm to add support for directly embedding itself in other programs (using a --embedded command line switch). You can get it as a patch file or for gentoo there is a tarball of a dir to stick in your overlay dir (under app-admin). Coming soon.... a page for my pgpanel app. Here is the current tarball. Here is a sample config file for embedding gkrellm. The way to use it is stick it in ~/.pgpanel2-gkrellm/ as a file called "cfg", then do this:
     mkdir ~/.pgpanel2-gkrellm
     cp pgpanel2-gkrellm-as-downloaded.cfg ~/.pgpanel2-gkrellm/cfg
     cd /path/to/pgpanel2;
     ln -s ./run run-gkrellm
     #then you can run it any time by running this:
    That config file is set up to embed gkrellm using the --embedded flag from the patch above so if you don't install the patch you won't have an embedded gkrellm unless you right click on the panel and choose 'edit item', change the 'capture spec' to 'class:gkrellm2' , then hit OK and then click the embedding button.

    13 December 2006

    I updated the picture of me and fixed the broken links in most of the pages. I have a small patch for gkrellm which makes it support embedding directly in other apps here. A program which locks just your keyboard until you type a passphrase (so that it won't matter if you or someone else accidentally bashes the keyboard) here. Soon I should get around to adding my pgpanel app. My lastfm page is dsanchez. Here is my gallery of pics. This is how I like my steak. That is a strip of cheese on top in case you are wondering.

    23 January 2003

    I reworked the look of the site again. It now mostly uses css. If you don't like the dark backgrounds, you can use the 'plain' stylesheet (if your browser supports selecting page styles). Recently I have also added another cool little app, minipanel perl script for creating a quick gtk panel of buttons. I use it to provide a panel of controls for my tv tuner which I have running on the root window behind my login screen, so that people can watch tv without logging in. Here's an example config file, with comments and a few extra example buttons added, and here's a screenshot.

    13 January 2003

    Pigs version 1.0 is released! It now has a client mode which sends commands to the running server. For example you can send a command to show a note you specify by title or text content, or by number, or you can create new notes etc.

    For example:

    pigs -client show-note 'title=stuff on tv'
    pigs -client new-note this is a title, this is the contents
    or even
    some_command | pigs -client new-note atitle, -
    to open a new note showing the output of some_command

    6 January 2003

    I've added my desktop notes program pigs. Try it out - it is kewl! It is handy. It is da bomb.

    25 Nov 2002

    I've added the chilli_control and chilli_applet scripts mentioned just below on the Smoothwall stuff page.
    Also added a tip on how to stop bash killing applications that are running from it when you close a terminal window.

    21 Nov 2002

    Soon to come is chilli_control, a script for controlling your smoothwall box, and chilli_applet, an applet for showing the status of your smoothwall and controlling it from your gnome panel. It uses chilli_control and pgprompt.

    21 Nov 2002

    Today I added Porkmail and pgprompt to the software section.

    7 Nov 2002

    I've moved to airnet, and started a tips page.

    5 Mar 2002

    I've started revamping the look of the site, because some shameless lazybones ripped off my old look. I've also added a page for the XPilot Control Center - if you're an xpilot fan, you should check it out.

    21 Dec 2000

    Today I added a counter so that I could see the pitiful number of visitors to the site.

    3 Dec 2000

    Woohoo, my web page is finally up! At the moment, this web site only really exists to make available my resume and some software I've written, so why don't you check them out, or look at the samples.