Archives For Elementary OS Luna

This simple tutorial will show you how to add ‘Open as Administrator’ or ‘Open as root’ to Pantheon Context menu in Elementary OS Luna. So that you can easily open system files or folders with super user privilege through the default Pantheon file browser.

First take a look at the screenshots:

open file as root in elementary os

open file as root in elementary os

open folder as root in elementary os

open folder as root in elementary os

Before getting started, search for and install gksu from Software Center. It is a Gtk+ frontend allows graphical programs to ask a user’s password to run another program as root / administrator.

Open files as root in Panthen Context Menu:

It’s a little different to Ubuntu Nautilus. Because I don’t know how to use if conditional statements in ‘.contractor’ files, so I divided this into two parts: Open files as root and Open folders as root.

1. Use your favorite editor to create and edit the config file. Here I use gedit (press Ctrl+Alt+T to open terminal for running commands):

sudo apt-get install gedit

sudo gedit /usr/share/contractor/scratch-openasroot.contract

2. Copy and paste below lines into the file and save it.

[Contractor Entry]
Name=Open file as root
Icon=scratch-text-editor
Description=open file as root with scratch
MimeType=text
Exec=gksudo scratch-text-editor %U
Gettext-Domain=scratch-text-editor

This will add an option “Open file as root” to Pantheon context menu, which open text files as root user with Scratch Text Editor (the default editor for eOS).

Open folders as root in Panthen Context Menu:

1. Use your favorite editor to create and edit the config file:

sudo gedit /usr/share/contractor/folder-openasroot.contract

2. Copy and paste below lines into the file and save it.

[Contractor Entry]
Name=Open folder as root
Icon=pantheon-files
Description=Open current folder as root privilege
MimeType=inode;
Exec=gksudo pantheon-files %U
Gettext-Domain=pantheon-files

This adds the option ‘Open folder as root’ to context menu, which open folders as root privilege.

Remember, you need a restart to get things done. Enjoy!

If you’re not comfortable with the eOS style window buttons, here’s how to add minimize buttons and move close, minimize, maximize buttons to right or left.

Because Elementary OS Luna is based on Ubuntu 12.04 Precise. So the setting is kinda similar. All you need to do is install Dconf Editor and change the value of button-layout.

window buttons eOS

1.) To get started, first install Dconf Editor. Open Software Center from the dock, search for and install dconf-tools. Or you can run below command in terminal:

sudo apt-get install dconf-tools

2.) Open Dconf Editor from the top-left app menu.

3.) Navigate to org > pantheon > desktop > gala > appearance. There you can change the value of button-layout to:

:minimize,maximize,close will add the minimize button, and move all window buttons to right.
close,maximize,minimize: will add the minimize button, and move all window buttons to left.

move window buttons eos

You may find that colon ‘:’ is the line of demarcation. Button names before (or after) the colon will set them to left (or right) of window title bar.

If the brightness controls don’t works in your system or you’re not satisfied with the default Fn function key, here’s an app indicator allows to change screen brightness in all the possible brightness values. The applet works in Ubuntu and its derivatives, such as Linux Mint and Elementary OS Luna.

brightness control indicator

It’s useful for me because the Fn+Arrow key in my laptop only change the brightness in 4 levels (zero, one third, two-thirds, full).

Features:

  • Clicking the icon shows you all the possible brightness values, to a maximum of 15 steps.
  • The current value is indicated with a dot.
  • Clicking a menu item sets the brightness to the desired value.
  • Scroll wheel event is enabled on the icon. Scrolling up means higher brightness, scrolling down lower.
  • Control screen brightness with custom keyboard shortcuts.
  • Install Brightness Indicator:

    Press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run below commands one by one to install the indicator from PPA:

    sudo add-apt-repository ppa:indicator-brightness/ppa
    
    sudo apt-get update
    
    sudo apt-get install indicator-brightness

    Or you can download the .deb package and double-click to install it from Launchpad.net

    Once installed, open it from the app menu. Add these commands to your custom keyboard shortcuts to control brightness with your keyboard. You need Elementary Tweak to add a custom shortcut key.

    /opt/extras.ubuntu.com/indicator-brightness/indicator-brightness-adjust --up

    and:

    /opt/extras.ubuntu.com/indicator-brightness/indicator-brightness-adjust --down

    brightness control shortcut key

    The Elementary OS Luna – Ubuntu 12.04 Precise based system – comes with lightweight browser Midori. To get Flash working for it, you’ll need to install ndiswrapper and do some tweaking. It’s not difficult, just folow the below steps, copy and paste commands into terminal and hit enter to run.

    1.) To get started, press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run command to install the flashplugin-installer.

    sudo apt-get install flashplugin-installer nspluginwrapper

    install flash for eos

    2.) Then run below commands one by one to get the flash working.

    sudo nspluginwrapper -i /usr/lib/flashplugin-installer/libflashplayer.so
    
    nspluginwrapper -v -a -n -i

    enable flash for eos

    That’s it. Restart your browser and enjoy!

    UPATE: As KW said, if previous commands does not work, just move the libflashplayer.so file to the /usr/lib/mozilla/plugins folder

    Are you using the Elementary OS instead of Ubuntu? Well, here I’ll show you how to add the ‘Open in terminal’ option to the Pantheon file manager right-click menu. So that you can quickly open terminal and automatically navigate to the current directory in Pantheon.

    open in terminal for pantheon

    To get started, use your favorite editor to create the config file /usr/share/contractor/openinterminal.contract and edit it. I prefer Gedit, so I install it and edit the file via below commands:

    sudo apt-get install gedit
    
    sudo gedit /usr/share/contractor/openinterminal.contract

    Copy and paste below lines into the file and save it.

    [Contractor Entry]
    Name=Open in terminal
    Icon=terminal
    Description=Open in terminal
    MimeType=inode;application/x-sh;application/x-executable;
    Exec=pantheon-terminal -d %U
    Gettext-Domain=pantheon-terminal

    Log out and back in and done! Or you need a restart if it doesn’t work properly.