#!/bin/sh export TEXTDOMAIN=slint-scripts if [ "$(id -u)" = "0" ];then gettext "Please run 'hide-desktop' as regular user."; echo exit fi usage() { echo gettext "Usage: display-desktop "; echo echo gettext "This program hide most menu entries specific to the selected desktop, if installed, when running another one. Corresponding applications will stay available in all other desktops typing commands from a terminal or through a \"run...\" dialog (Alt+F2)."; echo gettext "List of desktops:"; echo echo " lxqt" echo " mate" echo " all" gettext "If you choose all the menu entries for any installed desktop will be hidden from all others."; echo echo gettext "This can be reverted with the command display-desktop."; echo echo } hide() { from="/usr/share/slint/applications" to="$HOME/.local/share/applications" find "$from/$1"|sed "s|.*/||"| while read -r i; do ln -sf "$from/$1/$i" "$to/$i" done } [ $# -ne 1 ] && usage && exit mkdir -p "$HOME/.local/share/applications" desktop="$(echo "$1"|tr '[:upper:]' '[:lower:]')" case "$desktop" in lxqt|mate) hide "$desktop" gettext "Done."; echo gettext "The menus will be modified at next boot."; echo;; all) hide lxqt; hide mate gettext "Done."; echo gettext "The menus will be modified at next boot."; echo;; *) printf '%s' "$desktop " gettext "is not a listed session."; echo usage esac