From aae02ba05f2c4d440acd39b53e4cd9310d972105 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Wed, 11 Dec 2019 14:28:20 +0300 Subject: [PATCH] =?UTF-8?q?suDo=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B8=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=B2=20asroot=20(?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=BB=D0=B8=D0=BA=D1=82=20=D1=81=20sud?= =?UTF-8?q?o=20=D0=B2=20MacOS)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- asroot | 18 ++++++++++++++++++ suDo | 18 ------------------ 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100755 asroot delete mode 100755 suDo diff --git a/README.md b/README.md index a7a188a..10c2510 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ will create the symbolic link for each script in the \ directory. - [calculator](calculator) computes mathematical expressions with variables and intermediate values. - [fix-eselect](fix-eselect) adjusts 'type' command in gentoo's eselect scripts. - [musca_status](musca_status) shows a list of all musca's workspaces. -- [poweroff-dialog](poweroff-dialog) and [suDo](suDo) provide a menu with 'shutdown', 'reboot' and 'suspend' commands. +- [poweroff-dialog](poweroff-dialog) and [asroot](asroot) provide a menu with 'shutdown', 'reboot' and 'suspend' commands. - [windows](windows) shows a list of the all opened windows. - [www](www) opens rofi menu with the most used www-links. - [xstab](xstab) runs [st](https://st.suckless.org/) terminal with the [tabbed](https://tools.suckless.org/tabbed/). diff --git a/asroot b/asroot new file mode 100755 index 0000000..0596f4c --- /dev/null +++ b/asroot @@ -0,0 +1,18 @@ +#!/usr/bin/env tclsh + +# Выполнение команды с правами администратора +# Используется с dmenu +# asroot + +package require Expect + +proc execCommand {command password} { + spawn bash + exp_send "su -c \"$command\"\n" + expect -nocase "password: " + exp_send "$password\n" + expect eof +} + +execCommand [lindex $argv 0] [lindex $argv 1] + diff --git a/suDo b/suDo deleted file mode 100755 index c54c884..0000000 --- a/suDo +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env tclsh - -# Выполнение команды с правами администратора -# Используется с dmenu -# suDo - -package require Expect - -proc execCommand {command password} { - spawn bash - exp_send "su -c \"$command\"\n" - expect -nocase "password: " - exp_send "$password\n" - expect eof -} - -execCommand [lindex $argv 0] [lindex $argv 1] -