From 555d2589c3c676f5c6b758097332adf415109fdc Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Tue, 2 May 2023 09:29:42 -0700 Subject: [PATCH] adding nosleep command for gnome environments --- bash/.bashrc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index 308a997..bac807c 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -38,7 +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 # _ # _ __ _ __ ___ _ __ ___ _ __ | |_ @@ -201,7 +203,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