changes
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Dependencies:
|
||||
# quaxlyqueen/scripts/mark
|
||||
|
||||
BOOKMARKS_FILE=~/.bookmarks
|
||||
|
||||
# Catch any invalid input.
|
||||
if [[ $# -eq 0 || $# -gt 1 ]]; then
|
||||
echo "\nImproper usage. Try:"
|
||||
echo "\ngoto [keyword]"
|
||||
echo " goto downloads"
|
||||
echo " goto school"
|
||||
echo " goto portfolio"
|
||||
echo " goto -h"
|
||||
echo " goto --help"
|
||||
|
||||
# Display help.
|
||||
elif [[ $1 == "-h" || $1 == "--help" ]]; then
|
||||
echo "\nImproper usage. Try:"
|
||||
echo "\ngoto [keyword]"
|
||||
echo " goto downloads"
|
||||
echo " goto school"
|
||||
echo " goto portfolio"
|
||||
echo " goto -h"
|
||||
echo " goto --help"
|
||||
|
||||
else
|
||||
|
||||
# Locate the bookmark.
|
||||
if [ $(grep -c "$1" $BOOKMARKS_FILE) -gt 0 ]; then
|
||||
|
||||
# Go to the bookmark
|
||||
cd $(grep "$1" $BOOKMARKS_FILE | head -n 1)
|
||||
|
||||
# List bookmarks if bookmark was not found.
|
||||
else
|
||||
echo "Bookmark not found. Available bookmarks:"
|
||||
mark -ls
|
||||
fi
|
||||
fi
|
||||
+14
-1
@@ -8,7 +8,7 @@
|
||||
# quaxlyqueen/scripts/ginit
|
||||
|
||||
# Supported languages.
|
||||
TYPES=("c", "c-sharp", "java", "js", "t3", "python", "flutter", "go")
|
||||
TYPES=("c", "rust", "c-sharp", "java", "js", "t3", "python", "flutter", "go")
|
||||
|
||||
# Catch case where there are too many arguments.
|
||||
if [[ $# -gt 3 ]]; then
|
||||
@@ -91,6 +91,15 @@ if [[ $LANG == "c" ]]; then
|
||||
cp -r ~/templates/c/main.c . # Copy the template C file.
|
||||
mark; # Bookmark new project.
|
||||
|
||||
# Create a new Rust project.
|
||||
elif [[ $LANG == "rust" ]]; then
|
||||
read "?Is this an Arduino project? (y/N): " ARDUINO
|
||||
if [[ $ARDUINO == "y" ]]; then
|
||||
cargo generate --git https://github.com/Rahix/avr-hal-template.git
|
||||
else
|
||||
cargo new $NAME
|
||||
fi
|
||||
|
||||
# Create a new C# project with dotnet.
|
||||
elif [[ $LANG == "c-sharp" ]]; then
|
||||
mkdir $NAME
|
||||
@@ -137,6 +146,10 @@ elif [[ $LANG == "flutter" ]]; then
|
||||
cd $NAME
|
||||
mark;
|
||||
|
||||
# Create a new t3 web app.
|
||||
elif [[ $LANG == "t3" ]]; then
|
||||
npm create t3-app@latest
|
||||
|
||||
fi
|
||||
|
||||
# If the user indicated the project will be a Git project, then run the ginit script.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/zsh
|
||||
|
||||
# Supported languages.
|
||||
TYPES=("c", "cs", "java", "js", "python", "flutter", "gradle", "go")
|
||||
TYPES=("c", "rs", "cs", "java", "js", "python", "flutter", "gradle", "go")
|
||||
|
||||
# Catch case where there are too many arguments.
|
||||
if [[ $# -gt 1 ]]; then
|
||||
@@ -99,6 +99,11 @@ if [[ $TYPE == "c" ]]; then
|
||||
|
||||
rm a.out
|
||||
|
||||
# Run a Rust app.
|
||||
elif [[ $TYPE == "rs" ]]; then
|
||||
clear
|
||||
cargo run
|
||||
|
||||
# Run C# app.
|
||||
elif [[ $TYPE == "cs" ]]; then
|
||||
clear
|
||||
|
||||
+3
-1
@@ -42,7 +42,9 @@ void validateDir(char input[]) {
|
||||
printf("cwd: %s\n", cwd);
|
||||
}
|
||||
chdir("..");
|
||||
printf("cwd: %s", cwd);
|
||||
if(getcwd(cwd, sizeof(cwd)) != NULL) {
|
||||
printf("cwd: %s\n", cwd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main() {
|
||||
printf("%s", getenv("CWD"));
|
||||
chdir("/home/jashton/dev");
|
||||
printf("%s", getenv("CWD"));
|
||||
}
|
||||
@@ -1,25 +1,22 @@
|
||||
#!/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`
|
||||
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-bl [change] [target_file]."
|
||||
echo "To decrease a value in a file,\nupdate-bl --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
|
||||
brightnessctl set $NEWNUM%
|
||||
echo $NEWNUM >> $PIPE
|
||||
echo $NEWNUM >> ~/.config/xob/xobpipe
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user