From eaa86d44258ce72dbee5e9fa5304dfe002819036 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Thu, 21 Sep 2023 11:44:10 +0200 Subject: Try out this hyprland script --- .local/bin/hyprland-switch-tag | 161 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100755 .local/bin/hyprland-switch-tag (limited to '.local/bin') diff --git a/.local/bin/hyprland-switch-tag b/.local/bin/hyprland-switch-tag new file mode 100755 index 0000000..06840c9 --- /dev/null +++ b/.local/bin/hyprland-switch-tag @@ -0,0 +1,161 @@ +#!/usr/bin/env bash + +# Pascal Jaeger + +# utils +green="\033[0;32m" +red="\033[0;31m" +blue="\033[0;34m" +nocolor="\033[0m" + +#util functions +check() { + command -v "$1" 1>/dev/null +} + +ok() { + echo -e "[$green  $nocolor] $*" +} + +err() { + echo -e "[$red  $nocolor] $*" +} +optional() { + echo -e "[$blue  $nocolor] $*" +} + +notify() { + # shellcheck disable=SC2015 + check notify-send && { + notify-send "$@" + } || { + echo "$@" + } +} + +checkUtils() { + # shellcheck disable=SC2015 + check grep && ok "grep" || err "grep" + # shellcheck disable=SC2015 + check grep && ok "cut" || err "cut" + # shellcheck disable=SC2015 + check notify-send && ok "notify-send (Optional)" || optional "notify-send (Optional)" + exit +} + +basicChecks() { + check hyprctl || { + notify "Seriously mate!!" "Start Hyprland before this script" + exit 1 + } + pgrep -x Hyprland &>/dev/null || { + notify "Make Sure Hyprland Session is running." + exit 1 + } +} + +help() { + cat <