Linux tweaks, applications, and other gimmicks.

drag

Elite Member
Jul 4, 2002
8,708
0
0
I'll start.

First off most people using Ubuntu or Debian are probably going to use Gnome. By default Gnome's Window manager (called Metacity) is rather limited.

Metacity is designed specificly to be crack-free. This means that while most Window managers are laden down with odd configurations and obscure or over-built functionality that make them difficult to use. Metacity is designed to be your mom's window manager. Do basic, predictable things and do them well.. which is much more difficult then it seems.

For more information check out /usr/share/doc/metacity/README.gz

It's a response to the lisp-based Sawmill window manager from Gnome 1.x. It had a very complex configuration and often one option would break a whole string of other functionality in unpredictable manners.

Metacity frequently gets critized for being rather weak for a lot of people's uses. It misses a lot of stuff that people are used to in other window managers.

So there are two approaches to fixing this.. Both are very effective thanks to the EWMH standards that many (not all) Window managers support.


----first method is to replace Metacity----

The common fix is to replace Metacity altogether. There are several other WMs that support EWMH.

A common modern replacement is Compiz or Beryl due to their OpenGL goodness.

One that I like is OpenBox. It's a rewrite of a fork from the original blackbox window manager (and it's fork Fluxbox), which is favored by many advanced users. http://icculus.org/openbox/index.php/Main_Page

To replace Metacity there are several ways. The first way is to use the --replace option that many WM support.

You hit alt-f2 to open the run dialog, then type 'openbox --replace'. Then you close out all your applications and log out. When you log out be sure to check 'save current session'. Then when you log back in openbox (or whatever) will be running by default.

Beryl has a switching applet that you can use to choose your Window manager...

Also if you go and edit the ~/.gnome2/session file your can replace 'metacity' with openbox (or whatever) and it will be replaced when you logout and log back in. Also you can do other fun things with that file.


----The second method is to extend Metacity-----

As stated above Metacity supports the EWMH standard.

And because of this you can use various applications to extend it's functionality. Most of them are aviable in UBuntu by enabling the universe repository.

Also as a bonus if you do end up replacing Metacity then these things will extend to support other EWMH-compliant WMs, although they may make functionality redundant.


wmctrl --- Window manager control.
http://www.sweb.cz/tripie/utils/wmctrl/

With wmctrl you have command-line access to your window manager. This makes it easy to script window manager behavior with simple bash scirpts. Then you can take those scripts and bind them to keys or launch them from icons on your desktop or taskbar.

You can do things like resize windows. Move them to different workspaces. Rename Windows. Maximize, hide, close, whatever you want.

For example I use a script to local my text editor on any desktop and bring it forward on the current desktop. Then I have another script that I use to 'banish' windows to the last workspace. That way if a Window is in my way and I want to get rid of it without closing out my application I can send it away with a simple key press.

Also if you look towards the bottom of that homepage you can find links to other doo-dads.



Brightside --- do usefull things with the edge and corners of your screen.
http://wiki.catmur.co.uk/Brightside/

This thing can add 'edge flipping' to the gnome desktop. This means that with brightsides you can grab a Window (either by the window bar or by hitting alt and clicking anywere on the window) and drag it to different workspaces.

It's configurable and you can disable it.

Also you can add commands or actions that are activated when you move the mouse to corners.


devilspie -- Devil's Pie, window management for the terminal control freak.
http://burtonini.com/blog/computers/devilspie

Devilspie privides a advanced window management scripting system based on lisp.

For example... Want to open up Gimp, but have the window decorations removed from the tool, have that window (and only that window) with sloppy focus, and line up all your editing windows to be 'fullscreen' to take up all the aviable space not used by your dialogs and toolbar? Want that to happen automaticly every time you open up gimp?

Well you can do that easily with devilspie. All sorts of stuff is possible with it. It's far beyond what most people will ever need out of a window manager/window manager add-on.
 

silverpig

Lifer
Jul 29, 2001
27,703
12
81
I like customizing my prompt:

BBLUE="\[\033[34;40m\]"
YELLOW="\[\033[33m\]"
CYAN="\[\033[36m\]"
N="\[\033[0m\]"
B="\[\033[1m\]"
export PS1="$B$BBLUE[$N$YELLOW\\u$B$BBLUE]$N$B:$N$CYAN\\w$N\\$ $N"


edit: I have this as my default user's prompt, and I also have a similar one, but where the username is red for when I'm operating as root. I guess I don't use that anymore as I'm in ubuntu and things are taken care of via sudo, but it's neat to have nonetheless.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ya. prompt customizations are kinda neat and usefull if you use the command line all the time. Here is what I have pasted to the end of my ~/.bashrc

case ${HOSTNAME} in
spock )
COLORD=31 ;;
cracker )
COLORD=32 ;;
tweety )
COLORD=33 ;;
donkey )
COLORD=34 ;;
webber )
COLORD=35 ;;
* )
COLORD=0
esac

PS1='\n\[\033[0;32m\]$(date +%T) \[\033[34m\]\u\[\033[0m\]@\[\033[1;${COLORD}m\]\h\[\033[0m\]:\[\033[0;35m\]$(pw
) \[\033[0m\]\n$ '


What that does is depending on the hostname of the computer I am using it will color the hostname in the prompt a different color. That way it makes it harder to mess up which computer I am on. Of course I need to have this on the bashrc file on all those computers.

Most of those are VMs, btw. :)

http://tldp.org/HOWTO/Bash-Prompt-HOWTO/


Also if your using Debian, and I think Ubuntu, you can look into the default ~/.bashrc file and there are sometimes tweaks commented out. If you deleted it then you can find the original in /etc/skel directory.

One that I enable is bash completion:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi

Then there are a few packages that extra autocompletion packages that extend it further. They are essentially just bash scripts that are ran when you hit 'tab-tab' button.
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
adding this to favorites.....ive been wanting to tweak some things and never got around to looking into how

<--- lazy
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Alright how about this one.


With Linux it's easy to keep the same files and settings while continiously upgrade and reinstall your OS. If your using a distribution that supports upgrades (aka Debian) then it's pretty easy to keep a single install going for several years.


To make this work generally you will make a seperate partition for your /home directory. This sort of thing is supported during install time. You will probably want to reserve 30-40 gigs for / directory, give 2 or so gigs for swap partition, and then give the rest for your /home directory. This is for a desktop setup, for a server setup you'd want something entirely else.



As you can imagine it's pretty easy to get a lot of 'cruft' going. You may run into bugs with newer versions of applications using conflicting or obsoleted settings from older programs. Sometimes older settings may disable newer features in some programs. And usually you'll end up with lots of stuff you'll only use once or twice and those settings get saved, but you may uninstall or otherwise get rid of a program.


With Ubuntu or Debian it's pretty easy to take care of the system-wide stuff.

This page does a much better job explaining it then I can do here:
http://www.ubuntugeek.com/cleaning-up-all-unnecessary-junk-files-in-ubuntu.html

Keep in mind that it's generally not worth it to go overboard. If there are junk floating around your harddrive then you can usually safely ignore it as long as it's not running. The only exception is 'setuid root' programs that have their permissions setup to run as if the user running them are granted root privilages. Thsi can be a security risk, but thankfully generally Linux distributions go through great pains to reduce those things down to the bare minimum.


Now that takes care of system-wide stuff.


However for user settings this is something different. For user application preferences they are all stored in .filename and .directoryname files and directories in your home directory. ~/ is short for '/home/<username>'.

The . before the files make them 'hidden' so that if you do a regular 'ls' or look at the directory in nautilus or whatever they won't show up. This is for convience only since most of the time your not going to mess around with them.


For this to work you need to do two things:

The first, and most important is to backup all your important information. Any passwords, email, bookmarks, and such things.


Then the second half is that you need to be logged out of X and then logged back in on the virtual console. You need to make sure that no programs are running for that user other then that bash shell.

This is because if you clean up your user's preferences and you have programs like 'gconfd' running gconfd will not notice this and then write out all your old gnome settings all over again, thus defeating the purpose of this excersize.


So after you backup'd everything important to you then log out.

Swich to the virtual console by going ctrl-alt-F2, note that sometimes video drivers have problems with this...

After switching to virtual console then log in at the command line prompt.

Use this odd command to see what programs this user has running. Note that this command is very specific to the GNU version of ps, it probably won't work on other non-GNU-using systems.

> ps -au $USER -o pid,command | less

This will give you a list of running proccesses. If you just logged out then it can take a little bit for everything to clean up and shutdown, so you may want to give it a bit.

After a while then run this command to clean up everything:
> kill $(ps h -au $USER -o pid)

And that should kill everything. (possibly including your current session).

Go ahead and log back in and then check it again with:
> ps -au $USER -o pid,command

If there is still stuff running (other then your current session) then run:
> kill -9 $(ps h -au $USER -o pid)

You may have to do that a couple times. After that then everything should be shutdowned or zombied. If they are zombied then they are safely ignored.

Also note that this command is dangerous if ran as root.

The easier version of this is instead of doing all the 'ps' junk you can just reboot the computer and log into the prompt instead of the GUI. (but why reboot when you don't have to?)



So after making sure everything is completely dead then you will want to make a backup directory for your preferences then move them out of the way. Like such:

> mkdir ~/prefBackup
> mv ~/.??* ~/prefBakup/

The .??* is a combination of wild cards. Remember you have the special . and .. files these symbolize the 'current' directory with the . and the parent directory with ..

So to see how they work you can go:
> pwd
> cd .
> pwd
> cd ..
> pwd

The .??* avoids those special files by having the ? wildcard. Basicly it's saying
"any file or directory with a . at the beginning and at least 2 characters"



So that command moves all your preferences and such to prefBackup directory.

Notice that this is 'mv' instead of 'rm'. This is so you don't loose any information. If anything important you forgot was in those files then you can recover them. If in a couple months you never needed anything there then you can delete the prefBackup directory safely.

Undoubtedly you'll probably want to keep some the settings. To easily copy things back on the command line you can use a program called midnight commander. It's very clever. To launch it you simply type 'mc' from the command line (after installing it)


It's a special type of file management application called a 'orthodox file manager' or a 'dual plane file manager'. These things have fallen out of favor to the Windows-style browser file manager, but they are very fast and are perfect for power users that want nice tools for managing files other then a bash shell.

Once you open up midnight commander then you'll see two directory listings at the top, a bash prompt towards the bottom and then a line of stuff at the bottom like 1Help 2Menu 3View. Those things at the very bottom coorispond to F# buttons.

So you start it up.
> cd ~/
> mc

then type this command:
> cd ~/prefBackup

Now one plane will been in ~/prefBackup and the other still in ~/

You should be able to see all the .files and .directories.

To copy them back over to restore the preferences then simply use the f5 button. Use the up and down arrows to scroll up and down to select the various files.

You'll see quite quickly how powerfull this thing can be.


Once you get everything setup how you like it then all you have to do is now log back into through the GUI and it will be just like when you first installed the OS, plus any upgrades.


 

drag

Elite Member
Jul 4, 2002
8,708
0
0
How about:

Performance/system monitoring and desktop applets.




First off is system monitoring. There are lots of different ways to monitor the performance of your system.


Things you are probably are going to be interested in are things like cpu usage, memory usage, harddrive usage, and other such things.


First off you have grandaddy command line applications and files.


To see your proccessor features and speed:
> cat /proc/cpuinfo

You'll get each proccessor listed and if you have hyper threading then you can have 2 listings for each core. You'll be shown current cpu speed, the cpu type, the bogomips rating (a VERY informal benchmark for relative performance), and see what extensions your cpu supports.

To see some bogomips statistics you can check out:
http://www.hobby.nl/~clifton/index.html?bogomips.html
It's just a fun thing and very innaccurate.


For memory statistics:
Simple...
> free

You'll get a list like this:
total used free shared buffers cached
Mem: 1020820 1005984 14836 0 23968 593976
-/+ buffers/cache: 388040 632780
Swap: 1951888 2196 1949692

(minus the anandtech mangling)

The first line shows what each column represents.
The second line shows one view of memory statistics, the third line shows what they look like minus buffers and cache and the last is what is the usage of your swap.

Buffers and cache are simply bits of used memory used to increase the performance of your system. Buffers are application buffers used to store trivial information and the cache is file system cache.

Using buffers and cache will help speed up your system by avoiding having to go to the disk to grab information. The more time that your cpu can spend proccessing information versus waiting on information to proccess the higher overal performance you'll system will have.

But the nice thing about it is that it's only going to store buffer/cache if there is no need for that memory otherwise. As your memory requirements go up the size of the buffers/cache go down.

Remember unused memory is wasted memory.

Also you can use free with various switches.. to see your memory in megs then you just go:
> free -m
total used free shared buffers cached
Mem: 996 982 14 0 24 580
-/+ buffers/cache: 378 618
Swap: 1906 2 1903

This is my current system. I have 996 megs of RAM aviable (some gets reserved for my shared memory video card and other such low-level stuff).

I only have 14 megs of 'wasted' memory, which is good. With 982 megs of 'used' memory.

Minus buffers/cache I have 378 megs used for system and application data, which isn't so hot. It's not bad though considuring that I have some memory hogs like Beagled desktop search running.


What you have to watch out for is when you start using Swap heavily. This means that your system is running out of physical ram and it will have a very heavy performance penalty.

If you run out of main memory + swap then the kernel will releases the OOM Killer. The OOM Killer is a last ditch attempt to save your system from memory starvation, which will lock your system up hard. It will use educated guesses to try to kill the memory hogs in your system preventing you from crashing the entire system. Needless to say this is not healthy behavior and can cause loss of data if your doing something like writing a long paper in openoffice.org




For complex showing of memory you can go;
> cat /proc/meminfo

But I don't quite understand what all that means.




If you want to keep your eyes on these commands and files you can use the watch command.


Like such:
> watch free -m

Then it will execute the 'free -m' command every couple seconds and display the results.




Advanced command line system monitors:

top --- active system monitor.

It keeps track of various statistics on your system and peformance. It's configurable and depending on what Linux system your using you can run different things.
http://img358.imageshack.us/my.php?image=screenshotterminalbq7.png

Not a whole lot going on in my system right now. You can sort by user, memory usage, cpu usage. You can kill runaway proccesses and all sorts of usefull stuff.


htop -- a better top
http://img47.imageshack.us/my.php?image=screenshotterminal1mn1.png

It has a interface similar to midnight-commander. It's more intellegent and dramaticly easier to use then regular old top.

This is sorted by memory usage. Lots of stuff, eh?




Gnome-system-monitor --- default GUI monitor for the Gnome desktop.
http://img382.imageshack.us/my.php?image=gnomesystemmonitorpk4.jpg

It's nice and friendly to use. Has a applet you can configure to show cpu and memory usage.



Gkrellm -- classic eye candy system monitor
http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html

It has lots of different plugins and extensions for doing many different things. Tracking system usage, checking mail, xmms front end, hardware sensor support, and all sorts of small stuff like that.

One of the cool features for it is that you can have a deamon running that allows other machines to display their statistics. That way you can have many machines and have a gkrellm open for each one on your main desktop.



Gdesklets -- little pretty background applets for various things
http://www.gdesklets.org/?q=desklet/browse

Weather applets, tickets, cpu monitoring, hardware, calendering, rss feeds. Whatever you can think of. I think they tend to be rather resource intensive.


aDesklets -- same as above, but lighter.
http://adesklets.sourceforge.net/screenshots.html


SuperKaramba -- desklets for KDE.
http://en.wikipedia.org/wiki/SuperKaramba\

I think these tend to be the neatest.


Conky -- very lightweight and out-of-the-way monitoring.
http://img357.imageshack.us/my.php?image=conkyez7.jpg

This is my favorite. It's _very_ lightweight, very fast. The only gotcha is that I noticed that the examples on conky's website use name look-up for active connections and this can prevent it from operating smoothly as it may take to long to get a response.

Uses a odd configuration file that takes a bit to get used to.
http://conky.sourceforge.net/


Dockapps -- WindowMaker-based dockapps
http://dockapps.org/

Usefull on more then just Window maker.



So there are lots of neat little things you can add to your desktop to spice it up and allow you to keep better track of hardware sensors, memory, cpu usage and such things.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0

A word on memory usage.


When you look at something like Gnome-system-preferences you'll see in the configuration/preferences menus the ability to add lots of different feilds to the listing of applications.

Some of them are labled like 'Resident memory' and 'virtual memory' and 'shared memory'.

As you may or may not know 'Virtual Memory' is something that makes modern multiuser, multiproccess computers possible. It's not 'swap' or anything like that. It means that applications are given their own address space that is then mapped to real memory addresses. So to applications it appears that they have 'real' memory addresses, while in reality the OS is free to remap those addresses to any parts of memory it wants and can swap out memory as it's needed.

So 'Virtual Memory' statistic in gnome-system-monitor is how much virtual memory that is mapped to that specific application.

However this gets confusing because in Linux (and other modern OSes) your using things called shared libraries and file system cache. Shared libraries in Linux are stored in directories like /usr/lib/ or /lib and have file names like 'libpng.so' or 'libGL.so.1.2'.

So if you have two applications that are using the same GTK libraries to have their widgets, text handling and such then it makes sense to only have one copy of GTK running in memory and then map it twice in virtual memory. One time for each application.

So that is why we have the 'Resident Memory' statistic. Resident memory is memory that is only used by that application and nothing else.

So say you have two GTK applications running.. say Epiphany browser and Nautilus file manager. They both tend to use lots of ram so the 'Virtual Memory' for nautilus may be 70 megs and for Epiphany 100.

But if you look at the 'Resident Memory' you'll see that Nautilus is using 23 megs and Epiphany is only using 53.

So although one application is using 70 megs, and the other application is using 100 megs, together they are only using 123 megs.



This is why even if you use something like XFCE, which is designed for low memory usage, instead of using Gnome you can sometimes actually end up using MORE memory in XFCE then in Gnome simply because less stuff is shared between all your applications.

Same thing with KDE vs XFCE vs Gnome or even when you bring in lightweight desktops like Fluxbox and such.

(that's not to say that Gnome isn't bloated.. because it is. Some of it is bad programming, but a lot of it is just because it has a lot of functionality.)

 

trmiv

Lifer
Oct 10, 1999
14,670
18
81
The best Ubuntu tweak I've found is this one which greatly improves font rendering.

But, I'm using PCLinuxOS now, which is great, but I can't seem to get my font rendering as nice as I had it in Ubuntu. Kind of makes me want to switch back to Ubuntu (that and the huge Ubuntu community). But otherwise I love PCLinuxOS and I think it's going to rival Ubuntu eventually, so I may just stick with it. (Rival in popularity and community support, I think PCLOS is a better distro already in a lot of ways, but Ubuntu still beats it in others)
 

hasu

Senior member
Apr 5, 2001
993
10
81
Linux Firefox defaults proportional font to Serif. Web sites look much better with "Sans Serif" fonts.

Main menu Edit -> Preferences -> Contents -> Fonts & Colors (group box) -> Advanced (button) -> Now change "Proportional" from "Serif" to "Sans Serif"
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Deja Vu fonts are improved Bitstream fonts.

They are pretty nice.

http://dejavu.sourceforge.net/wiki/index.php/Main_Page

I like their stuff and use their Sans Serif for lots of stuff. I like their Sans Serif Mono for my terminal font.

If you don't have a package for these fonts from your distro you can copy the *.ttf files to your ~/.fonts directory (make it if it doesn't exist) or (usually) /usr/share/fonts for system-wide installation. There is nothing you have to do beyond that and applications can start using them automaticly (after you change your defaults using gnome-font-properties or whatever).

The same thing is true for any other true type font.

You can get some unique fonts from http://www.dustismo.com/site/fonts.html that I like also.
 

trmiv

Lifer
Oct 10, 1999
14,670
18
81
I've tried Windows fonts the Liberation fonts released by Red Hat, and the Deja Vu fonts. While they look much much better than out of the box, it's still not what I like. With AA turned on the fonts are super clear, but with a blurry edge. Its the blurry edge that drives me nuts. Without AA they look too horrible for words. I've tried every guide out there for fonts, I can't replicate ClearType look I was used to in Windows. Oh well, I don't want to hijak this thread with my font problems
 

hasu

Senior member
Apr 5, 2001
993
10
81
Originally posted by: trmiv
I've tried Windows fonts the Liberation fonts released by Red Hat, and the Deja Vu fonts. While they look much much better than out of the box, it's still not what I like. With AA turned on the fonts are super clear, but with a blurry edge. Its the blurry edge that drives me nuts. Without AA they look too horrible for words. I've tried every guide out there for fonts, I can't replicate ClearType look I was used to in Windows. Oh well, I don't want to hijak this thread with my font problems
Linux font rendering is more like OS-X than ClearType, I guess. SimplyMEPIS 6.5 right out of the box gives excellent fonts and font rendering on an LCD monitor.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0

Well if your using Gnome then it's easy to configure stuff with gnome-font-properties. There are additional configuration files of various types for fonts, but I never realy bothered to figure those out.

One thing to make fonts clearer in Linux is to match what your OS's DPI settings with the real DPI of your display. I suppose this is important for LCDs since it would be nice that the pixels used for your fonts actually end up matching your pixels in your lcd display.

DPI is 'dots per inch'. So higher resolution displays on same sized monitors will have higher DPIs (vs low resolution on the same display size) and same resolution on smaller displays (vs same resolutions on larger displays) will have higher DPIs.

The 'standard' is 96dpi, which is a 'standard' because that is what Microsoft uses for Windows XP. With Windows Vista it's adjustable for the first time, but the trouble is that Window's applications are designed with 96dpi in mind and can be goober'd on other settings.

Also your DPI settings will affect more then fonts. Icon size, the size of your window bar, and other such things will be affected. You can increase the usability of your system quite a bit with setting the correct DPI.


So if you want to go the easy route then just adjust your display to be 96dpi. Also I like to set the fonts to 'full hinting' and 'grayscale' smoothing.
http://img69.imageshack.us/my.php?image=dpibe3.jpg

This does a pretty good job.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
How to calibrate your DPI.


Well if your using a LCD display you should be able to find very accurate information on it. You'll want to use your 'native' resolution. Look to see if you can find actual DPI settings in your display's documentation. If you can't then you should be able to find accurate information on the actual display size.. preferably in millimeters.

DPI equals Resolution divided by Screensize
but since you'll probably find information in millimeters then you'll want to deal with the conversion between inches and millimeters. There are 25.4 mm in inches so...

( resolution * 25.4 ) / size in mm

Then you get your DPI.


If your using a CRT or don't know what screen size you have then you'll have a harder time sometimes.

If you have Gimp installed you can use it's utility to calibrate the DPI (in the toolbar, file-->preferences-->display-->check enter manually-->calibrate). Like such:
http://img394.imageshack.us/my.php?image=gimpcalibrateen5.png


Note that this only changes it for Gimp, but you can use the value in your gnome-font-properties.


For CRT stuff you'll want to use a resolution that matches your display ration of 4:3. You can find a list of common resolutions and their ratio at:
http://en.wikipedia.org/wiki/Computer_display_standard

Of course you can add your own resolution if it's not on this list. If your using a Intel onboard graphics you may need a hack like 915resolution to be able to set non-Vesa-standard resolutions. This goes for widescreen displays also.


I don't know if you want to use sub-pixel-rendering if your using a LCD. Some people like it and other people don't.


For non-Gnome stuff you can do similar settings in KDE font settings in the KDE control center. For X in general you can add your display size in your 'monitor' section in /etc/X11/xorg.conf, but this seems to be broken. It always defaults to 96 dpi on my system.

As a example:
Section "Monitor"
Identifier "SyncMaster"
Option "DPMS"
DisplaySize 360.0 270.0
HorizSync 30-96
VertRefresh 50-160
EndSection
 

trmiv

Lifer
Oct 10, 1999
14,670
18
81
That display size thing doesn't always work, there is apparently a https://bugs.freedesktop.org/show_bug.cgi?id=9758">bug in xorg 7.2 regarding that</a>. I cannot get it to work at all with Ubuntu 7.04 on my laptop. No matter what I do when I run "xdpyinfo | grep resol" I get 89x92 (with the i810 driver) or 91x91 with the newer Intel driver. This is with Intel 915 graphics. However on my wife's laptop with Nvidia graphics, it works. But, with PCLinuxOS 2007 that Display Size thing works fine on my laptop and I get 96x96, but PCLinuxOS uses xorg 7.1.1 instead of 7.2 like Ubuntu. Sabayon Linux gets it correct out of the box in both my wife's laptop and mine.

Also rebuilt freetype with the bytecode interpreter enabled, but I'm not sure that has that big of an effect.

If you want to get all your mouse buttons on a Logitech mouse working in Ubuntu, this guide works well. It doesn't mention using the --sms switch with lomoco for the cruise buttons, but I added that at the end of the thread.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0

Oh yah. Mice.


Linux has very good hotplug support. It can autodetect devices it knows about, it will configure them usually pretty well, and then it will autoload the driver and setup the /dev/ file. Usually works out well. Subsystems in Linux that provide this sort of support are things like udev and the /sys sysfs directory. We have the dbus system for relaying information about devices and other system configuration changes/notifications to userspace applications.

X.org has NO hotplug support. Zero. Except maybe a bit with randr stuff. It still uses a static configuration file. Some configuration utilities may be a bit smarter, but X.org is still stuck in the 90's in terms of dynamic configuration. Future versions of X will fix this, starting with the next release.

In order to work around X's limitations Linux has provided the /dev/input/mice and /dev/input/mouse? interfaces. These take mice and provide emulation layer to make them all appear to be the same generic type of mouse. This emulation can be used by X windows through it's IMPS/2 or ExplorerPS/2 mouse driver.


So... If you want to use advanced configurations for your inptu devices you will have to setup X to stop listenning to /dev/input/mice and provide fancy configuration for new devices.


trmiv linked to a good article about Logitech devices.

However you can refer to your mouse device with the evdev driver by 'Name' instead of by 'Device'. This is usefull because the /dev/input/event* files can change. Sometimes some devices will be event8 and other times they can be event5 or event10 or whatever.


This is what I use for my Logitech mouse:
Section "InputDevice"
Identifier "Configured Mouse"
Driver "evdev"
Option "CorePointer"
Option "Name" "Logitech USB RECEIVER"
EndSection

This is a bit of a hack, but it does work well.

in my /proc/bus/input/devices file:
I: Bus=0003 Vendor=046d Product=c50e Version=0111
N: Name="Logitech USB RECEIVER"
P: Phys=usb-0000:00:1d.0-1/input0
S: Sysfs=/class/input/input1
H: Handlers=mouse0 event1 ts0
B: EV=20007
B: KEY=ffff0000 0 0 0 0 0 0 0 0
B: REL=143
B: LED=ff00

Doing this all my mice button work. This should work with any sort of fancy USB or PS/2 mice. My experiances are with Microsoft and Logitech mice as well as a couple different types of trackballs.

Probably if you want a fancy mouse for Linux then Logitech is a safe choice.



For other advanced devices you can use different sorts of special drivers to get those working well.


For synaptics touchpad, which is the most common touchpad on laptops you can probably use this guide, although I haven't tried that sort of stuff:
http://www.debuntu.org/2006/06/18/67-ho...-touchpad-on-a-laptop-a-complete-guide

It uses the 'synaptic' driver.


For Wacom tablets, which are the best tablets you can buy.. and for most Tablet PCs you can follow this:
http://linuxwacom.sourceforge.net/index.php/howto/x11

Wacom driver is part of X and Linux now so you shouldn't have to bother with recompiling anything. Just configuring X.

Be sure that you refer to you mouse with something other then /dev/input/mice.. because the Linux input emulation will send your wacom output to that file also.

After configuring wacom and all that you can use it's special features in graphics applications like Gimp or Krita by going into their configurations and setting them up to use it.
http://linuxwacom.sourceforge.net/index.php/howto/gimp

Both Krita and Gimp work very well with Wacom tablets...

 

trmiv

Lifer
Oct 10, 1999
14,670
18
81
One thing when using the logitech mice with the guide I posted on a laptop. Often with the Option "CorePointer" X will fail to load if you boot with the mouse disconnected. If that happens, replace Option "CorePointer" with Option "SendCoreEvents" "True" and it should allow you to boot without the mouse hooked up.
 

hasu

Senior member
Apr 5, 2001
993
10
81
Not a tweak per se...but...

My elcheapo Encore ENLWI-G2 won't work because Linux by default try to use driver for Realtek 8180 chipset, this specific card being based on rtl8185! I had to search (locate) for the file and rename the folder so that Linux won't load it automatically and after that ndiswrapper works fine (with windows drivers).

1. How would you determine if a hardware (say pci card) is detected "properly" and what driver is being used?
2. Even if the device shows up in lspci that doesn't mean that it is detected properly, am I right?
3. How would you blacklist the drivers (black list procedure obtained from ubuntu forum did not work with Puppy Linux).
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: hasu
Not a tweak per se...but...

My elcheapo Encore ENLWI-G2 won't work because Linux by default try to use driver for Realtek 8180 chipset, this specific card being based on rtl8185! I had to search (locate) for the file and rename the folder so that Linux won't load it automatically and after that ndiswrapper works fine (with windows drivers).

1. How would you determine if a hardware (say pci card) is detected "properly" and what driver is being used?

It works. :)

As for matching hardware up with the module, that's a good question. I don't know the answer besides what you can get through dmesg, which isn't much usually.

If you are using a relatively modern distribution you can use hal-device-manager to see the sort of information the kernel provides to userspace. You can look at devices and such similar to Windows device-manager, but you can't realy configure much of anything with it.

2. Even if the device shows up in lspci that doesn't mean that it is detected properly, am I right?

No, I don't think so. It's related to PnP stuff; lspci is listing information that the cards themselves make aviable on the PCI bus. I think that you could have hardware issues that may make lspci not work, but I think that any card plugged into the PCI slot should show at least some stuff.

It's how Linux identifies stuff.

If you use lspci like such:
> lspci -nv

Then you'll see the stuff how Linux kernel sees stuff, I am guessing. It'll use that code to match up with what it thinks is the right driver. Sometimes those PCI IDs can be set wrong and the wrong driver is loaded. When you run regular 'lspci' they will add extra information from the kernel PCI ID List.

BTW the problem you had would be a kernel bug.


3. How would you blacklist the drivers (black list procedure obtained from ubuntu forum did not work with Puppy Linux).

Well the subsystem responsable for auto loading of drivers and such would be 'udev'. This is configurable from userspace so it can differ from distribution to distribution. Try doing a search using locate like 'locate blacklist', which will return any files with blacklist in their name. But that doesn't nessicarially stop modules from being loaded, just stops it from being loaded by udev.

If that doesn't work for some reason then the only sure-fire way is to delete the *.ko module file, or move it out of the way.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Theming.

Gnome has the ability handle theming pretty well.


There are several different catagories of themes you can deal with...

Application Themes --- Changes how the buttons, sliders, and other in-window things work.

Windows Border --- changes the look of the Window dressing around each application window.

Icons --- Changes how the icons look.

Login Manager --- changes how GDM looks

Splash Screen -- Gnome splash screen look


GTK+ Engines -- Advanced functionality to change more thoroughly the look'n'feel of applications.



To change your theme it's pretty easy.



For application, icons, window border you can go through the 'System' menu ---> preferences ---> themes to change them.


If there isn't a look you like then you can open up your browser to art.gnome.org.

From there you will find additional themes in the 'Desktop Themes' area. For example click on a 'Application'. Then click on a theme you like. On that page there is a gray box labeled 'Download'. From the link of that box, click and drag that link to your theme preferences window and it should download and install the theme automaticly for you.


For backgrounds you have to download the image to a folder you want to save it in then rightclick the background, choose change desktop background and drag-n-drop the image into the dialog.

if your using a SVG or PNG image that has a transparent background you can even change the background color and have it shine through. It makes nice effects sometimes.


If you have a newer Gnome release if you go into the gnome-theme-manager and your theme supports it you can go and manipulate colors directly. So if you don't quite like how Clearlooks looks then you can change that.
 

hasu

Senior member
Apr 5, 2001
993
10
81
My internet only Linux PC is getting ready and is now running Linux Mint (3.0 beta) on 1.1 GHz Celeron/256 MB RAM/Encore ENLWI-G(2). Linux Mint is sweet. It has got extremely clean looks and menu configuration.

Can any one explain how to configure a least privileged user account with just enough rights to browse internet?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: hasu
My internet only Linux PC is getting ready and is now running Linux Mint (3.0 beta) on 1.1 GHz Celeron/256 MB RAM/Encore ENLWI-G(2). Linux Mint is sweet. It has got extremely clean looks and menu configuration.

Can any one explain how to configure a least privileged user account with just enough rights to browse internet?


You could considure putting the browser in a VM.

Vmware has a number of 'virtual machine appliances' that you can use with their vmplayer. One of them is a minimal Ubuntu system that runs firefox and appears to simple be a regular browser. This way you can start up and 'suspend' your browser sessions without loosing any settings or anything like that, but when you feel like it you can 'reset' the system image to put the VM back into 'factory defaults' state and undo all changes to the VM's file system.

This way you can use a browser with nearly 100% security.





Otherwise if you want to have a user with least privilages setup a regular user.

Generally with Linux you assign various rights through 'groups'. To see what groups are associated with a paticular user you can go:
> groups username

To see what groups your current user has then you can just type 'groups'. For example in order to allow a user to use FUSE filesystem without root rights they will setup the fusermount command with 'setuid root' permissions, meaning users can run that command with 'root' privilages. Setuid programs are a serious security liability and they are kept to the minimum. So they typically restrict the setuid to users in the 'fuse' group.

So by keeping groups membership to a minimum your effectively setting up a 'least privilaged user'. It's pretty simple and you should have zero problems with programs not working and such things. In fact you definately want to disable 'sudo' for that user.

To remove a user from a group you go:
> deluser username groupname


This is in Debian and probably Ubuntu. Other Linux variations will use slightly different commands, commonly you'll see adduser, addgroup, groupadd, useradd, deluser, delgroup, groupdel, userdel. So you'll have to see your system documentation for specifics on which command does which.

In Debian deluser and adduser are the 'high level' commands were they will deal with details like passwords and user's home directories, were as userdel and useradd are a 'low level' commands that only deal with the basic configuration files. When in doubt consult the 'man' files.


The configuration files dealing with this are /etc/passwd and /etc/group. Passwd file used to contain passwords in encrypted form, but since this file has to be world readable so that applications can know what users are on the system modern Linux systems have 'shadow password file' which you can find at /etc/shadow


If you like you can edit these files directly. Like sudo with it's visudo there is vipw and vigr so you can edit it and not worry about having inconsistant files while they are in use.

Any group changes requires a log out and a log in for that user for the changes to go into effect.

A clever thing to do is edit /etc/shadow and replace the encypted password with a ! to disable logins using passwords.


Then you can also assign and remove sudo privilages with the visudo command. This is important. I know that Ubuntu sets up the initial user with sudo rights, which is the equivelent to MS Windows' administration. But I don't know about any users you add after the fact.


Also, of course, there are GUI equivelents to all these commands. Look in the System menu ---> Administration ---> users and groups if you don't want to bother with remembering all this stuff.




In otherwords setup a regular user, make sure that user's membership to groups is a bare minimum and make sure that it has no sudo rights.



'Least privilage user' is the default setup for most Linux distributions realy. For example Debian doesn't even have sudo installed by default, it's expected for you to use 'su' to get root rights (which is more secure and a bit of a pain compared to sudo).

Actually 'sudo' is a bit of a crutch.... ideally it shouldn't be needed, but the world is not ideal. :)
 

DarkThinker

Platinum Member
Mar 17, 2007
2,822
0
0
1- Sometimes certain Intel graphics cards don't support certain resolutions, like my testing machine doesn't support 1680x1050 (my Samsung's 225BW recommended resolution), so what I did is used 915resolution to load the 1680x1050 resolution onto the video bios ram. However this needs to be done every boot up so what you do is place it in a startup script, such as /etc/rc.local or /etc/init.d/boot.local. What you do is as follows:

Code:
su -
915resolution -l

This will give you a listing of supported resolutions:

Code:
Intel 800/900 Series VBIOS Hack : version 0.5.3

Chipset: 945GM
BIOS: TYPE 1
Mode Table Offset: $C0000 + $269
Mode Table Entries: 36

Mode 30 : 640x480, 8 bits/pixel
Mode 32 : 800x600, 8 bits/pixel
Mode 34 : 1024x768, 8 bits/pixel
Mode 38 : 1280x1024, 8 bits/pixel
Mode 3a : 1600x1200, 8 bits/pixel
Mode 3c : 1920x1440, 8 bits/pixel
Mode 41 : 640x480, 16 bits/pixel
Mode 43 : 800x600, 16 bits/pixel
Mode 45 : 1024x768, 16 bits/pixel
Mode 49 : 1280x1024, 16 bits/pixel
Mode 4b : 1600x1200, 16 bits/pixel
Mode 4d : 1920x1440, 16 bits/pixel
Mode 50 : 640x480, 32 bits/pixel
Mode 52 : 800x600, 32 bits/pixel
Mode 54 : 1024x768, 32 bits/pixel
Mode 58 : 1280x1024, 32 bits/pixel
Mode 5a : 1600x1200, 32 bits/pixel
Mode 5c : 1920x1440, 32 bits/pixel
Mode 60 : 2208x771, 8 bits/pixel
Mode 61 : 2208x771, 16 bits/pixel
Mode 62 : 2208x771, 32 bits/pixel
Mode 63 : 400x772, 8 bits/pixel
Mode 64 : 400x772, 16 bits/pixel
Mode 65 : 400x772, 32 bits/pixel
Mode 66 : 512x771, 8 bits/pixel
Mode 67 : 512x771, 16 bits/pixel
Mode 68 : 512x771, 32 bits/pixel

Just look for a mode that you are sure you won't be needing anytime soon, not down the mode number and place the following line at the bottom of /etc/rc.local:

Code:
915resolution 58 1680 1050

And then restart your system(preferably).

The line above replaces on each bootup the 1280x1024 (number 58) mode in my vbios with a 1680x1050 mode, and that way it's now available for you to use

However I do recall having a problem on my IBM S50 machine which has an Intel 865G chipset, the above approach was not working and I was able to get any mode except 1680x1050, so out of craziness I overwritten every single mode with 1680x1050 since that's the only one that I would ever need on that system, and guess what that worked hehe

2 - If you want to write scripts / executables and have them appear in the mouse's Desktopright click menu under Gnome, go to /home/$USER/.gnome2/nautilus-scripts and drop your scripts there. Once you right click on your desktop you should be able to see them.

3 - You are not the only one who sometimes irrecoverably messes up his GNOME menu, so what I usually do is periodically backup my /home/$USER/.config/menus folder into /home/$USER/.config/menus.tar.gz through a script I wrote and placed in my right click menu on the desktop, and I create backups through another script I placed the right click menu that untars the menus.tar.gz.


4 - Believe it or not, some GNOME users are not aware that the /home/$USER/Templates can hold Templates of files they usually create.
Just go to that folder and create an empty file (or it can be a non-empty file with actual text that corresponds to what you consider as a template) ending with the extensions of the file you are creating a template for.

5 - Print text in a huge size inside a terminal or to a file using the banner command. I think a snapshot would illustrate my point clearly.

6 - Gnome's Terminal Server Client (I recommend compiling rDesktop from source instead using binary packages)

7 - htop

8 - Useful Linux Commands

9 - Linux Quick Hacks

10- Java and Java Plugins how to

11- I have just learned of this one today, but boy did I like it, Update Firefox Web Control's Looks Just a note to Fedora users instead of /usr/lib/mozilla-firefox in Fedora it's /usr/lib/firefox-*version number*
And instead of sudo you can just become root and do all what is mentioned in the page.

12- Arm Your Linux System With Multemidia Codecs!


13- - Tweak extra GNOME and Nautilus preferences by installing gtweakui

That's all that I can remember of the top of my head ATM I hope you guys find it useful.
 

Noema

Platinum Member
Feb 15, 2005
2,974
0
0
Not a tweak per se, but I just wanted to share how Damn Small Linux helped save the day yesterday.

My uncle, the least computer savvy person on the planet, has an old AMD K6 @400 Laptop with 96MB of RAM. Somehow, he took the computer to a repair shop where the only thing they did was reinstall Windows 98 and a pirated version of Norton Antivirus. They didn't even bother to install the drivers. Not one single driver. Screen properties were stuck at 640x480 and 16 colors without the right driver :Q

So my uncle called me because he couldn't connect to his dial-up internet account (of course he couldn't...there was no driver for the v90 modem!). So I took the laptop home with me and I figured I'd just copy drivers via floppy...no such luck; the floppy drive is long dead on the laptop. It was late and I didn't have any blank CDs to burn the drivers on, and I didn't want to waste a CD just for a couple dozen megabytes worth of drivers. And Win98 doesn't offer mass storage USB support out of the box: a driver must be installed so I couldn't use my memory stick either.

So what I did was simply boot into the Damn Small Linux CD...which worked beautifully, detecting all the hardware without problems as it loaded the kernel; in less than a minute I had a fully functional linux desktop that of course recognized my USB memory stick out of the box after mounting it. So I mounted the Windows HDD, copied the drivers over and voila. Done in less than 3 minutes.

Oh boy. I love Linux :)