13.07.2015 Views

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

Linux System Administration Recipes A Problem-Solution Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 10 ■ THINGS GO IN, THINGS GO OUTNext, you need to link F15 to a program-launch event. You can do this graphically (using the createshortcut option on your desktop, which will usually provide a space where you can specify a hotkey) ifyou want F15 to launch an application, or you can use xbindkeys. (If this isn’t already installed on yoursystem, use sudo apt-get install xbindkeys to install the Debian/Ubuntu package.)Edit ~/.xbindkeysrc to look like this:#Launch Firefox"/usr/bin/firefox"F15Now start xbindkeys. Your new F15 key should now launch Firefox.To make this happen automatically, you need to create a script in the Autostart folder of yourdesktop. In KDE, this is ~/.kde/Autostart; in Gnome, you can save the script somewhere and then usethe <strong>Administration</strong> Sessions menu item, or you can put the script straight into the folder~/.config/autostart/.The script will look like this:#!/bin/sh#file to map special keys.xmodmap -e 'keycode 130=F15' #launch firefox#xbindkeys links keys to applications; config in ~/.xbindkeysrcxbindkeysThe xmodmap line has a comment at the end of the line, which is not really necessary here but isuseful if you’re remapping multiple keys.Make the script executable with chmod u+x ~/.kde/Autostart/keymapping. Now restart X, and youshould find that your new hotkey works as soon as your desktop has finished loading.■ Note See recipe 9-5a for how to set keys to enter Unicode characters and for more information about howxmodmap works.10-3. Automating Printer Setup with lpadminYou can admin your printers via a CUPS graphical interface by pointing a browser athttp://localhost:631. When challenged for a username and password, you can use root and the rootpassword. However, this is impractical (or at least time-consuming) for installing multiple machines.Instead, you can use lpadmin to add your printers.Whichever method of printer setup you use, you’ll need to install the package containing the driverfor your printer. Depending on your model of printer, several packages are available for Debian/Ubuntu.cups-driver-gutenprint is a good place to start; there is also a specific package (hpijs; and hpijs-ppdsfor the model-specific drivers) available for HP printers.You’ll then need to go looking in /usr/share/cups/model/ to locate the path for the driver for yourparticular printer. For example, for an HP LaserJet 4350, that would be as follows:/usr/share/cups/model/HP/HP-LaserJet_4350-hpijs-pc13.ppd205Download at WoweBook.Com

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!