Monday, December 27, 2010

cunstomization Arch openbox details

Gui config tool (Preferences Openbox or terminal obconf): theme Madpablo


Appearance: Active Window title Sans (LDHandyHand) 13 inactive Sans (LdHand) 12; menu header Sans 12(NeutraText Demi)
Menu Item Droid Sans (NeutraText Demi) 12 On Screen Display Droid 12 (Street freehand) -- inbrackets alternative more Roaring Twenties like setup


lxappearance (menu Preferences, User Interface Settings):
Widget: MadPablo font Avenir LT STD 55 Roman (Neutra Text Demi 14)
Icon theme: Simple
Mouse Cursor : DMZ
use customized color scheme sometimes selected sometimes not

Thursday, December 23, 2010

create a javascript image slide show

Tired of bloated adlike flash pages; and using propriety software from Adobe?
Create you own online slideshow:
http://www.webpageaddons.com/webmastertool/java-script-slide-show.htm

Howto use ImageMagick -basics

To use IM with its inbuild GUI open the imagefile by going to the folder in terminal and type : display filename. The image will be shown Now left click on the image to see the graphical interface for IM Right click on the image for some simple commands like next, former , undo etc. Middle click magnifies a certain region of the pic.

Some nice IM commands here: http://www.linux.com/archive/feature/113978

Very elaborate documentation: http://www.imagemagick.org/Usage/

Monday, December 13, 2010

How to create a custom colour scheme on each webpage you want

What you need:
Firefox with the GreaseMonkey add-on installed.
So first get GreaseMonkey and install: https://addons.mozilla.org/en-US/firefox/addon/748/
After restarting Firefox go to http://userscripts.org./ or better go directly to
the High_Contrast script http://userscripts.org./scripts/show/2563

Now go to the folder in which your Greasemonkey scripts are stored.
In windows this will be something like:
Documents and Settings\user\application data\mozilla\firefox\profiles\+7565fgdgd.default\gm_scripts

In my Arch install it is in /home/paul/.mozilla/firefox/qqnkoj88.default/gm_scripts

Create a new folder, with a name fitting to your custom colour scheme. I choose yellow_red, well because these are the colours I want to use, bright yellow letters on a red background.
Copy the high_contrast.user.js in the high_contrast folder to your new folder yellow_red.
Now edit the js file with a simple text editor. In Windows you may have to change the file extension from .js to .txt to be able to do that. If you don't see the file extensions in Windows Explorer, you will have to change your folder options and unmark hide file extensions.

Now we gonna change this section

Pref("aggressive", false) ? global_css : alternative_css
// true means we go right ahead and apply our stylesheet.
// false means it's just an alternative you can select under "View: Page Style"
)([
'body, * {',
' background-color: ' + Pref('black_colorval', '#000') +' !important;',
' background-image: none !important;',
' color: ' + Pref('white_colorval', '#fff') +' !important;',
'}',
'a:link { color: ' + Pref('link_colorval', '#a0a0ff') +
' !important; text-decoration: underline !important; }',
'a:visited { color: ' + Pref('vlink_colorval', 'purple') +
' !important; }',
'a:active { color: ' + Pref('alink_colorval', 'red') +
' !important; }'
].join("\n"), Pref('stylesheet_name', "White-On-Black"));
}



to

Pref("aggressive", false) ? global_css : alternative_css
// true means we go right ahead and apply our stylesheet.
// false means it's just an alternative you can select under "View: Page Style"
)([
'body, * {',
' background-color: ' + Pref('red_colorval', '#FF0000') +' !important;',
' background-image: none !important;',
' color: ' + Pref('yellow_colorval', '#FFFF00') +' !important;',
'}',
'a:link { color: ' + Pref('link_colorval', '#a0a0ff') +
' !important; text-decoration: underline !important; }',
'a:visited { color: ' + Pref('vlink_colorval', 'purple') +
' !important; }',
'a:active { color: ' + Pref('alink_colorval', 'green') +
' !important; }'
].join("\n"), Pref('stylesheet_name', "Yellow-On-Red"));
}

What I have done is replaced black by red and white by yellow and also I also adapted the colour codes, where necessary, to what I wanted.
Where do you find these hexadecimal codes for colour?
For instance here: http://www.december.com/html/spec/color.html

Now we want the right name in the script.
Change in line 84
link.setAttribute("title", title || "WhiteOnBlack");
to
link.setAttribute("title", title || "YellowOnRed");

After you have changed the colours to your liking, change the name of the script itself to yellow_red.user.js

Now we have to take care greasemonkey can find the new script :
In gm_scripts you will find config.xml.
Again open this with a text editor and then first copy and than change a script section in this file; it starts with opening bracket script and finishes with forward slash script closing bracket.
Change the text between the brackets < >:
Script filename="high_contrast.user.js" name="High_Contrast" namespace="http://interglacial.com/" description="makes the background black and the text white, either in an alternate stylesheet you can select as needed, or immediately" enabled="true" basedir="high_contrast"

to
Script filename="yellow_red.user.js" name="Yellow_Red" namespace="http://interglacial.com/" description="makes the background red and the text yellow, either in an alternate stylesheet you can select as needed, or immediately" enabled="true" basedir="yellow_red"


Save and close.


Now activate the new script by restarting firefox and going to View, Pagestyle, select yellow_red.



New Colour scheme on every page or optional?
Default the high contrast script is set as a page option; that is each time you want a page to look like this you have to acitvate it in described manner.
You can change that and make it the default look for each webpage in your browser.

Open the config page in Firefox by puttingin the address bar: about:config

and filter on interglacial. Change in the first line with the tag agressive the boolean false to true by double clicking on it. There you can also modify the link or visited link colours.

Error Dbus in Arch

Got this error message:
File "/usr/share/wicd/gtk/wicd-client.py", line 63, in
from wicd import dbusmanager
File "/usr/lib/python2.7/site-packages/wicd/dbusmanager.py", line 93, in
DBUS_MANAGER = DBusManager()
File "/usr/lib/python2.7/site-packages/wicd/dbusmanager.py", line 57, in __init__
self._bus = dbus.SystemBus()
File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 202, in __new__
private=private)
File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 108, in __new__
bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 125, in __new__
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.FileNotFound: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory

Solution:
Edit as root /etc/rc.conf
especially the last daemon line
Make sure you DON'T have dbus in your daemons line if you have hal in it (this was my fault). I stopped dbus by putting an exclamation mark before it: !dbus
hal will start dbus as well. Also, make sure the wicd daemon is after the hal daemon.

see also: https://bbs.archlinux.org/viewtopic.php?id=50674
and https://wiki.archlinux.org/index.php/Wicd

Friday, December 3, 2010

Change default text editor to nano

The default text editor in Arch most probably is vim.
If you want to change that to nano, you will probably do that because the default actions are shown at the bottom of the nano page, so it is easier to use when you don't know the vim shortcuts.
The ^ sign stand for the CTRL key, btw; the M(eta) stands for the Alt key.

To change the default text editor you go to your .bashrc file in /home/user.
Make it visible with ctrl+h.
Then setting something like
export EDITOR=nano

in your .bashrc, or the file for the shell your using, might solve your problem.

/////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\
sorurce of concise nano howto :
http://www.gentoo.org/doc/en/nano-basics-guide.xml

Opening and creating files

Opening and creating files is simple in nano, simply type:

Code Listing 1.1: Creating or opening a file

# nano filename

Nano is a modeless editor so you can start typing immediately to insert text. If you are editing a configuration file like /etc/fstab use the -w switch, for example:

Code Listing 1.2: Disable the word wrapping

# nano -w /etc/fstab

Warning: It is very, very important that you use the -w switch when opening a config file. Failure to do so may keep your system from booting or cause other bad things.

Saving and exiting

If you want to save the changes you've made, press Ctrl+O. To exit nano, type Ctrl+X. If you ask nano to exit from a modified file, it will ask you if you want to save it. Just press N in case you don't, or Y in case you do. It will then ask you for a filename. Just type it in and press Enter.

If you accidentally confirmed that you want to save the file but you actually don't, you can always cancel by pressing Ctrl+C when you're prompted for a filename.

Cutting and pasting

To cut a single line, you use Ctrl+K (hold down Ctrl and then press K). The line disappears. To paste it, you simply move the cursor to where you want to paste it and punch Ctrl+U. The line reappears. To move multiple lines, simply cut them with several Ctrl+Ks in a row, then paste them with a single Ctrl+U. The whole paragraph appears wherever you want it.

If you need a little more fine-grained control, then you have to mark the text. Move the cursor to the beginning of the text you want to cut. Hit Ctrl+6 (or Alt+A). Now move your cursor to the end of the text you want to cut: the marked text gets highlighted. If you need to cancel your text marking, simply hit Ctrl+6 again. Press Ctrl+K to cut the marked text. Use Ctrl+U to paste it.

Searching for text

Searching for a string is easy as long as you think "WhereIs" instead of "Search". Simply hit Ctrl+W, type in your search string, and press Enter. To search for the same string again, hit Alt+W.

Note: In nano's help texts the Ctrl-key is represented by a caret (^), so Ctrl+W is shown as ^W, and so on. The Alt-key is represented by an M (from "Meta"), so Alt+W is shown as M-W.

Thursday, December 2, 2010

Man2html convert a man page to an html page

Install man2html
Find it in your repo or download and install from source.

Ma a page from man xdiskusage:

man xdiskusage | man2html -compress > xdiskusage.htm

The compress option converts more empty lines to one.
See documentation

Blog Archive