Sunday, June 28, 2009

Ubuuntu Ctrl+Alt+Delete

Trapping Ctrl+Alt+Delete
Different versions of Linux either have the Ctrl+Alt+Delete (CAD) key sequence enabled or disabled. In Ubuntu Dapper Drake, this key sequence is enabled, allowing a quick shutdown and reboot. However, the Gnome desktop intercepts CAD. To reboot, you need to switch to a text window (Ctrl+Alt+F1) and then press CAD.

Since the Gnome desktop intercepts CAD, you can remap this key sequence to run a different command. For example, to bring up the Gnome System Monitor, you can use:

gconftool-2 -t str --set /apps/metacity/global_keybindings/run_command_10 \
'Delete'
gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_10 \
"gnome-system-monitor"

The system monitor enables you to see the running processes and selectively kill applications. This is similar to using CAD under Microsoft Windows to bring up the System Monitor.

Unfortunately, the reboot command runs as root, so you cannot make CAD run /sbin/reboot. However, you can use gksudo (a graphical front-end to sudo) to prompt you for your password and then run reboot as root:

gconftool-2 -t str --set /apps/metacity/keybinding_commands/command_10 \
"gksudo reboot"



Disabling Ctrl+Alt+Delete
Sometimes you may want to prevent CAD from rebooting the system. For example, a critical server may have CAD disabled to prevent someone from playing with the keyboard and cycling the system.

1. Edit the /etc/inittab file.
sudo vi /etc/inittab

2. Find the line that says:
ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
This line says, for all init levels (1, 2, … 5), run the shutdown command and reboot now.

3. To disable CAD, comment out the line by inserting # at the beginning of the line.
#ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now

4. To alter the CAD action, change the /sbin/shutdown command to run your own program. For example, you may want to send an alert to an administrator or play some Disco music to let the user know that CAD is outdated.

ca:12345:ctrlaltdel:/usr/bin/play /home/nealk/disco.mp3 > /dev/null
Only one application can use the audio driver at a time, so this will only play music if nothing else is playing at the same time.

5. After changing the inittab file, reload it using: sudo telinit q.


Unmapped keyboard signals can be lost. If you disable CAD, then you may find that you cannot re-enable it without rebooting the system. But if you change the functionality (without disabling the command) then you do not need to reboot. The same is true for power level signals and Alt-UpArrow.


Source of Information : Hacking Ubuntu Serious Hacks Mods and Customizations

Saturday, June 13, 2009

Ubuntu Xfce4 Desktop

The Xfce4 desktop is a lightweight desktop designed to run fast without the kind of overhead required for full-featured desktops like KDE and GNOME. You can think of it as a window manager with desktop functionality. It includes its own file manger and panel, but the emphasis is on modularity and simplicity. Like GNOME, Xfce4 is based on GTK+ GUI tools. The desktop consists of a collection of modules such as the Thunar file manager, Xfce4 panel, and the xfwm4 window manager. Keeping with its focus on simplicity, the Xfce4 panel features only a few common applets. Its small scale makes it appropriate for laptops or dedicated systems that have no need for the complex overhead found in other desktops.

Xfce is used primarily on Xubuntu and Mythbuntu, though you can install it on any Ubuntu desktop system. It is useful for desktops designed for just a few tasks, such as multimedia desktops. You can configure your Xfce4 desktop by right-clicking anywhere on the desktop background and choosing Settings Settings Manager. The Settings Manager window shows icons for your desktop, display, panel, and user interface, among others. Use the user interface tool to resize fonts and select a theme. The Panel tool lets you add new panels and control features such as fixed for freely movable and horizontally or vertically positioned.

Initially, in a new install of Xfce4, only one panel appears with an application launcher icon in it. You can add more items by clicking the panel and choosing Add New Item. This opens a window with several applets such as the clock and Workspace Switcher, as well as menu and application launcher applets. The launcher applet will let you specify a application to start and choose an icon image for it. Using the handles on either side of the panel, you can move it wherever you want on the screen.

Opening the file manager lists entries not just for the home directory, but also for your file system, desktop, and trash contents. The File menu lets you perform file operations such as renaming files or creating new directories.

From the desktop pop-up menu, you can access all the installed applications on your system. A System submenu lets you access all the administrative tools. To quit or log out, right-click the desktop and choose Quit. You have the option of saving your session.

Source of Information : McGraw Hill Ubuntu The Complete Reference