0

As per my project requirement, I need to hide the Unity launcher (if present) automatically on startup of an Ubuntu 14.04 machine.

If I run the command:

dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 1

into the terminal it works.

But as I mentioned already I need to hide the Unity launcher automatically on startup of an Ubuntu 14.04 machine, so to do this I have written this command in "~/.profile", but unfortunately the command is not working as expected on startup.

All my other commands work as expected on startup when put into "~/.profile".

The reasons behind writing this command in "~/.profile" are listed below.

  1. The command to hide the Unity launcher only works when we run the command with logged in user privileges and doesn't work when we run it with sudo privileges.

If I write this command in "/etc/init.d/myscript", "/etc/rc.local", "/etc/init/myjob.conf" then it starts the command with sudo privileges and it will not work.

  1. GUI applications don't start automatically on startup in Ubuntu 14.04 when we write the command into "/etc/init.d/myscript", "/etc/rc.local", "etc/init/myjob.conf" but if we write the command into "~/.profile" then it starts both GUI and non-GUI applications automatically on startup (I have tested the same myself).

Some useful links are as below.

https://stackoverflow.com/questions/32067817/qt-gui-application-not-starting-automatically-on-startup-in-ubuntu-14-04

Shell script to remove unity launcher(if present in Ubuntu 14.04 ) and/or the xfce panel (in the case of xubuntu)

How do I run a script at start up?

Can anyone please let me know how can I hide the Unity launcher (if present) automatically on startup of an Ubuntu 14.04 machine so that it doesn't reveal or show when mouse cursor moves towards the left edge of the screen (I want to set the reveal sensitivity to low also)?

User2546
  • 179

2 Answers2

1

Install Unity Tweak Tool to customize the behavior of Unity Launcher.

Open a terminal and execute:

sudo apt-get install unity-tweak-tool

Open the tool, click on Launcher Tab under category Unity and tweak.

A.B.
  • 92,125
cl-netbox
  • 31,491
1

~/.profile is meant to set the user's environment, and is not meant to run commands / scripts at startup (unless they serve the purpose of setting the user's environment); you can't expect every command / script to work.

Instead, adding the command to Startup Appications, which is meant to run scripts at startup, works:

dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 1

The entry to change the edge responsiveness is /org/compiz/profiles/unity/plugins/unityshell/edge-responsiveness (it ranges from 0,20000000000000001110 to 8,00000000000000000000 in Vivid), so to set both (you must put a dot after the integer part regardless of a non-present fractional part):

dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 1; dconf write /org/compiz/profiles/unity/plugins/unityshell/edge-responsiveness 4.

Nonetheless, if you need to run a whole script on startup, you can put the commands into the script and run the script:

bash /path/to/script.sh
#!/bin/bash
# ...
dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 1
dconf write /org/compiz/profiles/unity/plugins/unityshell/edge-responsiveness 4.
# ...
kos
  • 41,268