From 83b60ddaab30dfc0104e0ee6a11b0c523a250a19 Mon Sep 17 00:00:00 2001 From: Jas Singh Date: Sun, 28 Jul 2024 12:55:12 -0700 Subject: [PATCH] Updated the shbangs to be more flexible. (#29) --- services/screen_record.sh | 44 +++++++++++++++++++-------------------- services/snapshot.sh | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/services/screen_record.sh b/services/screen_record.sh index b8b5890..09e7a9c 100755 --- a/services/screen_record.sh +++ b/services/screen_record.sh @@ -1,9 +1,9 @@ -#!/bin/bash +#!/usr/bin/env bash outputDir="$HOME/Videos/Screencasts" checkRecording() { - if pgrep -f "gpu-screen-recorder" > /dev/null; then + if pgrep -f "gpu-screen-recorder" >/dev/null; then return 0 else return 1 @@ -47,24 +47,24 @@ stopRecording() { -u normal \ --action="scriptAction:-dolphin $outputDir=Directory" \ --action="scriptAction:-xdg-open $recentFile=Play" - } +} - case "$1" in - start) - startRecording "$@" - ;; - stop) - stopRecording - ;; - status) - if checkRecording; then - echo "recording" - else - echo "not recording" - fi - ;; - *) - echo "Usage: $0 {start [screen_name|window_id]|stop|status}" - exit 1 - ;; - esac +case "$1" in +start) + startRecording "$@" + ;; +stop) + stopRecording + ;; +status) + if checkRecording; then + echo "recording" + else + echo "not recording" + fi + ;; +*) + echo "Usage: $0 {start [screen_name|window_id]|stop|status}" + exit 1 + ;; +esac diff --git a/services/snapshot.sh b/services/snapshot.sh index 3d6c66f..b8ad2d7 100755 --- a/services/snapshot.sh +++ b/services/snapshot.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash outputDir="$HOME/Pictures/Screenshots/" outputFile="snapshot_$(date +%Y-%m-%d_%H-%M-%S).png"