GNU/Linux / Desktop

From WhyNotWiki
< GNU/Linux
Revision as of 01:54, 7 August 2007 by Tyler (Talk | contribs)
Jump to: navigation, search

GNU/Linux / Desktop  edit   (Category  edit)


Aliases: GNU/Linux / Desktop environment, GNU/Linux / X Windowing System, GNU/Linux / Graphical environment,

This information will be about Ubuntu and GNOME unless specified otherwise.

Contents

Keyboard shortcuts

Context Function Default My preference Easiest way to change
Global Opens a Run Application window... Alt+F2 F1 GNOME Keyboard Shortcuts app
Global Show the panel menu ("start menu") Alt+F1 (in Windows this was Ctrl+Esc or Windows key) Alt+F1 GNOME Keyboard Shortcuts app
Global Open a terminal window (disabled) SuperR GNOME Keyboard Shortcuts app
Global Home folder (opens Nautilus to ~) (disabled) The "Files" button on my Logitech keyboard (0xc6) GNOME Keyboard Shortcuts app
Global Switch to workspace on the left Ctrl+Alt+Left GNOME Keyboard Shortcuts app
Many apps, including Firefox, gnome-terminal Toggle full-screen mode (disabled) Alt+Enter GNOME Keyboard Shortcuts app
Global Minimize all windows and focus the desktop Ctrl+Alt+D Ctrl+Alt+D GNOME Keyboard Shortcuts app
gnome-terminal Paste from main clipboard Ctrl+Shift+V (Ctrl+V will not do it) (can't?)


Firefox / Keyboard shortcuts

Firefox / Keyboard shortcuts edit


Start a search on the current page /
 


How to remap keys / Change keyboard shortcuts

Master Your Linux Keyboard (And Fix Caps Lock Forever): XBindKeys For Launching Applications (http://linuxplanet.com/linuxplanet/tutorials/6401/2/). Retrieved on 2007-05-11 11:18.


KDE and GNOME, window managers like IceWM and Fluxbox, and many applications come with their own set of prefab keybindings. You should investigate these before going on a customization spree, or you run the risk of creating conflicts. We're going to learn how to use XBindKeys. XBindKeys is not dependent on any particular desktop or window manager, and should run on pretty much any Linux or Unix system."


http://www.xfree86.org/4.2.0/xmodmap.1.html

http://lifehacker.com/software/how-to/configure-custom-keyboard-shortcuts-on-ubuntu-256955.php. Retrieved on 2007-05-11 11:18.


I live and die by xbindkeys and xautomation. They allow me to easily map and remap the 9 extra buttons on my mouse, something that I couldn't figure out how to do in Windows. I'm almost always using my laptop while in bed, so I like to be able to do everything with one hand. I even have profiles saved and automatically change depending on the situation, so click-wheel left and right scroll through tabs in Firefox and Konqueror, change the page in KPDF and skip -/+ 10 seconds in VLC. Very useful stuff.

How to make a keyboard shortcut for an arbitrary command

xbindkeys

gconf-editor

http://ubuntuforums.org/archive/index.php/t-23708.html. Retrieved on 2007-05-11 11:18.


It took a bit of digging to figure how to add keyboard shortcuts to run arbitrary commands. Here are the steps in case someone else needs them:

  • start the GConf Editor: Applications / System Tools / Configuration Editor
  • go to /apps/metacity/keybinding_commands
  • edit command_1, set it to some command, like kdocker -f
  • go to /apps/metacity/global_keybindings
  • edit run_command_1, set it to a key combination, like <Super>z or <Shift>F1

You can accomplish that with xbindkeys also. I prefer that way, because you can keep the same shortcuts between desktop environments/window managers. You just have to be sure that xbindkeys is running on startup.


http://linuxplanet.com/linuxplanet/tutorials/6401/1/. Retrieved on 2007-05-11 11:18.


Want to get rid of the evil caps lock key without mutilating your keyboard? Want to give those silly Windows keys useful jobs, or put all those extra multi-media keys to work? Want to become a powerhouse keyboarding commando? Then come along and join the fun, because Linux has all kinds of good tools for taming wayward keyboards and increasing your efficiency. In this two-part series we're going to use xmodmap, XBindKeys, and KeyTouch to create custom keybindings for launching applications and running commands. The placement of the caps lock key is a demonstration of malicious cunning. It's above the shift key and it's usually oversized, so it's way too easy to hit it when you don't want to, which for me is all the time. On a case-sensitive operating system it's not all that useful anyway. Unhappy users often resort to remedies like prying it off entirely or covering it with duct tape. You can do this if you're careful, but elite geeks resort to more sophisticated measures that do not mangle their nice keyboards. It's not the fault of the keyboards that manufacturers have giant Windows-sized blind spots, and as always, Linux makes lemonade out of lemons and provides useful alternatives.

System -> Preferences -> Keyboard Shortcuts

It looks like the equivalent in gconf-editor is /apps/metacity/global_keybindings.

The "Windows" key

... is the "super" key in Linux. Or, I suppose, the "Linux" key.

http://www.howtogeek.com/howto/ubuntu/use-the-windows-key-for-the-start-menu-in-ubuntu-linux/#comment-18227. Retrieved on 2007-05-11 11:18.


To get the windows key to be interpreted as one key, do this: Make a task that starts with the session (I don't know how you do this in GNOME) by creating a new link to application in your ~/.kde/Autostart directory. Make it so that it runs the following command: xmodmap ~/.xmodmap Now we need to create a plain text file in your home folder called .xmodmap and make sure it says the following in it:


keycode 115 = F13 keycode 116 = F14

The second line is only needed if your keyboard has two windows keys. Essentially, this maps these keys to the two imaginary keys F13 and F14, so you don't need to worry about the Win + something problem anymore. 115 and 116 are the keycodes that I've seen most, if not all, keyboards give for the winkeys. Check by running xev if it is the same for you. I got this from somewhere else long ago, so don't give the credit to me for it.

I don't think that's actually necessary (any more?). Using Ubuntu's "Keyboard Shortcuts" app, I was able to map "Super R" (the right Linux key) to a desired command, without doing all that stuff e mentioned.

How to disable the capslock key (keep it from toggling the capslock state of your keyboard)

http://ubuntuforums.org/archive/index.php/t-23708.html. Retrieved on 2007-05-11 11:18.


Kill capslock I hate the capslock I never use the Caps Lock button. Never. The only time I "use" it is when I accidently press it and start typing things in UPPERCASE. To disable it in Linux all you have to do is enter this on the command line:

$ xmodmap -e "remove lock = Caps_Lock"

To set this permanently, just stick the above line in your ~/.bashrc file (or /etc/bash.bashrc if you're root) so that it looks something like this:

if [ "$PS1" ]; then
# Disables the bloody CapsLock button
xmodmap -e "remove lock = Caps_Lock"
...
fi 


Question: Can you still use the capslock key for other things once you've "disabled" it? (I think so...)


Mouse

Selecting text copies it to the middle-click buffer

[Differences from Windows (category)]

I like!

At first I didn't think I liked this, having two different clipboard buffers... But I think the benefits outweigh the drawbacks here: It is so convenient to be able to select text and have it automatically copied to the clipboard and then be able to paste to another application with only a single click, without ever touching the keyboard!.

I used to have it set up to be almost as convenient on Windows: I just had to select the text, press the Windows key (mapped to copy), switch to the other app, and press CapsLock (paste).

Question: Paste via keyboard shortcut?

On the other hand, ... I'm more of a keyboard-lover than a mouse-lover, and I don't know of any way to access the middle-click buffer from the keyboard. Does anyone else know a way??

Problem: Can't select and then paste or it will wipe out what you meant to paste

This is a common scenario for me: I select some source text, copy it to the clipboard. Then I select some text in a target document and either delete it, paste over top of it, or drag-and-drop it to somewhere else out of the way.

But with the existing behavior, just selecting the text in the target document wipes out your source text.

In other words, using the middle-click buffer, it's apparently impossible to paste "over top of" (replace) another selection. You would have to delete the text from target document first, then select the source text from source document, then paste into target document.

Workaround: Use the other (Ctrl-C, not middle-click) clipboard buffer.


Annoyances / Open problems

Double-click/alt-arrow-key word selection is unintelligent and unintuitive

Double-clicking whitespace selects the word to the right of the whitespace

On Windows, it only selected the whitespace, which is what I'm used to and which is the behavior I like better now that I've experienced both.

Can we fix this??

Also, double-clicking a word that is beside some punctuation marks (-, =, ", . -- anything I've tried) also selects the punctuation marks -- which is not what I want.

Example: Double-clicking on there in "Hi there." causes there." to be selected.

Even if you have an XML tag or something following or preceding a word--that will get picked up and selected too.

Can we fix this??

(Alt-Left and Alt-Right apparently use the same word-selection behavior/code.)


[Firefox (category)]: Drag and drop of the address bar only gives URL

[Differences from Windows (category)]

When you drag the address bar (or the icon beside it) to another app (a textarea in another browser window), I'm used to having it insert the URL as well as the title. In X / Gnome, it looks like it only inserts the URL. (Oh well. At least it's usually pretty easy to copy and paste the title of the page using the middle button...)



Somewhat advanced stuff

Changing what gets started when X starts up

System -> Preferences -> Sessions

This gives you a GUI frontend to add applications that should always be started...

You can also remove programs from the list or simply disable them.

Startup scripts

http://ubuntu.wordpress.com/2005/09/07/adding-a-startup-script-to-be-run-at-bootup/

http://oldfield.wattle.id.au/luv/boot.html#init

http://www.acm.uiuc.edu/workshops/cool_unix/xinitrc.html

http://web.mit.edu/answers/xwindows/xwindows_xmodmap.html

http://www.jwz.org/xkeycaps/

http://www.in-ulm.de/~mascheck/X11/xmodmap.html


[Open problems/questions (category)] How do you start a GUI app from the command line without making it dependent on the terminal process

What I mean is, I don't want this to happen:

  • I type update-manager (or xbindkeys-config, or pretty much any other app) in the terminal
  • The update-manager window comes up
  • I close the terminal
  • The update-manager window closes

Yes, I know I can type command& to start the app in the background so that I can keep typing. But that doesn't solve this problem.

The problem appears to be that the new process is a child process of my CLI shell (bash), which is a child process of my terminal emulator (gnome-terminal):

> ps uxf
tyler    18976  0.0  1.1  82772 36600 ?        Sl   14:29   0:02 gnome-terminal
tyler    18979  0.0  0.0   2660   744 ?        S    14:29   0:00  \_ gnome-pty-helper
tyler    18980  0.0  0.1   6056  3532 pts/1    Ss+  14:29   0:00  \_ bash
tyler    23640  0.0  0.1   5904  3352 pts/0    Ss   16:00   0:00  \_ bash
tyler    24567  0.0  0.0   5216  2884 pts/0    S+   16:19   0:00  |   \_ xbindkeys-config
tyler    26851  0.0  0.1   5904  3324 pts/2    Ss+  17:18   0:00  \_ bash
tyler    28540  0.8  0.1   5904  3320 pts/3    Ss   18:00   0:00  \_ bash
tyler    28556 29.4  2.4 109940 74256 pts/3    S    18:00   0:02      \_ /usr/bin/python2.5 /usr/bin/update-manager
tyler    28576  0.0  0.0   2600   980 pts/3    R+   18:00   0:00      \_ ps uf uxf

So when I exit that gnome-terminal window, it exits the bash process (28540), which causes all child processes (28556: update-manager) to be killed as well.

Solutions??

Possible solution: Custom wrapper script for each

It looks like this is how Firefox does it...

$ which firefox
/usr/bin/firefox

$ file /usr/bin/firefox 
/usr/bin/firefox: symbolic link to `../lib/firefox/firefox'

$ file /usr/lib/firefox/firefox
/usr/lib/firefox/firefox: POSIX shell script text executable

$ cat /usr/lib/firefox/firefox
...
if [ $debugging = 1 ]
then
  echo $dist_bin/run-mozilla.sh $script_args $dist_bin/$MOZILLA_BIN "$@"
fi
"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
exitcode=$?
...

In my case, "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@" evaluates to: /usr/lib/firefox/run-mozilla.sh -g /usr/lib/firefox/firefox-bin

/usr/lib/firefox/run-mozilla.sh

...
if [ $moz_debug -eq 1 ]
then
    moz_debug_program ${1+"$@"}
else
    moz_run_program ${1+"$@"}
fi

exit $exitcode



Possible solution: A command, sort of like gksu, that you can prefix any GUI app command with

Windows has the "start" command when on the command line. Don't tell me GNU/Linux has no analog!

gksu

man gksu:

       gksu - GTK+ frontend for su and sudo

SYNOPSIS
       gksu

       gksu [-u <user>] [options] <command>

       gksudo [-u <user>] [options] <command>

DESCRIPTION
       gksu is a frontend to su and gksudo is a frontend to sudo.  Their primary purpose is to run graphical commands that need root without the need to run an X terminal
       emulator and using su directly.

       Notice that all the magic is done by the underlying library, libgksu. Also notice that the library will decide if it should use su or sudo  as  backend  using  the
       /apps/gksu/sudo-mode  gconf  key,  if  you  call the gksu command. You can force the backend by using the gksudo command, or by using the --sudo-mode and --su-mode
       options.

       If no command is given, the gksu program will display a small window that allows you to type in a command to be run, and to select what user the program should  be
       run as. The other options are disregarded, right now, in this mode.

http://linuxplanet.com/linuxplanet/tutorials/6401/3/. Retrieved on 2007-05-11 11:18.


For launching graphical applications with rootly powers, or as any other user, you need gksu or kdesu. Using one of these gives you a graphical login window, like Figure 2. gksu is a graphical front-end to both su and sudo. Just to add to the fun and confusion, so is gksudo. Making it even more fun is Ubuntu makes gksu behave like gksudo. So let's talk about this first.

http://linuxplanet.com/linuxplanet/tutorials/6401/4/. Retrieved on 2007-05-11 11:18.


Because Ubuntu makes gksu and gksudo both behave like sudo, how do you configure xbindkeys to run a command as "real" root? Use the -w switch, like this:

$ gksu -w kate

You can cancel the sudo timeout with this command:

$ sudo -k

This is helpful when you're testing your commands and they get stuck in sudo mode.

[Nautilus (category)]

Customizing the context menu

Templates

~/Templates

Scripts

.gnome2/~/nautilus-scripts/

umask / default file permissions

http://ubuntuforums.org/showthread.php?t=40617

Multiple desktops

http://weblogs.mozillazine.org/gerv/archives/2005/06/taskbars.html. Retrieved on 2007-05-11 11:18.


I think you should use desktops more. You can group windows by activities - one desktop for messaging stuff, one for music, one for web browsing, use the pager or the window list (which is on the top right in a gnome setup) to move between desktops. I typically use six desktops, and there is no need for minimizing windows. The taskbar isn't needed anymore.


I've never understood the use of taskbars in a system with virtual desktops. It makes sense in the Other OS, but I've never seen the point in GNOME. My browser is always in desktop 3; my terminal is always in #1, my music is always in #4, etc. Having an omnipresent widget just to tell me which apps are open seems like a bad use of screen real estate; I know exactly where my apps are without even thinking about it. Learning to be consistent in which programs you open on which desktops really pays off. Then again, maybe it just works well for me since I am a web developer, and I have a predictable set of programs open at all time with little variance.


Panels

Trying to get the taskbar (window list) to take 2 rows instead of one

http://ubuntuforums.org/showthread.php?p=2003626


Sound and video

Codecs

I used EasyUbuntu to get the codecs, but there are probably other ways.

Utilities

xkill

Click a window to kill the process that owns that window.

GNOME Launch Box

Homepage: http://developer.imendio.com/projects/gnome-launch-box
Source code: http://developer.imendio.com/svn/gnome-launch-box/trunk



Description: Launch Box is generally an application launcher. It's very influenced by Quicksilver for Mac.





Error on call to Template:cite web: Parameter url must be specified. Retrieved on 2007-05-11 11:18.


Currently supported modules are:

  • Application starting and launch
  • Evolution contacts lookup and mail to
  • Recent files lookup and open
  • Files in your desktop and open
  • Firefox bookmarks lookup and opening


Tilda

Project/Development: http://sourceforge.net/projects/tilda/


Description: Tilda is a Linux terminal taking after the likeness of many classic terminals from first person shooter games, Quake, Doom and Half-Life to name a few, where the terminal has no border and is hidden from the desktop till a key or keys is hit.





Troubleshooting

When the system stops "working"

Ctrl-Alt-Backspace to kill X (does it restart it automatically?)

Ctrl-Alt-Delete to restart the system (will unmount your drives safely first)

When everything else fails: [1]


Raising Skinny Elephants Is Utterly Borin

  • Left Alt + SysRq (printscreen key) + r
  • Left Alt + SysRq + s
  • Left Alt + SysRq + e
  • Left Alt + SysRq + i
  • Left Alt + SysRq + u
  • Left Alt + SysRq + b
Facts about GNU/Linux / DesktopRDF feed
Description [Oops! No type defined for attribute]
Ads
Personal tools