2015-11-03 12:58:02 +01:00
|
|
|
From: Simon Lees <simon@simotek.net>
|
|
|
|
|
|
|
|
Based off an earlier patch by Tomas Cech.
|
|
|
|
|
|
|
|
This patch does 2 things:
|
2014-12-29 14:07:46 +01:00
|
|
|
1. In both xdg-su and xdg-terminal enlightenment is detected but then
|
2015-11-03 12:58:02 +01:00
|
|
|
no action is performed, this patch performs an action in these cases.
|
|
|
|
2. Rather than performing the generic action, specific enlightenment
|
|
|
|
actions have been added. They use terminology rather than xterm as it
|
2014-12-29 14:07:46 +01:00
|
|
|
is essientially the enlightenment terminal emulator and matches the
|
2015-11-03 12:58:02 +01:00
|
|
|
terminology theme.
|
|
|
|
|
|
|
|
---
|
|
|
|
scripts/xdg-su.in | 25 +++++++++++++++++++++++++
|
|
|
|
scripts/xdg-terminal.in | 17 +++++++++++++++++
|
|
|
|
2 files changed, 42 insertions(+)
|
|
|
|
|
|
|
|
--- a/scripts/xdg-su.in
|
|
|
|
+++ b/scripts/xdg-su.in
|
|
|
|
@@ -104,6 +104,27 @@ su_xfce()
|
2014-12-29 14:07:46 +01:00
|
|
|
|
|
|
|
[ x"$1" != x"" ] || exit_failure_syntax
|
|
|
|
|
|
|
|
+su_enlightenment()
|
|
|
|
+{
|
|
|
|
+# Enlightenment doesn't have any reasonably working su/sudo graphical interface
|
|
|
|
+# but terminology works as a drop in replacement for xterm and has a matching theme
|
|
|
|
+ if which terminology >/dev/null ; then
|
|
|
|
+ if [ -z "$user" ] ; then
|
|
|
|
+ terminology -g 60x5 -T "xdg-su: $cmd" -e "su -c '$cmd'"
|
|
|
|
+ else
|
|
|
|
+ terminology -g 60x5 -T "xdg-su: $cmd" -e "su -c '$cmd' '$user'"
|
|
|
|
+ fi
|
|
|
|
+
|
|
|
|
+ if [ $? -eq 0 ]; then
|
|
|
|
+ exit_success
|
|
|
|
+ else
|
|
|
|
+ exit_failure_operation_failed
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ su_generic
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
user=
|
|
|
|
cmd=
|
|
|
|
while [ $# -gt 0 ] ; do
|
2015-11-03 12:58:02 +01:00
|
|
|
@@ -167,6 +188,10 @@ case "$DE" in
|
2014-12-29 14:07:46 +01:00
|
|
|
su_xfce
|
|
|
|
;;
|
|
|
|
|
|
|
|
+ enlightenment)
|
|
|
|
+ su_enlightenment
|
|
|
|
+ ;;
|
|
|
|
+
|
|
|
|
*)
|
|
|
|
[ x"$user" = x"" ] && user=root
|
|
|
|
exit_failure_operation_impossible "no graphical method available for invoking '$cmd' as '$user'"
|
2015-11-03 12:58:02 +01:00
|
|
|
--- a/scripts/xdg-terminal.in
|
|
|
|
+++ b/scripts/xdg-terminal.in
|
|
|
|
@@ -176,6 +176,19 @@ terminal_lxde()
|
2014-12-29 14:07:46 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
+terminal_enlightenment()
|
|
|
|
+{
|
|
|
|
+ if which terminology &>/dev/null; then
|
|
|
|
+ if [ x"$1" = x"" ]; then
|
|
|
|
+ terminology
|
|
|
|
+ else
|
|
|
|
+ terminology -e "$1"
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ terminal_generic "$1"
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
#[ x"$1" != x"" ] || exit_failure_syntax
|
|
|
|
|
|
|
|
command=
|
2015-11-03 12:58:02 +01:00
|
|
|
@@ -231,6 +244,10 @@ case "$DE" in
|
2014-12-29 14:07:46 +01:00
|
|
|
lxde)
|
|
|
|
terminal_lxde "$command"
|
|
|
|
;;
|
|
|
|
+
|
|
|
|
+ enlightenment)
|
|
|
|
+ terminal_enlightenment "$command"
|
|
|
|
+ ;;
|
|
|
|
|
|
|
|
generic)
|
|
|
|
terminal_generic "$command"
|