1

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

If anybody has idea about the same then please let me know.

Thanks

User2546
  • 179
  • 1
  • 5
  • 16
  • That's simple enough. What are the package names you want to remove? – terdon Jul 01 '15 at 08:54
  • manojpatidar, Are you referring to a launcher or the launcher? If the first is the case, it' s a dupe of: http://askubuntu.com/questions/611162/how-do-you-add-remove-applications-to-from-the-unity-launcher-from-command-line/611177#611177 – Jacob Vlijm Jul 01 '15 at 10:47
  • Thanks all for your comment. Firstly I want that when my program runs then Unity launcher should hide else it should show. If we can't do so then only the last option, remove unity launcher from my Ubuntu 14.04 machine. Actually when my program runs then it should run on full screen mode. If anyone have any doubt/query then please let me know. – User2546 Jul 01 '15 at 10:59
  • I have tried the below way. Command to hide the launcher : gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-hide-mode 1 Command to show the launcher : gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-hide-mode 0 then go to System Setting -> Appearance -> Behavior -> Set Auto-hide Launcher to ON and set Reveal sensitivity to low and it works but I want to set Reveal sensitivity to low by shell script. – – User2546 Jul 01 '15 at 11:08

2 Answers2

2

Update:

To completely remove the launcher for the time your script execution, I'd disable the unity compiz plugin.

We have such a script in Checkbox, that I'm pasting here for convenience:

#!/usr/bin/env python3
# This file is part of Checkbox.
#
# Copyright 2014-2015 Canonical Ltd.
# Written by:
#   Daniel Manrique <roadmr@ubuntu.com>
#   Sylvain Pineau <sylvain.pineau@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.
#
# Checkbox is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
"""
manage_compiz_plugin
====================

This script allows enabling or disabling compiz plugins using
gsettings. Changes take effect on the fly.
"""

from gettext import gettext as _
import argparse
import gettext
import os
import sys
import subprocess
import time

PATH="org.compiz.core:/org/compiz/profiles/unity/plugins/core/"
KEY="active-plugins"

gettext.textdomain("2013.com.canonical.certification.checkbox")
gettext.bindtextdomain("2013.com.canonical.certification.checkbox",
                       os.getenv("CHECKBOX_PROVIDER_LOCALE_DIR", None))

plugins = eval(subprocess.check_output(["gsettings", "get", PATH, KEY]))

parser = argparse.ArgumentParser(description=_("enable/disable compiz plugins"),
                                 epilog=_("Available plugins: {}").format(plugins))
parser.add_argument("plugin", type=str, help=_('Name of plugin to control'))
parser.add_argument("action", type=str, choices=['enable', 'disable'],
                    help=_("What to do with the plugin"))

args = parser.parse_args()

if args.action == 'enable':
    if args.plugin in plugins:
        raise SystemExit(_("Plugin {} already enabled").format(args.plugin))
    plugins.append(args.plugin)
else:
    if args.plugin not in plugins:
        raise SystemExit(_("Plugin {} doesn't exist").format(args.plugin))
    plugins.remove(args.plugin)
subprocess.call(["gsettings", "set", PATH, KEY, str(plugins)])

time.sleep(3)

To disable the unity plugin:

./manage_compiz_plugin unityshell disable

To restore it:

./manage_compiz_plugin unityshell enable

First version (using auto-hide):

To hide the unity launcher, use the following commands:

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

To restore it, simply use:

dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 0
dconf write /org/compiz/profiles/unity/plugins/unityshell/edge-responsiveness 2
  • I have tried as per your suggestion but when I move cursor to left of the screen then it again shows launcher. So to hide it permanently I go to System Setting -> Appearance -> Behavior -> Set Auto-hide Launcher to ON and set Reveal sensitivity to low and it works but I want to set Reveal sensitivity to low by shell script. – User2546 Jul 01 '15 at 11:12
  • @manojpatidar: See my edit ;) – Sylvain Pineau Jul 01 '15 at 11:13
  • I have tried dconf write /org/compiz/profiles/unity/plugins/unityshell/launcher-hide-mode 1 dconf write /org/compiz/profiles/unity/plugins/unityshell/edge-responsiveness 0 then it hides launcher but when I move cursor to left of the screen then it again shows launcher. I just want to hide it permanently. – User2546 Jul 01 '15 at 11:17
  • @manojpatidar: I don't think you can disable it completely without disabling the unity plugin. Let me check – Sylvain Pineau Jul 01 '15 at 11:23
  • Sure take your time. Btw I have did the same by go to System Setting -> Appearance -> Behavior -> Set Auto-hide Launcher to ON and set Reveal sensitivity to low and it works but I want to set Reveal sensitivity to low by shell script (As I already mentioned in my above comments) – User2546 Jul 01 '15 at 11:27
  • @manojpatidar: Please let me know if disabling the unity plugin works as expected. Note, keep a terminal open to enable it again! – Sylvain Pineau Jul 01 '15 at 11:32
  • Thanks @ Sylvain Pineau , I have tested it as per below. It works at my end and it hides/shows unity launcher in Ubuntu 14.04 as per expected.
    ./manage_compiz_plugin unityshell disable && sleep 5 && ./manage_compiz_plugin unityshell enable
    – User2546 Jul 01 '15 at 12:48
  • @ Sylvain Pineau, it is working at my end if I run command like "./manage_compiz_plugin unityshell disable" but not working with sudo privileges like "sudo ./manage_compiz_plugin unityshell disable". When I run it with sudo privileges then it removes the unityshell plug-in but it does not hide unity launcher. – User2546 Jul 06 '15 at 10:20
  • @manojpatidar avoid touching compiz settings suing sudo as it may have undesirable side effects on our system. gstettings/dconf are a per user system so you really don't need to use sudo here – Sylvain Pineau Jul 06 '15 at 11:36
  • @ Sylvain Pineau, Thanks for your comment. But I need to run my program with sudo and in that progrom I am running this script. So this script also run from sudo and it is not working. – User2546 Jul 06 '15 at 11:46
  • @ Sylvain Pineau, I have tried with the same as per below links but still not fulfilling my requirement. https://stackoverflow.com/questions/31260982/drop-undo-sudo-privileges-on-py-file-which-runs-inside-a-program-which-runs-fro and http://askubuntu.com/questions/645365/drop-undo-sudo-privileges-on-py-file-which-runs-inside-a-program-which-runs-fro/645367#645367. Here I am running like su -c "./manage_compiz_plugin.py unityshell disable" myusername – User2546 Jul 07 '15 at 07:13
0

If you're looking for a script to recompile unity without the launcher, this should be exactly what you want: Compile Unity without launcher

JLTD
  • 629