From f5cff72fcf298753c30aa6726319853496c500e6 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Fri, 5 May 2023 21:13:29 -0700 Subject: [PATCH] Adding `nosleep` alias for gnome-shell --- bash/.bashrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bash/.bashrc b/bash/.bashrc index a5ccfec..05e3a82 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -38,6 +38,9 @@ if [[ -x `which apt-get >/dev/null 2>&1` ]]; then HAS_APT=1 fi +if [[ -x `which gnome-shell >/dev/null 2>&1` ]]; then + HAS_GNOME=1 +fi # _ # _ __ _ __ ___ _ __ ___ _ __ | |_ @@ -206,7 +209,9 @@ alias tm="tmux new-session -A -s main" # emacsclient alias ec="emacsclient -n -c -a emacs" - +if [[ HAS_GNOME ]]; then + alias nosleep="gnome-session-inhibit --inhibit idle sleep infinity" +fi