Categories
Command Line Linux Ubuntu

Ubuntu 12.04 – Moving The Windows Buttons Back To The Right.

Those pesky windows buttons (maximise, minimise and close) default to the left of the menu bar after a new Ubuntu installations, and it’s been happening since 10.04. Most people, like myself, are stuck in our ways and just want them back where they belong. It’s pretty easy to do this, just open up a terminal (ctrl+alt+t) and copy in the following:

gconftool -s /apps/metacity/general/button_layout -t string menu:minimize,maximize,close

Once you hit enter, you should see the buttons return to their rightful place on the right, also in the right order.

Categories
Arch Linux Blog Command Line Fedora Linux Posts Ubuntu

Switching Between Two Resolutions in Linux

I have a TV and my monitor connected to my PC by a VGA switch box but what’s annoying is they aren’t the same resolution. This causes problems because I can’t see what I’m doing when I have switched to TV and usually have to leave the setting manager open so that when I change between them I just have to hit return and the resolution changes. That’s great and all but it’s far more effort than I want for something I do fairly often.

My plan was initially to create two xorg.conf files and switch between them using a script, I figured this would be the easiest way even though I haven’t messed around with xorg stuff for a few years ever since things just started working better in Linux. Turns out I couldn’t even find where they keep the xorg.conf file, it sure isn’t in /etc/X11 where it was the last time I looked..

On the search for this file though I came across another useful tool called xrandr, which essentially allows you to change the resolution from the command line.

Xrandr is used to set the size, orientation and/or reflection of the outputs for a
screen. It can also set the screen size.

If invoked without any option, it will dump the state of the outputs, showing the
existing modes for each of them, with a ‘+’ after the preferred mode and a ‘*’
after the current mode.

There are a few global options. Other options modify the last output that is spec‐
ified in earlier parameters in the command line. Multiple outputs may be modified
at the same time by passing multiple –output options followed immediately by
their corresponding modifying options.

For more information on xrandr check out the manual page (or type man xrandr in terminal).

It turns out it’s an extremely easy tool to use, with a command as simple as the following changing the resolution:

xrandr --output VGA1 --mode 1440x900

So the next thing I did was create the following script which allows the resolution to switch between 1440×900 and 1360×768 (my monitor and my TV native resolutions).

#!/bin/bash

TV="1360 x 768"
MONITOR="1440 x 900"

TEST="$(xrandr | grep current | sed -e 's/.*current //;s/, maximum.*//')"

#echo $TEST

if [ "$TEST" == "$MONITOR" ]
        then
                xrandr --output VGA1 --mode 1360x768

elif [ "$TEST" == "$TV" ]
        then
                xrandr --output VGA1 --mode 1440x900

else

        exit

fi

This script simply checks what the current resolution is being used and then toggles between the two set resolutions.

Categories
Arch Linux Linux Posts Ubuntu

HowTo: Disable Mouse Scroll to Switch Desktop – OpenBox

Open up the openbox config file, it should be located in /home/username/.config/openbox/ but if it’s not you might have to do a little digging.

nano /~.config/openbox/rc.xml

Find the following lines and remove or comment them out, you can use Ctrl+W in nano to find:

      
        
      
      
        
      

Note: XML comments are as follow:<-- Comment -->

Save with Ctrl+X, Y, Enter (if you’re using nano) and restart OpenBox (Preferences -> OpenBox Config -> Restart) and all should be done.

Categories
HowTo Posts Ubuntu Video

HowTo: Switch the Window Menu Buttons Back to the Right – Ubuntu 10.04 / 10.10 / 11.04

I’m not an OSX person and personally prefer my minimise, maximise and close buttons to be in that order on the right, which they are not as default on the new Ubuntu 10.04 (Lucid Lynx) so here’s how you can swap them back to their rightful place (pun intended).

This can be done either of two ways:
Use the following one line command to edit gconf (for more info type man gconftool):

gconftool -s /apps/met>gconftool -s /apps/met>gconftool -s /apps/metacity/general/button_layout -t string menu:minimize,maximize,close

OR
Using gconf-editor (the GUI version):

  1. In terminal type: gconf-editor
  2. Navigate to /apps/metacity/general
  3. Change button_layout to: menu:minimize,maximize,close
  4. Hit enter and you are done.