From 7b0f4f8a38956716169b6743e072045a5b93e23a Mon Sep 17 00:00:00 2001 From: lionel <> Date: Thu, 19 Sep 2024 22:16:45 +0200 Subject: [PATCH] Make sudo for user only --- config/includes.chroot/etc/skel/.bashrc | 6 ++++++ config/includes.chroot/etc/skel/.inputrc | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/includes.chroot/etc/skel/.bashrc b/config/includes.chroot/etc/skel/.bashrc index 6b79035..768ac45 100644 --- a/config/includes.chroot/etc/skel/.bashrc +++ b/config/includes.chroot/etc/skel/.bashrc @@ -127,6 +127,12 @@ if ! shopt -oq posix; then fi fi +# Add sudo on start of line if installed and no root user +# Alt-s: +if [ "$(id -u)" -ne 0 ] && [ -f /usr/bin/sudo ]; then + bind '"\es": "\C-asudo \C-e"' +fi + export LESS_TERMCAP_mb=$'\e[1;32m' export LESS_TERMCAP_md=$'\e[1;32m' export LESS_TERMCAP_me=$'\e[0m' diff --git a/config/includes.chroot/etc/skel/.inputrc b/config/includes.chroot/etc/skel/.inputrc index 12c92df..148dcf2 100644 --- a/config/includes.chroot/etc/skel/.inputrc +++ b/config/includes.chroot/etc/skel/.inputrc @@ -56,10 +56,6 @@ set skip-completed-text On #set completion-prefix-display-length 9 -# Add sudo on start of line -# Alt-s: -"\es": "\C-asudo \C-e" - "\em": shell-forward-word "\eq": shell-backward-word # Alt-f: