Useless Utilities


Zurück...

These are a couple of simple utilities I put together for my personal use, but which might be of some value for somebody else as well. Thery're written in different languages, and their style varies somewhat as my preferences changed by time.
For a first attempt, here are three of them, now all written in python, although they started out being put together with different helper programs. This is still reflected by the use of one or another external utility.
As I personally prefer the GTK2 appearance much over that of GTK3, they still have to rely on Python2 and the "gtk" module available for it.
Sadly, there is no GTK2 module around for Python3, so going to the current Python version forces one to use GTK3 with its - in my opinion - clumsy and clunky widgets, where I dislike particularly the huge, space wasting, spin button design besides its generally much bigger control elements which are mainly wasting screen area.
But as the programming interfache hasn't changed a lot from GTK2 for GTK3, it might be rather easy for a proficient user to modify these utilities for its use. Just expect to have to increase every size setting by some appreciable amount for correct display.

So, what's there now?


1 - The Clip Manager

This is how it looks:
 

 

The text fields in the window show the beginnings of the content of all areas of the X11 (or rather GTK) clip buffer (or two consecutive double quotes, '""', for an empty buffer).

There are 4 of them:

  1.   The Primary Buffer
  2.   The Secondary Buffer
  3.   The Clipboard Buffer
  4.   An Application Buffer

These are named by the labels in the left. The buttons next to the labels allow for manipulation of the buffer contents. The first three of them copy the current buffer text of the corresponding buffer into the buffer specified by the button. So the button named "clip" belonging to the "Primary" buffer copies that buffer's contents into the clipboard buffer, to be used by some other program.
Next to these copy buttons are three more buttons: They provide the following functions: Lastly, there's an additional button to the left of each text field showing a backwards pointing icon. These buttons are the "clear" buttons for each of the clip buffers. Clicking on them will erase the corresponding buffer, displayed by an empty string symbol (two consecutive double quotes, '""') in the text field.


 

2 - The Crontab Editor

This is how it looks:
 

 

This is the basic display the crontab editor presents initially. There ae no comments or empty lines, just the active entries are shown. Ir nontheless does keep all the other stuff intact.
To modify an entry, double click on it to display the editor dialog window (overlying the base display window):

 


This dialog presents all fields, "nicely" separated, for modification. All fields are handled as text only because of the rather complex syntax that some cron daemons understand. That way, you can use all of your cron daemon's sophistication.
The functions of the entry fields is shown above each one. The upper row of fields containes the five time specitications: .

The lower row consists of just one entry field for the command to be executed according to the time specification. It takes the full width of the window to make it easier to identify and modify, and it can even be scrolled beyond the margins to allow for very long command lines.
As usual, the "OK" button accepts the currently displayed values, and if something was modified, puts it into the corresponding table entry and the dialog is closed. If nothing was changed, or the "Cancel" button was clicked (or the "Esc" key pressed), the dialog simply closes and nothing will be changed.
Additionally, there are two more buttons to modify the crontab contents: The "Add" button allows the insertion of a new entry with the current contents of the edit dialog. This will be inserted after the selected entry, which will not be changed and remain in the list.
The "Clear" button serves to remove the current entry from the list. Any modifications done in the edit dialog will be lost, of course.
"Add" and "Clear" always set the "modified" flag.

Finally, the crontab itself will be modified on activating the "OK" button on the base window, but only if some entry was modified or the "modified" flag was set otherwise. If no modification was made or the "Cancel" button was clicked, no further action will be taken and the current crontab will stay in force.


 

3 - The At Reminder

This is how it looks:
 

 

This utility was created to remind me - the user - of actions required to be done at fixed times even during other attention capturing activities. It simply allows the specification of a time of day and select one of a pre-defined set of actions. This list is specified within the program and can be modified and extended as needed.
To perform its intended function, the program creates a small script containing the selected message text. The script template is defined within the program and can be modified to suite the user's needs. This script is then passed to the "at" command, which will execute it at the set time.
As set it up in the provided version, the script plays a sound to evoke attention, and shows the message on the screen using the Xdialog program. The example set up does just that, using the addtional external script "play_sound" in the directory where the program resides.
By modifying and extending this embedded script, it should be possible to perform whatever action the user wants. The place where the message text will be inserted has to be marked with the string "{0}", and in addition one can insert the program's storage path with the string "{1}", e.g. to execute an external script to play an alerting sound.
After execution by the "at" program, the message script will be automatically removed.

Cautionary remark: There is no provision to check the time given. This means that specifying a time before the current time may cause the message to appear on the following day at the time given, or never.


Impressum
© 2001 - Mail an den Autor & Betreiber: Sieghard.Schicktanz@SchS.de
Dr. Sieghard Schicktanz Telefon 08171-16402   °   Fax 08171-405909
Kreidestr. 12 E-Mail: Sieghard.Schicktanz@SchS.de
82547 Eurasburg Inhaber: Dr. Sieghard Schicktanz
(für Inhalte verlinkter Seiten kann ich natürlich keine Verantwortung übernehmen)