flutter support

This commit is contained in:
Josh Ashton
2023-06-26 21:53:06 -06:00
parent b328da905f
commit d85367c819
5 changed files with 73 additions and 5 deletions
Executable
BIN
View File
Binary file not shown.
+13 -5
View File
@@ -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
Executable
+13
View File
@@ -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
Executable
+25
View File
@@ -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
Executable
+22
View File
@@ -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