Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, 10 September 2013

XML Tree Editor version 0.1.0.23

The last version of tree view XML editor features drag and drop for Replicate / Move node operations and some minor improvements.

As usually installation files for Windows and Ubuntu can be found SourceForge.Net along with the source code.


Tuesday, 5 March 2013

XML Tree Editor ver 0.1.0.15 released

Last week I released the latest version of XML Tree Editor - a tool for creating/editing XML files represented as tree views.






New version features some bug fixes as well as improved usability and simplicity. Full release notes can be found on the project download page.

Installation packages are provided for Windows XP/7/8 and Ubuntu/Debian Linux. There is also source code avaialble for download along with two Pascal units for developers. The units provide support for XML configuration files in Delphi (uXMLConfig.pas) and Lazarus/Free Pascal (xmlfile.pas) applications. They are pretty much similar to well-known INI files with much richer functionality. The project is licensed under terms of GPL 2.0 or higher license.

Project page at SourceForge.net is http://sourceforge.net/projects/xmltreeeditor

Thursday, 31 January 2013

XML Tree Editor

I published a new small project recently called XML Tree Editor. It's an utility, which represents an XML file in a treeview and allows creating and editing it in this mode, without dealing with XML syntax.
The screenshot below shows the main screen with the tree view and preview pane at the bottom, Edit node window and multi-line editor on the foreground.


The list of commands includes Add Child Node (as reference to the selected node on the tree), Add Above and Add Below, Add Comment, Edit Node (which applies to both XML tags and comments) and Delete Node. There is also commands to move node with all its child nodes to a new position and to replicate (clone) nodes.

The second XML file can be opened in read-only mode in the separate window at the same time; it's called Reference File. The whole node (with all its children) can be copied from this file into main editable XML document.

This is an open source free software, hosted at SourceForge.net. The application is developed in Lazarus Free Pascal, the source codes are available for download along with installation packages for Windows and Linux (GTK2+).

Starting a new project at work I became the active user of XML Tree Editor myself. So I discovered some areas of improvement. The proposed changes in the emerging new version 0.1.0.15, apart from minor bug fixes, will include:
  • show all parents of the selected node mode
  • options window
  • keyboard shortcuts for all actions
XML Tree Editor available for download from here.


Tuesday, 24 March 2009

EEE PC as Photo Frame - Slideshow selection dialogue

After your slide show is up and running you may want to add some improvements - the ability to create as many slideshows as you like and choose one as you clicked on the icon.



To make this possible our slideshow script should be able to:
  1. find slideshows located under some base folder
  2. display the list where we can choose one from
  3. pass our choice to the viewer program (qiv)
The resulting script is shown below:

#!/bin/sh
ssPath="/home/user/MMC-SD/partition1/DCIM/"
cd $ssPath
ssList=$(ls -dx *)
ssFolder=$(zenity --list --title="Choose Slideshow" --column="Folder" $ssList)
if [ -n "$ssFolder" ] ; then
xset s off -dpms
# mpg321 --random --quiet /home/user/MMC-SD/partition1/MISC/audio/*.mp3 &
qiv -sfmir -d 8 $ssPath$ssFolder/*
# killall mpg321
xset s on +dpms
fi
As you may have noticed I commented the commands related to background music.

To implement new features, mentioned above, I introduced three variables:
  • ssPath - my base folder, each its sub-folder is a slideshow (you must change its value to your actual location)
  • ssList - the list of all found slideshows
  • ssFolder - what I chose from ssList
Look at the picture below.



It shows a file manager, which displays my directory tree. The address bar shows my base folder - "/home/user/MMC-SD/partition1/DCIM/", this value is directly assigned to ssPath.
ssPath="/home/user/MMC-SD/partition1/DCIM/"
The folder DCIM contains only sub-folders, every one of them is a separate slideshow. The command
ls -dx *
lists them in a single row, and this is assigned to ssList:
ssList=$(ls -dx *)

Then I use the command zenity which displays a nice dialog, as shown on the first picture. The result (my choice) is assigned to ssFolder:
ssFolder=$(zenity --list --title="Choose Slideshow" --column="Folder" $ssList)
Zenity was installed on my computer by default, so I think it should be same on yours.

The next step is to make sure ssFolder is not empty, so the rest of the script is executed if the below command returned TRUE:
if [ -n "$ssFolder" ] ; then
The rest is pretty much similar to what I explained in the previous post. The only difference is this command:
qiv -sfmir -d 8 $ssPath$ssFolder/*
qiv should play all files in my selected folder ($ssFolder), attached to the full path (the base folder ssPath). You should avoid having non-image files in that folder, or you may try -n option, which tells qiv to filter files by their magic numbers instead of extensions.

Enjoy!

Friday, 20 February 2009

EEE PC as Photo Frame - adding music

It would be nice to add some background music while watching a slideshow (see my previous post about making a slideshow script). After playing with that script I ended up with the following version:
#!/bin/sh

xset s off -dpms
mpg321 --random --quiet /path/to/music/files/*.mp3 &
qiv -sfmir -d 8 /path/to/picture/files/*.JPG
killall mpg321
xset s on +dpms
You should obviously replace "/path/to/music/files/" and "/path/to/picture/files/" to your actual locations.

Below is the short explanation of the changes.
I noticed that after 20 minutes the screen went blank, although screen-saver feature was disabled. The command
xset q
revealed, that DPMS (Display Power Management Signaling) feature was enabled, so I changed the first command in the script as follows:
xset s off -dpms
to switch DPMS totally off. The last command re-enables this feature.

Using my Package Finder tool I found that my EEE PC had pre-installed command-line audio player, called mpg321. It appeared that this program was quite suitable for our purposes.
mpg321 --random --quiet /path/to/music/files/*.mp3 &
The above command launches mpg321 player and tells it to play all mp3 files in the given folder in random order; the --quiet option supresses unnecessary text output. The "&" at the end tells the OS not to wait for the player finished its work, but go to the next line of the script.

When we terminated qiv, playing the slideshow, we also have to stop music. The command
killall mpg321
does the trick.

That's all.

Sunday, 15 February 2009

Asus EEE PC 701 as Digital Photo Frame



Its quite easy to turn your EEE PC into digital photo frame. To make this possible one needs two things.
Firstly a program, which would present the photos in a full-screen slideshow mode.
Secondly the screen saver (or rather power saver) feature should be temporarily disabled, to avoid getting black screen after 5 mins of inactivity. Obviously the laptop must be powered from the mains.

After some googling I found the program, which I think fits quite well for slideshow. It's called qiv, Quick Image Viewer. Because EEE PC has a lot of software pre-installed, it worth to see, if this program is already on your computer or not.

1. Open the terminal (Ctrl+Alt+T) and type:
qiv --help
If you see a lot of output with explanations of possible options and available keys, you can skip the next step, otherwise you have to install it.

2. Type in the terminal:
sudo apt-get install qiv
The above command (apt-get) installs the mentioned package (qiv) into your computer, and requires administrative rights to perform this task (sudo).
If the above does not work, see this tutorial about Adding Additional Software Repositories
.
Unfortunately I am not sure what repository qiv came from.
Note: If you are in doubt what any terminal command is intended to, say "sudo" as above, type "man sudo", which will show manual pages for the given command; to scroll down use Space key, to terminate the manual press Ctrl+Z. Other possible ways are to type the command with -h or --help options, or find its description in the Internet with Google.

3. Put the pictures, you want to present, in a single folder. You may also wish to scale them down, to save some disk space. In my case the photos were exported (with scaling down to 800 pixels) from Picasa to
/home/user/MMC-SD/partition1/DCIM/Starred-Photos/
As you may guess the above string points to the folder, located on the 1GB SD card, which was earlier used with my digital camera. Now this card is an extra storage for EEE PC.

4. Again, in the terminal type the following (change my folder to the path to your picture location, and keep in mind that Linux commands are case-sensitive):
qiv -sfmir -d 8 /home/user/MMC-SD/partition1/DCIM/Starred-Photos/*.JPG
and see, what is going on. Ideally you should get your slideshow working. To terminate it, press ESC . If the above command does not work, first type "qiv --help", to be sure qiv is really installed, then check carefully your path to pictures.
Brief explanation the above command:
  • qiv - calls Quick Image Viewer
  • -sfmir - is actually five options; -s is for slideshow; -f is for full-screen mode; -m is for preserving images aspect ratio and zooming; -i is to disable status bar, and -r is for random order
  • -d 8 - means 8 secs delay between images; you may want to change this value
While watching the slideshow, you can use the following keys:
  • space - to get the next picture
  • esc - to terminate the slideshow
  • s - to pause/continue slideshow.
If you do nothing, the screen should go black after 5 minutes, and this is the next problem to solve.

There is no running screen-saver on EEE PC by default, but there are some low-level power saving options. One of them is an option in xorg.conf file, which tells to set the screen black, if there were no keyboard/mouse activity for 5 mins. To avoid this type the following command:
xset s off
and check you can watch your slideshow endlessly. If all the above works, we should now put it all together.

5. Open a text editor, to do it type in the terminal:
kate
6. Enter the following set of commands:
#!/bin/sh
xset s off
qiv -sfmir -d 8 /path/to/your/pictires/*.JPG
xset s on
In the above sample change the third line with your command from step 4. First line says it is the script, second switches blank screen off, third is actually your slideshow and last restores power saving settings.

7. Click File -> Save As.. and save this file as "slideshow.sh" (without quotes).

8. Close the text editor

9. Type in the terminal:
sudo chmod +x slideshow.sh

The above command makes your "slideshow.sh" file executable.

10. Type:
./slideshow.sh

and check that everything works.

11. Type:
sudo mv slideshow.sh /usr/local/bin/
This command moves your file from your home folder to a system folder for executable files, (not supplied by the OS vendor).

12. Type:
cd /usr/local/bin

This will change your current active folder and then type:
sudo chmod +x slideshow.sh
to make the file executable again.

13. Using Launcher Tools create a new launcher in your favourite folder, like shown in the picture:



That's all!

Enjoy, but avoid using it when the computer is on battery.

TODO: Add some music.

Wednesday, 27 February 2008

Gnome Debian Package Finder

Gnome Package Finder is my first project in Lazarus released to the public. It is also my first published program for Ubuntu Linux or other distributions, using Debian packages.

Unlike Synaptic Package Manager, which is the main tool in Ubuntu to deal with installed and avaialble from repositories (Software Sources) packages, Gnome Package Finder only provides information about packages, it can neither install nor remove the package, and because of this, it does not require administative rights to work. It also works about twice faster for the same search.

Gnome Package Manager allows to search through package names, their short or long descriptions for the given model. The matching packages are shown in the list, which indicates also the state of the installed packages. Another possibility is to search for a file name inside the packages. This search takes much longer and the output contains package names and the full path to the matching files, in case they were installed.

When one got the list of packages, for every one in the list common information about the package can be obtained, along with its dependencies and the list of files, this package would install.



Keyboard shortcuts provide an easy way to navigate and perform all operations without involving the mouse. The help system covers most of what you may want to know about Gnome Package Finder.

The installation binary package as well as the source files can be downloaded from:
http://www.gtk-apps.org/.

It is released under the terms of Gnu General Public Licence (GPL).

Monday, 9 July 2007

uHuman-soft Metacity theme

This is my first Linux project. I like default Ubuntu theme called Human, but always thought it would be even nicer if I were able to choose my own colours. So after learning about creating metacity and GTK themes I started to play with the theme called "ish" by bvc (http://www.guistyles.com/gnome-styles/). Then I compared my results with the default Ubuntu theme and found that the latest takes three times less to be rendered. So I abandoned it and began modifications of Human. The main differences are:
1. customizable colours
2. minimize, maximize and close icons
3. another way of painting window titles
Here is the screenshot:



The default colour is soft green, but you can change it to anything you like by selecting the "Selected Item" colour in the Themes Customization menu (System - Preferences - Theme - Customize - Colors)
Credits: bvc - close, minimize, maximize and unmaximize icons;
Daniel Borgmann, Billy Cantrell, Richard Stellingwerff - original Human theme files.

Download from here.

How to install a Desktop theme.