diff --git a/mark b/mark new file mode 100755 index 0000000..842f76e Binary files /dev/null and b/mark differ diff --git a/run b/run index 1bbdf36..966c1c8 100755 --- a/run +++ b/run @@ -1,14 +1,15 @@ #!/bin/zsh # Supported languages. -TYPES=("c", "cs", "java", "js", "python", "go") +TYPES=("c", "cs", "java", "js", "python", "flutter", "gradle", "go") # Catch case where there are too many arguments. if [[ $# -gt 1 ]]; then echo "Proper usage: run {file}" echo " eg. run" echo " eg. run main" - echo " eg. run --gradle" + echo " eg. run gradle" + echo " eg. run flutter" echo " eg. run -h" echo " eg. run --help" @@ -16,7 +17,7 @@ if [[ $# -gt 1 ]]; then # Help page elif [[ $1 == "-h" || $1 == "--help" ]]; then - echo "\nAbstracting away command line tools to compile and run code for various languages." + echo "\nAbstracting away command line tools to compile and run code for various languages and frameworks." echo "User can use with or without an argument file, the filetype is not needed." echo "With no arguments, 'run' will list available (and supported) files." echo "Additionally, 'run' prompts for and passes command line arguments for a program.\n" @@ -25,7 +26,8 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then echo " run" echo " run [filename]" echo " eg. run main" - echo " run --gradle" + echo " run gradle" + echo " run flutter" echo " run -h" echo " run --help\n" echo "Supported languages: $TYPES" @@ -137,11 +139,17 @@ elif [[ $TYPE == "go" ]]; then rm discordo # Run app through Gradle -elif [[ $1 == "--gradle" ]]; then +elif [[ $1 == "gradle" ]]; then clear; echo "Output..." ./gradlew run +# Run app through Flutter +elif [[ $1 == "flutter" ]]; then + clear; + echo "Output..." + flutter run + else read "?Language is not supported. Create a GH issue (y/n, default y): " GH if [[ $GH == "y" || $GH == "" ]]; then diff --git a/update b/update new file mode 100755 index 0000000..0cb382a --- /dev/null +++ b/update @@ -0,0 +1,13 @@ +#!/bin/zsh + +firefox https://archlinux.org; + +read "?Ok to update (y/n, default y): " OK + +if [[ $OK == "y" || $OK == "" ]]; then + echo "starting update..." + sudo pacman -Syu; + echo "finishing update..." +else + echo "abandoning update." +fi diff --git a/update-bl b/update-bl new file mode 100755 index 0000000..e0cd906 --- /dev/null +++ b/update-bl @@ -0,0 +1,25 @@ +#!/bin/zsh + +TARGET_FILE=~/.config/xob/brightness +PIPE=~/.config/xob/xobpipe +OLDNUM=`cut -f1 $TARGET_FILE` + +tail -f $PIPE | xob -s brightness & +if [[ $# -eq 0 ]]; then + NEWNUM=`expr $OLDNUM + 5` +elif [[ $# -eq 1 ]]; then + NEWNUM=$1 +elif [[ $# -eq 2 ]]; then + if [[ $1 -eq "--decrease" ]]; then + CHANGE=`expr 0 - $2` + elif [[ $1 -eq "--increase" ]]; then + CHANGE=$2 + fi + NEWNUM=`expr $OLDNUM + $CHANGE` +fi + +if [[ $NEWNUM -le 100 && $NEWNUM -ge 0 ]]; then + sed -i "s/$OLDNUM/$NEWNUM/g" $TARGET_FILE + brightnessctl set $NEWNUM% + echo $NEWNUM >> $PIPE +fi diff --git a/update-vol b/update-vol new file mode 100755 index 0000000..6d9641f --- /dev/null +++ b/update-vol @@ -0,0 +1,22 @@ +#!/bin/zsh + +tail -f ~/.config/xob/xobpipe | xob -s volume & +if [[ $# -eq 2 ]]; then + CHANGE=$1 + TARGET_FILE=$2 +elif [[ $# -eq 3 ]]; then + CHANGE=`expr 0 - $2` + TARGET_FILE=$3 +else + echo "Improper usage. To increase a value in a file,\nupdate-val [change] [target_file]." + echo "To decrease a value in a file,\nupdate-val --decrease [change] [target_file]." +fi + +OLDNUM=`cut -f1 $TARGET_FILE` +NEWNUM=`expr $OLDNUM + $CHANGE` + +if [[ $NEWNUM -le 100 && $NEWNUM -ge 0 ]]; then + sed -i "s/$OLDNUM/$NEWNUM/g" $TARGET_FILE + pactl set-sink-volume @DEFAULT_SINK@ $NEWNUM% + echo $NEWNUM >> ~/.config/xob/xobpipe +fi