flutter support
This commit is contained in:
@@ -1,14 +1,15 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
# Supported languages.
|
# 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.
|
# Catch case where there are too many arguments.
|
||||||
if [[ $# -gt 1 ]]; then
|
if [[ $# -gt 1 ]]; then
|
||||||
echo "Proper usage: run {file}"
|
echo "Proper usage: run {file}"
|
||||||
echo " eg. run"
|
echo " eg. run"
|
||||||
echo " eg. run main"
|
echo " eg. run main"
|
||||||
echo " eg. run --gradle"
|
echo " eg. run gradle"
|
||||||
|
echo " eg. run flutter"
|
||||||
echo " eg. run -h"
|
echo " eg. run -h"
|
||||||
echo " eg. run --help"
|
echo " eg. run --help"
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@ if [[ $# -gt 1 ]]; then
|
|||||||
|
|
||||||
# Help page
|
# Help page
|
||||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
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 "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 "With no arguments, 'run' will list available (and supported) files."
|
||||||
echo "Additionally, 'run' prompts for and passes command line arguments for a program.\n"
|
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"
|
||||||
echo " run [filename]"
|
echo " run [filename]"
|
||||||
echo " eg. run main"
|
echo " eg. run main"
|
||||||
echo " run --gradle"
|
echo " run gradle"
|
||||||
|
echo " run flutter"
|
||||||
echo " run -h"
|
echo " run -h"
|
||||||
echo " run --help\n"
|
echo " run --help\n"
|
||||||
echo "Supported languages: $TYPES"
|
echo "Supported languages: $TYPES"
|
||||||
@@ -137,11 +139,17 @@ elif [[ $TYPE == "go" ]]; then
|
|||||||
rm discordo
|
rm discordo
|
||||||
|
|
||||||
# Run app through Gradle
|
# Run app through Gradle
|
||||||
elif [[ $1 == "--gradle" ]]; then
|
elif [[ $1 == "gradle" ]]; then
|
||||||
clear;
|
clear;
|
||||||
echo "Output..."
|
echo "Output..."
|
||||||
./gradlew run
|
./gradlew run
|
||||||
|
|
||||||
|
# Run app through Flutter
|
||||||
|
elif [[ $1 == "flutter" ]]; then
|
||||||
|
clear;
|
||||||
|
echo "Output..."
|
||||||
|
flutter run
|
||||||
|
|
||||||
else
|
else
|
||||||
read "?Language is not supported. Create a GH issue (y/n, default y): " GH
|
read "?Language is not supported. Create a GH issue (y/n, default y): " GH
|
||||||
if [[ $GH == "y" || $GH == "" ]]; then
|
if [[ $GH == "y" || $GH == "" ]]; then
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -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
@@ -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
|
||||||
Reference in New Issue
Block a user