diff --git a/Modules/Lock/Lock.qml b/Modules/Lock/Lock.qml index 5454624..ee9d599 100644 --- a/Modules/Lock/Lock.qml +++ b/Modules/Lock/Lock.qml @@ -54,5 +54,3 @@ Scope { } } } - - diff --git a/scripts/hello b/scripts/hello new file mode 100644 index 0000000..e69de29 diff --git a/scripts/install-bin.sh b/scripts/install-bin.sh old mode 100644 new mode 100755 index 329f5d0..75bb95a --- a/scripts/install-bin.sh +++ b/scripts/install-bin.sh @@ -1,8 +1,16 @@ #!/usr/bin/env bash +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +SCRIPT="./zshell.sh" + +prepare_binary() { + sed -ir "s|QML_ROOT=.*|QML_ROOT=${SCRIPT_DIR}/..|" "$SCRIPT" +} main() { - if [[ ]] + prepare_binary + + sudo cp "$SCRIPT" /usr/bin/zshell } main "$@" diff --git a/scripts/zshell.sh b/scripts/zshell.sh new file mode 100755 index 0000000..18d02ac --- /dev/null +++ b/scripts/zshell.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +QML_ROOT=/home/zach/GitProjects/z-bar-qt/scripts/.. +LOCK=false + +main() { + local OPTARG OPTIND opt + while getopts "l" opt; do + case "$opt" in + l) LOCK=true ;; + *) fatal 'bad option' ;; + esac + done + + if [[ "$LOCK" = "true" ]]; then + hyprctl dispatch global zshell-lock:lock + else + qs -n -d -p "$QML_ROOT/shell.qml" + fi +} + +main "$@" diff --git a/scripts/zshell.shr b/scripts/zshell.shr new file mode 100755 index 0000000..18d02ac --- /dev/null +++ b/scripts/zshell.shr @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +QML_ROOT=/home/zach/GitProjects/z-bar-qt/scripts/.. +LOCK=false + +main() { + local OPTARG OPTIND opt + while getopts "l" opt; do + case "$opt" in + l) LOCK=true ;; + *) fatal 'bad option' ;; + esac + done + + if [[ "$LOCK" = "true" ]]; then + hyprctl dispatch global zshell-lock:lock + else + qs -n -d -p "$QML_ROOT/shell.qml" + fi +} + +main "$@"