How to launch application as root from Unity Launcher?


Im posting this in-respone to the question @Chris asked in comments :

Suppose you want to create a launcher which will open "file manager(nautilus)" as root. Then you can do this:

Open terminal. Type:

sudo -H gedit /usr/share/applications/nautilus_root.desktop

Hit enter. When asked, enter your login password and hit enter. This will open gedit (text editor). Now, paste the following there:

[DesktopEntry] Encoding=UTF-8 Name=Nautilus(Root) Comment=FileManager Exec=gksu nautilus Icon=file-manager Categories=System; Type=Application Terminal=0

Now, just save it and exit. You are done. Now if you search on dash then you will find a new launcher "Nautilus (Root)". Clicking this will ask you password, and upon authentication nautilus will be opened as root.

Note: Be careful when you are running "Nautilus (Root)". In this mode you can delete almost anything from / and break the...

0 0

What I was looking for was the "Main Menu".

I could not recall that it is installed as "Alacarte".

Thanks Mcduck.

The problem I have with the use of gksu to launch a
graphical application such as nautilus from a terminal
is that it locks your terminal to that app, leaving you
with two windows on your desktop to run a single app.

I was not aware of sudo -i as a way to access the root prompt #.
I use to do this with "sudo gnome-terminal" or "gksu gnome-terminal".
I like "sudo -i" because it does not add another terminal to your desktop.
I'm surprised that it does not ask for a password.

I don't understand the difference between sudo and gksu. gksu seems
to be used with graphical apps and sudo is apparently not restricted.
In my experience they're completely interchangeable.

Thanks as always for your...

0 0

Skip the boring stuff – download the .desktop file instead of making your own!

When launching graphical applications as root you will normally open up a Terminal, and then launch the program with the sudo -i command. However, if you are often going to launch applications as root, then you may wish to create a shortcut (.desktop) file to easily launch your applications.

In Ubuntu, Nautilus is one of the most common applications to be run as root, so we will use this as an example. To launch this from your own custom .desktop file, follow the directions below:

1: Go to your /home/YourUser from a Nautilus window, and then right-click and choose create new file. You can later move this file to somewhere else if you wish.

2: Edit your new Nautilus Launcher.desktop file with gedit, and then copy and paste the below into the file and save it:

[Desktop Entry] Type=Application Terminal=false Exec=nautilus --new-window Name=Nautilus Icon=system-file-manager...
0 0

Ubuntu Unity Launcher

You are Welcome! This Article Shows You You Step-by-step How-to Create a New Launcher on the Application Menu of Ubuntu Unity Desktop.

And the Practical Example Here illustrates How to Add a Firefox Nightly Entry into the Internet Apps Group.

Finally this Technique is Useful for Adding Any New Software on Any Unity/Gnome Linux Desktop.

Check if the alacarte Package is there

which alacarte

If Not then Install It with:

sudo apt-get install alacarte

If Got “User is Not in Sudoers file” then Look: Solution

Then Launch Alacarte Tool

Select or Create Menu

Click on New Item

Fill In at least Name and Path to Binary
Eventually Browse the File System to Find the Executable…

Next Click to the Left On the Launcher Icon
Then Insert or Browse the Path to your Application Name .png Icon file.
Here Below See How Locating Files/Icons on Linux Command...

0 0

Mainly I am looking for a way to pin an application to the Unity launch bar, and run it as root.

Currently, even if I start the application with sudo, and pin it after it starts, it will start as current user next time.

Sad, but there is no context menu option "run as ...".

Update: I switched to gnome3 and now I'm happy, I'm missing only the search.

If you want the app to always run as root

Pin the application to the launcher as normal.

Locate the applications .desktop file which will be in either:

/usr/share/applications/APPNAME.desktop ~/.local/share/applications/APPNAME.desktop or somewhere else, use locate .desktop|grep APPAME

Open with gedit:

gksudo gedit /usr/share/applications/APPNAME.desktop

Then change the line



Exec=gksudo -k -u root APP_COMMAND


This command will also keep your environment which is very usefull if you need to connect to others servers and use your...

0 0

Ubuntu 11.04 Natty Narwhal replaces the familiar Windows-like Gnome desktop environment with the Unity desktop environment. Personally, I found the switch rather jarring at first. I think I may have even been angry. But after spending some time with Unity, I think I’m starting to get it–especially since I run Ubuntu on a netbook, which is Unity’s forte.

Anyway, I was most devastated when I lost my precious panel launchers. Similar to the Windows Quick Launch Bar, Gnome let you launch frequently used applications and documents from convenient icons along the top panel.With Unity, there is no such thing. Rather, all graphical shortcuts are confined to the vertical launcher bar, which runs the height of the left-hand side of the screen and auto-hides.

While the Gnome panel was comparable to the Windows taskbar, the Unity launcher is more like the OS X dock. Application icons pop up here when they are running, and you can choose to keep your favorites there permanently...

0 0

The recent upgrade to Ubuntu 12.04 Precise Pangolin left me somewhat hanging when it comes to creating launchers on the desktop, and also in the Unity Launcher (also called quicklaunch in some places) for Zend Studio and PHPStorm. In Gnome prior to Unity in Ubuntu it was easy to right click the desktop and select Create Launcher to create icons on the desktop to launch applications or scripts, but in 12.04 that options is gone. So here is how I solved some of the issues.

I will cover adding Eclipse to the launcher, adding Zend Studio to the launcher, and PHPStorm to the launcher.

Method 1 (easiest)

For Netbeans and Eclipse based editors like Zend Studio or Aptana it is not too bad. I created a {name}.desktop files for each one and put it in the /home/{username}/.local/share/applications/ directory. Here is how I created a zendstudio.desktop file:

Note: If you want this option to be available for all users you can alternatively create the file in the...

0 0

If you have too many applications crowding all the space in Unity launcher, you might be thinking of a better way to manage them. Making icons tinier by reducing the icon size is one way, but would it not be better if you could group a bunch of icons? This is what we already do in Android and iPhones. Group the apps together and save the screen space.

LauncherFolders is one such application for Ubuntu Unity that allows you to group apps, files, folders, chrome web apps, links and shell scripts in folders. And these folders then can be used directly in Unity launcher. Reminds of another similar tool Drawer, isn’t it?

Install LauncherFolders in Ubuntu 14.04

To install LauncherFolders in Ubuntu 14.04, you can use the official PPA. Open a terminal and use the following commands:

sudo add-apt-repository ppa:asukhovatkin/unity-launcher-folders sudo apt-get update sudo apt-get install unity-launcher-folders

Alternatively, you can download the .deb...

0 0

While Unity Launcher is arguably one of the most useful highlights of the Unity graphical shell, it comes with its own set of issues. For example, you can’t place it the way you want (there are only a couple of placement options at the moment), and when the launcher gets overcrowded with app icons, things get slightly messy.

Talking about the second problem, there could be some solutions. For example, you can customize the launcher in a way that it contains different icons in different workspaces. But sometimes all you wish for is a way to just group icons together based on their type – all web browsers in one group, all social media apps in another, and all media players in a separate one.

If you are looking for such a solution, then look no further, as in this article we’ll be discussing a way to achieve this.

For this, you first need to download and install a tool called Unity Launcher Folders. The downloaded file will most likely be in .deb format, so, you...

0 0

For applications that don’t have launcher icons for Ubuntu, you can manually create them to make available from the Unitys search results.

Yestoday I installed Celtx 2.9.7 on my Ubuntu which doesn’t have a launcher icon by default. I need to run a command in terminal to open it everytime.

Finally I got it fixed, and here’s how:

1.) Open terminal by pressing Ctrl+Alt+T or from Unity Dash.

2.) Run below command to install required package gnome-panel without installing the recommends.

sudo apt-get install gnome-panel --no-install-recommends

3.) From now, you can create a custom launcher by running this command:

sudo gnome-desktop-item-edit /usr/share/applications/ --create-new

It brings up a dialog, where you can set the launcher icon, name, and command to run it.

The Celtx was installed into /usr/local/celtx/ directory, and run by root. So I found the icon from that directory, and type in command with gksudo at...

0 0

I've got a gui application that runs a couple of scripts, which require root access. Normally it is run with sudo, but I've modified the scripts (by running only commands that require root access with sudo prefix) so that the main thing works if launched normally.

One occassion when it doesn't work is when I use openbox autostart script to run it on login. It launches fine, but scripts fail to work and sudo.log shows no activity during that period.

Is there any way to make this setup work?

You can use gksudo instead of sudo to run GUI apps from terminal as root.

I figured it out. As far as I can tell openbox won't allow sudo (or gksudo or anything of the sort) in its autostart. chmod +s on the executable is the way I forced running the application as root. It also didn't work at first, because in qt5 (which was used to build the app) you cannot use suid by default - I had to change it in...

0 0

Ubuntu's Unity desktop environment has divided the opinion of many Linux users over the past few years but it has matured very well and once you get used to it you will see that actually it is very easy to use and highly intuitive.

In this article, I will show you how to use the launcher icons within Unity.

The launcher sits on the left-hand side of the screen and cannot be moved. There are however certain tweaks that you can make to resize the icons and to hide the launcher when it isn't in use and I will show you how to do this later on in the article.

The Icons

Ubuntu comes with a standard set of icons attached to the launcher. From top to bottom the functions of these icons are as follows:

Open the dashFilesFirefoxLibreOffice WriterLibreOffice CalcLibreOffice ImpressUbuntu Software ToolAmazonSystem SettingsTrash

Left clicking opens the individual function for the icons.

The top option opens the Unity Dash which provides a...

0 0

The use of gksu and gksudo is not recommended any more. The recommended method is to use Polkit. The easiest way to add Polkit files for Nautilus is to install nautilus-admin

To install nautilus-admin in Ubuntu, open a terminal by pressing Ctrl+Alt+T and use the following command:

sudo apt-get install nautilus-admin

The rest involves editing the `nautilus.desktop file and adding the correct command:

Copy the nautilus.desktop file, representing nautilus in the launcher, from the global directory /usr/share/applications to ~/.local/share/applications

cp /usr/share/applications/nautilus.desktop ~/.local/share/applications

Open the file with (e.g.) gedit, look for the line:


Change it into:

Actions=Window;Open as Administrator;

Add to the very end of the file:

[Desktop Action Open as Administrator]Name=Open as AdministratorExec=pkexec nautilus

Save and close the file.

The added bonus of installing...

0 0

Hide the Unity Launcher in Ubuntu 14.04 automatically when you’re not using it. You can show it again by moving the mouse to the left side, or the upper-left corner of the screen. This is a great trick to clear extra space on the screen. Let us see how:

Auto-Hide the Unity Launcher In Ubuntu 14.04

1. Click the system menu in the upper-right corner of the screen on the top panel.
2. Select “System Settings” from the drop-down menu.

3. Under the “System Settings” dialog box, click “Personal” then click “Appearance.”
4. On the “Appearance” tab, click the “Behavior.”
5. Click the switch to ON. You can see the ON/OFF switch on the right side of the “Behavior” tab.

6. When you click the swithc ON, it turns orange and you can now see the additional options in the “Auto-hide the Launcher.”
7. Under “Reveal location,” select the “Left side” or “Top left corner” of the screen to show the Unity Launcher.
8. Adjust the “Reveal...

0 0

Ubuntu 17.10 uses Wayland in the default session and Xorg for optional. However, many graphical applications need to run as root so far does not launch in Wayland.

You’ll get following similar errors while running graphical applications via root:

For some applications, e.g., Synaptic Package Manager, Grub Customizer, Gparted, and Ubuntu Tweak, they does not launch in Wayland.

Or you may get following error when trying to launch them via gksu command:

Failed to run *** as user root. Unable to copy the user’s Xauthorization file.

Starting graphical application via sudo in terminal window will get error:

No protocol specified. Gtk-WARNING **: Cannot open display: :0

The most straightforward workaround is to use xhost to temporarily allow the root user to access the local user’s X session.

To do so, run command:

xhost si:localuser:root

After running the command, these graphical applications can be launched...

0 0

GNOME desktop components:

GNOME core components include:

Control Center: This collection of applications customizes the GNOME environment. gnome-panel : This application provides the tool bar and menu system to launch applications and host panel applets. Panel also interfaces with session manager (gnome-session) when exiting the desktop. Panel also interfaces with session-manager when exiting the desktop and managing "saved" sessions when launching the desktop. nautilus : Manages desktop icons and provides a file manager. gdm : GNOME Display Manager (login screen) This handles X-Authentication, netwrk desktop access (XDMCP), graphical login prompt, logos, ... GNOME VFS: Uses mime types for transparent file access. Window manager. None specified. Can use Metacity, Sawfish, ... Component management: D-Bus: cross-desktop message bus for sending events between various applications, the desktop, and...
0 0

Sublime Text is an awesome text editor. If you’ve never heard of it, you should check it out right now.

I’ve made this tutorial because there’s no installer for the Linux versions of Sublime Text. While that’s not a real problem, I feel there is a cleaner way to go around this. Also, this post will show you how to integrate Sublime Text to Unity (which, I’m glad to report, has now matured into a fully functional user interface). So let’s get on with this. Here is my how to install Sublime Text on Ubuntu tutorial.

[This tutorial has been updated following feedback from AskUbuntu. Also, you need to do these steps using your login. Do not start by typing “sudo -s”!]

Step 1

Download the tarfile that suits you best and extract it. Here’s the command to extract tar.bz2 files:

tar xf Sublime\ Text\ 2.0.1\ x64.tar.bz2

You’ll notice that I got the 64-bit version. The reason is that it’s lightning fast. So, go for that if you can!


0 0