Pages

myRulerPyQt 1.0

myRulerPyQt 1.0


An on-screen pixel ruler for Linux, Windows and other platforms supported by Python 2.7 and Qt 4.

Download

Features

  • Customizable background, font, colors, opacity.
  • Cursor position indicator.
  • Marks values are copied to the clipboard.
  • Moving with the mouse and keyboard keys.

myRulerPyQt 1.0 will fit your desktop theme perfectly.

About

I needed a pixel ruler to make columns in OpenOffice Calc perfectly equal on my Lubuntu Utopic Unicorn 14.10 running on a USB stick. There were some options available to chose from. KDE KRuler tried to pull 40 Mb dependencies and Gnome ScreenRuler 60. That was not what I needed. One guy on the Ubuntu forum suggested NRuler written in Java. It would have been OK if it had been transparent but it was not. I didn't want that either. Besides, NRuler didn't behave they way I liked.That's why I create my own ruler that satisfies my tastes.


Installation


Download

myRulerPyQt 1.0 doesn't need an installation. Just unpack it, change directory and run one of the files rulerH.py or rulerV.py. There are two rulers actually: one horizontal and the other is vertical. You can switch between them.

$ python rulerH.py
$ python rulerV.py


myRulerPyQt 1.0 should start right away. If not,install some required packages.

 

Debian / Ubuntu

 

apt-get install python2.7 python-qt4

 

ArchLinux

 

On ArchLinux default Python 3 is incompatible with Python 2 scripts but Python 2.7 is also installed. It's executable is /usr/bin/python2.7.

sudo pacman -S python2-pyqt4

Open files rulerH.py and rulerV.py in a text editor and change Lines 1 and 9 to look like this:

Change from:

1. #!/usr/bin/python to #!/usr/bin/python2.7
9. python='python' 
to python='/usr/bin/python2.7'

Path to the executable is required for launching horizontal or vertical modules from the context menu. myRulerPyQt 1.0 assumes that python is in the system path. If you compiled Python yourself or put it in a different location or have a different name for its executable, make sure myRulerPyQt 1.0 will be able to find it.

 

Windows XP

 

On a 32-bit Windows you will need Python 2.7, Qt4, PyQt4. The easiest way to get everything is to install WinPython that bundles all software in one package.

Download WinPython-32bit-2.7.6.4.exe from here, double-click it to unpack and move to a preferable location. Then run WinPython Control Panel.exe and register the installation. Go to the menu Advanced and click register installation.

Make sure that System Path is OK.
Right-click My Computer, and then click Properties.
Click the Advanced tab.
Click Environment variables.
In System variables scroll down to Path and press Edit.

WinPython's path should look like this:

C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6;C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6\DLLs;C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6\LIB;C:\WINPYTHON-32BIT-2.7.6.4\PYTHON-2.7.6\LIB\LIB-TK

Reboot.

 

Usage

 

Left Mouse Click - put a mark.
Right Mouse Click - remove a mark.
Middle Mouse Click - (also Del key) - remove all marks.

Marks values are visible in terminal.

C key - copy marks values to the clipboard
Q key - quit
H / V keys - launch Horizontal /Vertical ruler
Settings is where you make your customization.
Opacity is turned on/off by the button with a glass icon on it.

Moving

myRulerPyQt 1.0 can be dragged around the screen wile holding the Label indicating the current mouse position or with Alt-LMB on Linux, and also with keyboard. One key press will move the ruler one pixel up,down, left or right.

U key - up
D key - down
L key - left
R key - right

Arrow keys are occupied with the slider that expands or contracts the ruler. If you pressed an arrow key and nothing happened, click on the slider to activate it.

Clicking on the Label with the right mouse button will bring a Context Menu. Settings is where you can change colors, opacity and font. Sometimes it's tricky to pick the right color. If you have difficulties with that, try my color picker.

On Linux make sure a composite manager is running to enable transparency.

For example, on LXDE:

$ sudo apt-get install xcompmgr
$ xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55 &


That's basically it. I think I removed all the bugs but you never know. If you encountered one let me know with the description of the steps you did. Thank you for your time and consideration.


GNU General Public License
Copyright © 2014