Wednesday, February 5, 2014

How to edit accelerators (keyboard shortcuts) in gnome application menus on Ubuntu 13.1

To edit accelerators (keyboard shortcuts) in gnome application menus on Ubuntu 13.1;

These instructions assume a keyboard shortcut (accelerator) is desired to be assigned in the gnome-terminal gnome application.
  • sudo apt-get install dconf-tools
  • dconf-editor - org - gnome - desktop - interface - check can_change_accels
  • UBUNTU_MENUPROXY=0 gnome-terminal (The gnome application must be started with the global menu system disabled)
  • hover the mouse over a menu item (eg Terminal - Reset and Clear), and press the desired keyboard shortcut (eg "Ctrl-R")

Monday, February 3, 2014

Where are the gnome system tray applets in Ubuntu 13.1?

The gnome system tray applets in Ubuntu 13.1 can be initialised with the following commands (eg to be used in an alternative window manager such as icewm);

---
Network Manager Applet:
nm-applet

---
Sound Volume Control Applet:
gnome-sound-applet

(Note gnome-sound-applet used to be called gnome-volume-manager).

---
Power Management Applet:
mate-power-manager

(Note gnome-power-manager is not currently available in Ubuntu. See mate-power-manager installation).

---
Bluetooth Applet:
mate-bluetooth-applet

(Note bluetooth-applet is not currently available in Ubuntu. See mate-bluetooth-applet installation).

---
Brightness Control Applet:
/opt/extras.ubuntu.com/indicator-brightness/indicator-brightness

(See indicator-brightness installation)

How to remove the Nautilus sidebar in Ubuntu 13.1

To remove the Nautilus ("Files") sidebar in Ubuntu 13.1;
  • sudo apt-get install dconf-tools
  • dconf-editor - org - gnome - nautilus - window-state - untick 'start-with-sidebar'

How to install the brightness indicator applet on Ubuntu 13.1

To install the brightness indicator applet on Ubuntu 13.1 (eg to modify the brightness in icewm);
  • sudo add-apt-repository ppa:indicator-brightness/ppa
  • sudo apt-get update
  • sudo apt-get install indicator-brightness
  • /opt/extras.ubuntu.com/indicator-brightness/indicator-brightness &
  • Add '/opt/extras.ubuntu.com/indicator-brightness/indicator-brightness' to the window manager's startup

How to install the gnome power-manager applet on Ubuntu 13.1

To install the gnome power-manager applet on Ubuntu 13.1;

These instructions are relevant to the case where the Ubuntu Unity WM is not being used (eg when icewm is installed);

  • sudo add-apt-repository "deb http://repo.mate-desktop.org/ubuntu saucy main"
  • sudo apt-get update
  • sudo apt-get --yes --quiet --allow-unauthenticated install mate-archive-keyring
  • sudo apt-get update
  • sudo apt-get install mate-power-manager
  • mate-power-manager &
  • Add 'mate-power-manager' to the window manager's startup

How to install the gnome bluetooth-applet on Ubuntu 13.1

To install the bluetooth-applet on Ubuntu 13.1;

These instructions are relevant to the case where the Ubuntu Unity WM is not being used (eg when icewm is installed);

  • sudo add-apt-repository "deb http://repo.mate-desktop.org/ubuntu saucy main"
  • sudo apt-get update
  • sudo apt-get --yes --quiet --allow-unauthenticated install mate-archive-keyring
  • sudo apt-get update
  • sudo apt-get install mate-bluetooth-applet
  • mate-bluetooth-applet &
  • Add 'mate-bluetooth-applet' to the window manager's startup

How to create a new blank file in Nautilus on Ubuntu 13.1

To create a new blank file in Nautilus ("Files") on Ubuntu 13.1;

  • touch '$HOME/Templates/Empty Document' (create a new document in the user Templates folder)
  • Nautilus - right click on blank area - New Document - Empty Document

(NB the fact there are two "Empty Documents" is a bug in Nautilus; https://bugzilla.gnome.org/show_bug.cgi?id=687139).

How to configure Nautilus to open a file with an application in Ubuntu 13.1

To configure Nautilus ("Files") to open a file with an application in Ubuntu 13.1;

These instructions assume that Nedit is desired to be used to open a text file in Nautilus.

  • cd $HOME/.local/share/applications
  • touch nedit.desktop (create a new file called nedit.desktop)
  • nedit nedit.desktop (open nedit.desktop in a text editor)
  • add these contents;

[Desktop Entry]
Encoding=UTF-8
Name=Nedit
Comment=Edit text files using nedit
Exec=nedit %u
Terminal=false
Type=Application
Icon=
Categories=Application;Utility;TextEditor;
StartupNotify=true
MimeType=text/plain;
NoDisplay=true   

  • Open Nautilus
  • Right click on a .txt file - Properties - Open With - select Nedit - Add
  • (Reselect Nedit - Set as default)

How to install xmms on Ubuntu 13.1

To install xmms on Ubuntu 13.1;

XMMS Clone 1:
  • sudo apt-get install audacious
  • add winamp skins to $HOME/.local/share/audacious/Skins;
  • mkdir $HOME/.local/share/audacious
  • mkdir $HOME/.local/share/audacious/Skins
  • audacious
  • audacious - View - interface - Winamp Classic Interface
  • audacious - View - interface - Interface Preferences - Select Skin
To install the default XMMS Skin;
  • Download xmms-1.2.11.tar.gz from http://www.xmms.org/download.php (http://www.xmms.org/files/1.2.x/xmms-1.2.11.tar.gz)
  • tar xvf xmms-1.2.11.tar.gz
  • cd xmms-1.2.10/xmms
  • zip defskin.zip defskin [create a skin archive]
  • cp defskin.zip $HOME/.local/share/audacious/Skins/
  • audacious - View - interface - Interface Preferences - Select Skin "defskin"

XMMS Clone 2:
  • sudo apt-get install promoe
  • add winamp skins to $HOME/.promoe/skins;
  • mkdir $HOME/.promoe
  • mkdir $HOME/.promoe/skins
  • promoe

How to list installed packages in Ubuntu 13.1

To list installed packages in Ubuntu 13.1;
  • dpkg --get-selections | grep -v deinstall > installedPackages.txt
(NB "grep -v deinstall" is used to ignore packages marked for removal).

How to enable Nautilus "open in terminal" option in Ubuntu 13.1

To enable Nautilus "open in terminal" option in Ubuntu 13.1;

These instructions are based on http://www.n00bsonubuntu.net/content/how-to-add-open-in-terminal-to-the-file-menu-on-ubuntu-13-04.

  • Apparently can_change_accels is required; 
  •    sudo apt-get install dconf-tools
  •    dconf-editor - org - gnome - desktop - interface - check can_change_accels
  • sudo apt-get install nautilus-open-terminal
  • nautilus -q
  • nautilus

How to install Apache OpenOffice on Ubuntu 13.1

To install Apache OpenOffice on Ubuntu 13.1;

  • Remove LibreOffice from system (else OpenOffice installation will conflict)
  •    sudo apt-get remove --purge libreoffice-core (uninstall libreoffice)
  •    sudo apt-get remove --purge libreoffice-common (uninstall libreoffice language pack?)
  •    sudo apt-get remove --purge libreoffice-style-human (uninstall libreoffice Ubuntu graphics?)
  • Download the latest Debian version of OpenOffice for your Language (http://www.openoffice.org/download/index.html)
  • tar -xvf Apache_OpenOffice_4.0.1_Linux_x86-64_install-deb_en-GB.tar.gz
  • sudo dpkg -i *.deb
  • cd desktop-integration
  • sudo dpkg -i *.deb
  • openoffice4 -writer
  • openoffice4 -impress
  • openoffice4 -calc
  • openoffice4 -base
  • openoffice4 -draw 

How to update packages on Ubuntu 13.1

To update packages on Ubuntu 13.1;
  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get dist-upgrade
Dist-upgrade is required to add/remove packages based on dependency resolution of the defined update (where as upgrade just modifies existing packages).

How to customise search bar search queries in Firefox

To customise search bar search queries in Firefox;

Sunday, February 2, 2014

How to build a custom version of the NEdit package on Ubuntu 13.1

To build a custom version of the NEdit package on Ubuntu 13.1;

These instructions assume nedit5.6UB-withSaveAllAndIncreaseFindDialogboxCharlengAndCtrlTabSwitchBetweenMultipleDocuments.patch is desired to be installed.

  • sudo apt-get install build-essential [in order to compile your own programs in Ubuntu]
  • sudo apt-get install nedit [this should install all necessary dependencies for nedit]
  • sudo apt-get remove nedit [remove official version of nedit]
  • sudo apt-get install libmotif-dev libxt-dev bison debuild(?) [install all build dependencies]
  • manually download nedit_5.6~cvs20081118.orig.tar.gz from http://packages.ubuntu.com/saucy/nedit
  • manually download nedit_5.6~cvs20081118-8.debian.tar.gz from http://packages.ubuntu.com/saucy/nedit
  • manually download nedit_5.6~cvs20081118-8.dsc from http://packages.ubuntu.com/saucy/nedit
  • dpkg-source -x nedit_5.6~cvs20081118-8.dsc    [this will create folder nedit-5.6~cvs20081118 with a debian subfolder]
  • rm nedit_5.6~cvs20081118-8.debian.tar.gz
  • rm nedit_5.6~cvs20081118-8.dsc
  • rm -rf debian
  • cp nedit5.6UB-withSaveAllAndIncreaseFindDialogboxCharlengAndCtrlTabSwitchBetweenMultipleDocuments.patch nedit-5.6~cvs20081118/debian/patches/
  • nedit nedit-5.6~cvs20081118/debian/patches/series
  •      add reference to nedit5.6UB-withSaveAllAndIncreaseFindDialogboxCharlengAndCtrlTabSwitchBetweenMultipleDocuments.patch
  • cd nedit-5.6~cvs20081118   
  • dpkg-buildpackage -uc -us
  • cd ..
  • sudo dpkg -i nedit_5.6~cvs20081118-8_amd64.deb
  • cp dotXresources $HOME/.nedit/.Xresources
  • nedit

See original post for more information regarding this patch;


How to firewall restrict all outgoing traffic to web/HTTP on Ubuntu 13.1 (useful for 3G connections)

To firewall restrict all outgoing traffic to web/HTTP on Ubuntu 13.1 (useful for 3G connections);

Setup Gufw Ubuntu Firewall graphical user interface;
  • sudo apt-get install gufw
  • gufw
  • gufw - Status - On
  • gufw - Incoming - Deny
  • gufw - Outgoing - Allow
  • close gufw
Now deny all output except ports 53, 80, 443, 8080 [NB port 80/8080 are for HTTP, port 53 is for DNS, and port 443 is for HTTPS];
  • sudo ufw deny out 1:52/tcp
  • sudo ufw deny out 1:52/udp
  • sudo ufw deny out 54:79/tcp
  • sudo ufw deny out 54:79/udp
  • sudo ufw deny out 81:442/tcp
  • sudo ufw deny out 81:442/udp
  • sudo ufw deny out 444:8079/tcp
  • sudo ufw deny out 444:8079/udp
  • sudo ufw deny out 8081:65535/tcp
  • sudo ufw deny out 8081:65535/udp
  • sudo ufw enable
Verify the settings;
  • sudo ufw status verbose

How to disable images in Firefox

To disable images in Firefox;
  • Open Firefox
  • about:config
  • permissions.default.image
  • change value to 2 (1 allows all images, 2 blocks all images, 3 allows only images from the same site to load and blocks third party images)

How to enable the classic Nautilus address bar on Ubuntu 13.1 (always use location entry)

To enable the classic Nautilus address bar on Ubuntu 13.1 (always use location entry);

These instructions are based on https://help.ubuntu.com/community/RestoreNautilusLocationBar.

  • sudo apt-get install dconf-tools
  • dconf-editor
  • org - gnome - nautilus - preferences - always-use-location-entry

How to activate the up folder action in Nautilus on Ubuntu 13.1 (set BackSpace shortcut key)

To activate the up folder action in Nautilus on Ubuntu 13.1 (set BackSpace shortcut key);

  • nedit $HOME/.config/nautilus/accel
  • replace the comment;
    ; (gtk_accel_path "<Actions>/ShellActions/Up" "<Alt>Up")
    with;
    (gtk_accel_path "<Actions>/ShellActions/Up" "BackSpace")

How to install Google Chrome on Ubuntu 13.1

To install Google Chrome on Ubuntu 13.1;

  • download google-chrome-stable_current_amd64.deb from Google.com (or 32bit version)
  • installing google-chrome using the gnome-software-center may not work (eg double clicking on google-chrome-stable_current_amd64.deb), so I recommend the following;
  • sudo dpkg -i google-chrome-stable_current_amd64.deb (this will say what dependencies are required)
  • install all dependencies; eg sudo apt-get install libxss1
  • sudo dpkg -i google-chrome-stable_current_amd64.deb

How to install a debian package (.deb) using the terminal

To install a debian package (.deb) using the terminal;

  • sudo dpkg -i package.deb
  • (or sudo apt-get install package.deb)

To remove a debian package (.deb) using the terminal;
  • sudo apt-get remove package
  • sudo apt-get autoremove package (to remove a package and its specific dependencies)

How to disable the touchpad in Ubuntu 13.1

To disable the touchpad in Ubuntu 13.1;
  • xinput list --name-only | grep -i Touchpad
  •     eg ETPS/2 Elantech Touchpad
  • xinput disable 'ETPS/2 Elantech Touchpad'
  • xinput enable 'ETPS/2 Elantech Touchpad'
Consider creating 2 executable files; enabletouchpad.sh and disabletouchpad.sh, such that these can be called when necessary (eg at WM startup).

Saturday, February 1, 2014

How to configure extra mouse buttons in Ubuntu 13.1 (eg Logitech MX620)

To configure extra mouse buttons in Ubuntu 13.1 (eg Logitech MX620);

1. Install xserver-xorg-input-evdev:
sudo apt-get install xserver-xorg-input-evdev

2. Install xte:
sudo apt-get install xautomation

3. install xbindkeys:
sudo apt-get install xbindkeys

4. Autostart xbindkeys;
gnome-session-properties (System > Preferences > Sessions > Startup Programs)
Add command: /usr/bin/xbindkeys

5. Configure xbindkeysrc:
gedit ~/.xbindkeysrc (create new file)
For example, add the following;

"xte "key BackSpace""
m:0x0 + b:8

"xte "key Return""
m:0x0 + b:9

NB to find out what a keyboard button is called, use xbindkeys -k
NB to find out what a mouse button is called, you can use xev.
button 1; left
button 2; middle
button 3; right
button 4; up scroll
button 5; down scroll
button 6; left scroll
button 7; right scroll
button 8; back
button 9; forward

6. Restart PC

---
Btnx configuration - UNSTABLE 

These instructions are based on http://awesomelinux.blogspot.com.au/2012/12/btnx-for-ubuntu-1204-and-1210-and-beyond.html


  • sudo apt-get install build-essential [in order to compile your own programs in Ubuntu]
  • download the btnx and btnx-config source files (eg btnx-master.zip and btnx-config-master.zip from https://github.com/cdobrich/btnx and https://github.com/cdobrich/btnx-config respectively)
  • sudo apt-get install libdaemon-dev libgtk2.0-dev libglade2-dev [install btnx dependencies]
  • unzip btnx-config-master.zip
  • unzip btnx-master.zip
  • cd btnx-config-master
  • ./configure
  • make
  • sudo make install
  • cd ..
  • cd btnx-master
  • ./configure
  • make
  • sudo make install
  • [Now both btnx and btnx-config are installed]
  • sudo btnx-config (NB admin privileges are required http://ubuntuforums.org/showthread.php?t=1613569)
  • Configurations - detect mouse and button
  •     Click 'press to start mouse detection'
  •     do not press the mouse buttons or move the mouse for 5 second
  •     move the mouse and press every button on it
  •     Click 'press to stop mouse detection'
  •     Click 'Forward'
  •     Click 'press to start button detection'
  •     click a chosen mouse button (eg the left mouse button) multiple times until the status bar is full
  •     Then label the Button
  •     Click Add and repeat for every other button (Click 'press to start button detection')
  •         Label the buttons as follows
  •         Button1Left
  •         Button2Right
  •         Button3Middle
  •         Button4Search
  •         Button5Back
  •         Button6Forward
  •         Button7ScrollHorizLeft
  •         Button8ScrollHorizRight
  •     Click OK
  • Buttons - select each button in turn, select a new keycode and tick enable (if desired)
  •     NB I use;
  •     Button5Back = KEY_BACKSPACE
  •     Button6Forward = KEY_ENTER
  • Configurations - restart btnx
Note the following may be required regularly upon system boot (especially when using multiple btnx configured mice);
  • sudo btnx-config - restart btnx (sudo /etc/init.d/btnx restart)

How to install icewm on Ubuntu 13.1

To install icewm on Ubuntu 13.1:

  • sudo apt-get install icewm icewm-gnome-support icewm-themes

icewm configuration recommendations;

Preferences
  • nedit $HOME/.icewm/preferences
[NB for some reason the existence of an icewm preferences file appears required for the keyboard to function properly on some laptops (eg up/down arrows)]

#  Show mailbox status on task bar    [not required on Ubuntu?]
TaskBarShowMailboxStatus=0

#  Show CPU status on task bar (Linux & Solaris)
TaskBarShowCPUStatus=0

#  Show network status on task bar (Linux only) [not required on Ubuntu?]
TaskBarShowNetStatus=0

#  Command to shutdown the system
ShutdownCommand="sudo poweroff"

#  Command to reboot the system
RebootCommand="sudo reboot"

# KeyWinClose = "XF86Search"
KeyWinClose="Alt+F4"

Permit the user to execute poweroff and reboot commands;
  • sudo visudo
  • Add this line at the end of the file (replacing enteryourusernamehere with your user name):
  • enteryourusernamehere ALL=NOPASSWD: /sbin/poweroff, /sbin/reboot

Startup
  • nedit $HOME/.icewm/startup
!#/bin/sh

/home/rich/disabletouchpad.sh

sleep 2
#required to give icewm taskbar some time to startup before applets are added

gnome-sound-applet &
#Volume Control applet

mate-bluetooth-applet &
#Bluetooth applet (bluetooth-applet is not available on Ubuntu 13.1)

mate-power-manager &
#Power Manager applet (gnome-power-manager is not available on Ubuntu 13.1)

/opt/extras.ubuntu.com/indicator-brightness/indicator-brightness &
#Brightness Control applet

nm-applet &
#Network Manager applet

gnome-settings-daemon &
#makes all GTK applications (eg Firefox) use the Gnome3/Unity graphics (dark grey)

xscreensaver -nosplash &

Keys
  • nedit $HOME/.icewm/keys
key "Super+L" xscreensaver-command -lock

[requires sudo apt-get install xscreensaver]

Menu
  • nedit $HOME/.icewm/menu
prog "firefox" /usr/share/app-install/icons/firefox.png firefox
prog "nautilus" /usr/share/icons/gnome/16x16/apps/system-file-manager.png nautilus --no-desktop --browser
prog "writer" /usr/share/icons/gnome/16x16/apps/openoffice4-writer.png openoffice4 -writer
prog "impress" /usr/share/icons/gnome/16x16/apps/openoffice4-impress.png openoffice4 -impress
prog "calc" /usr/share/icons/gnome/16x16/apps/openoffice4-calc.png openoffice4 -calc
prog "base" /usr/share/icons/gnome/16x16/apps/openoffice4-base.png openoffice4 -base
prog "draw" /usr/share/icons/gnome/16x16/apps/openoffice4-draw.png openoffice4 -draw
prog "calculator" /usr/share/icons/Humanity/apps/16/accessories-calculator.png gnome-calculator
prog "gimp" /usr/share/icons/hicolor/32x32/apps/gimp.png gimp
prog "vlc" /usr/share/icons/hicolor/16x16/apps/vlc.png vlc --loop
prog "terminal" /usr/share/icons/Humanity/apps/32/gnome-terminal.png gnome-terminal
prog "icewm menu" /usr/share/icons/gnome/16x16/mimetypes/text-x-preview.png nedit /home/yourusername/.icewm/menu
prog "icewm preferences" /usr/share/icons/gnome/16x16/mimetypes/text-x-preview.png nedit /home/yourusername/.icewm/preferences
prog "icewm startup" /usr/share/icons/gnome/16x16/mimetypes/text-x-preview.png nedit /home/yourusername/.icewm/startup
prog "nedit" nedit nedit
prog gnome-screenshot gnome-screenshot gnome-screenshot

Here are some raster icons (.png) for icewm;

Toolbar
  • nedit $HOME/.icewm/toolbar
prog "terminal" /usr/share/icons/Humanity/apps/32/gnome-terminal.png gnome-terminal
prog "firefox" /usr/share/app-install/icons/firefox.png firefox

Theme

To enable a classic icewm theme (dark grey);
  • IceWM menu - Settings - Themes - I - Infadel2

Power Settings

To modify the power settings of icewm in Ubuntu, edit logind.conf. For example, to change the close lid action from suspend to nothing;
  • sudo gedit /etc/systemd/logind.conf
  • change #HandleLidSwitch=suspend to HandleLidSwitch=ignore

Package cache location in Ubuntu 13.1

Package cache location:
/var/cache/apt/archives

To clear the package cache;
sudo apt-get clean

How to install dual boot Ubuntu 13.1 and Windows 8

To install dual boot Ubuntu 13.1 and Windows 8:

WARNING: ADVANCED USERS ONLY AND APPLY AT YOUR OWN RISK; Microsoft has effectively has taken over the PC bios nowadays (in a vain attempt to pretend Linux does not exist?) and it is therefore apparently very easy to destroy your bios.

These instructions are based on http://www.linux-hardware-guide.com/2013-05-05-samsung-series-5-ultra-touch-540u3c-a01-133-ultrabook-intel-core-i5-3317u-17ghz-8gb-ram-128gb-ssd-intel-hd-4000-touchscreen, and may therefore only be applicable to specific Samsung laptops (eg Series 5 535U/540U etc). Note the Ubuntu User Winter 2013 "How to Install Ubuntu 13.1" article made no mention of disabling Secure Boot, which was very strange considering that the above linux-hardware-guide instructions say that this step is system critical.

  • Assume Windows 8 is installed
  • Use Windows (or GParted) to split the Windows C: drive and create a free partition (for installation of linux)
  •     NB GParted can be installed on USB or CD;
  •     if CD, burn the GParted .iso image to the CD
  •     if USB, unzip gparted archive (.zip) onto the USBDRIVE: (using Windows Explorer), and double click on [USBDRIVE:]\utils\win32\makeboot.bat]. Note it is extremely important to execute makeboot.bat on the [USBDRIVE:] as indicated above [NEVER execute it on hard disk, eg C:]
  • Reboot and enter bios (eg F2)
  •     (bios setup information);
  •     Advanced - Fast Boot[/Bios] Mode - Disabled
  •     Boot - Secure Boot - Disabled [apparently this is critical..]
  •     Boot - Secure Boot - OS Mode Selection - CSM OS
  •     Boot - Boot Priority Order - set USB/CD first (make sure USB/CD is plugged in to select boot order)
  • download/purchase and install Ubuntu 13.1 DVD (eg off the internet / from a news agency magazine such as Ubuntu User)
  •     select 'install Ubuntu along side Windows'
  •     Ubuntu should detect that you have created a free partition for it to use and use it
  • Once the system is installed, execute the following command (this should enable use of use apt-get if a network connection was not present during Ubuntu installation);
  •     sudo apt-get update

NB to use Windows again, edit the bios;
  •     Reboot and enter bios (eg F2)
  •     Advanced - Fast Boot[/Bios] Mode - Enabled
  •     Boot - Secure Boot - Enabled