diff options
-rw-r--r-- | .boilerplates/cs/Program.cs | 11 | ||||
-rwxr-xr-x | .boilerplates/cs/run | 3 | ||||
-rw-r--r-- | .config/nvim/init.vim | 4 | ||||
-rw-r--r-- | .config/spicetify/config.ini | 27 | ||||
-rw-r--r-- | .gitconfig | 2 | ||||
-rwxr-xr-x | .scripts/boil | 21 | ||||
-rwxr-xr-x | .scripts/commstat | 1 | ||||
-rwxr-xr-x | .scripts/compile | 4 | ||||
-rwxr-xr-x | .scripts/dwm_time | 8 | ||||
-rwxr-xr-x | .scripts/ext | 42 | ||||
-rwxr-xr-x | .scripts/preview | 14 | ||||
-rwxr-xr-x | .scripts/rotate | 42 | ||||
-rwxr-xr-x | .scripts/wlan | 18 |
13 files changed, 123 insertions, 74 deletions
diff --git a/.boilerplates/cs/Program.cs b/.boilerplates/cs/Program.cs deleted file mode 100644 index ba34eda..0000000 --- a/.boilerplates/cs/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -public class Program -{ -static int Main(string[] args) -{ - Console.WriteLine("Hello, world!"); - - return 0; -} -} diff --git a/.boilerplates/cs/run b/.boilerplates/cs/run index 84b6eb9..995cd7c 100755 --- a/.boilerplates/cs/run +++ b/.boilerplates/cs/run @@ -1,4 +1,3 @@ #!/usr/bin/env sh -mcs -out:Program.exe -pkg:dotnet ./*.cs -mono Program.exe +time dotnet run diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index c3abb59..cfeca92 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -238,7 +238,6 @@ let g:ale_fixers = { \ '*': ['remove_trailing_lines', 'trim_whitespace'], \ 'c': ['clang-format'], \ 'cpp': ['clang-format'], -\ 'cs': ['uncrustify'], \ 'css': ['prettier'], \ 'd': ['uncrustify'], \ 'html': ['prettier'], @@ -251,7 +250,7 @@ let g:ale_fixers = { \ 'typescript': ['prettier'], \} let g:ale_fix_on_save = 1 -autocmd FileType cs let g:ale_c_uncrustify_options = '-l CS' +" autocmd FileType cs let g:ale_c_uncrustify_options = '-l CS' autocmd FileType java let g:ale_c_uncrustify_options = '-l JAVA' autocmd FileType d let g:ale_c_uncrustify_options = '-l D' @@ -326,6 +325,7 @@ autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab autocmd FileType javascript set tabstop=4|set shiftwidth=4|set expandtab autocmd FileType typescript set tabstop=4|set shiftwidth=4|set expandtab autocmd FileType css set tabstop=4|set shiftwidth=4|set expandtab +autocmd FileType cs set tabstop=4|set shiftwidth=4|set expandtab autocmd FileType json set tabstop=4|set shiftwidth=4|set expandtab autocmd FileType html set tabstop=4|set shiftwidth=4|set expandtab autocmd FileType sh set tabstop=4|set shiftwidth=4|set expandtab diff --git a/.config/spicetify/config.ini b/.config/spicetify/config.ini index b3dae0e..e52881d 100644 --- a/.config/spicetify/config.ini +++ b/.config/spicetify/config.ini @@ -1,6 +1,6 @@ [AdditionalOptions] made_for_you_hub = 0 -custom_apps = +custom_apps = lyric_always_show = 0 new_feedback_ui = 0 song_page = 0 @@ -16,22 +16,19 @@ home = 0 lyric_force_no_sync = 0 [Setting] -current_theme = Dark -color_scheme = -inject_css = 1 -replace_colors = 1 -overwrite_assets = 0 -spotify_path = /opt/spotify -prefs_path = /home/melvin/.config/spotify/prefs -spotify_launch_flags = -check_spicetify_upgrade = 0 +current_theme = Dark +color_scheme = +inject_css = 1 +replace_colors = 1 +overwrite_assets = 0 +spotify_path = /opt/spotify +prefs_path = /home/melvin/.config/spotify/prefs [Preprocesses] -disable_sentry = 1 -disable_ui_logging = 1 -remove_rtl_rule = 1 -expose_apis = 1 -disable_upgrade_check = 1 +disable_sentry = 1 +disable_ui_logging = 1 +remove_rtl_rule = 1 +expose_apis = 1 ; DO NOT CHANGE! [Backup] @@ -6,5 +6,3 @@ ff = only [commit] gpgsign = true -[merge] - tool = vimdiff diff --git a/.scripts/boil b/.scripts/boil index ac1ab55..0805147 100755 --- a/.scripts/boil +++ b/.scripts/boil @@ -5,18 +5,23 @@ name="$2" boilerplates="$HOME/.boilerplates" if [ "${mode}" = "" ] || [ "${name}" = "" ]; then - echo "Not enough parameters" - exit 1 + echo "Not enough parameters" + exit 1 fi if [ "${mode}" = "clj" ]; then - lein new app "$name" - cp "$boilerplates/$mode/run" "$name" - rm -rf "$name/CHANGELOG.md" "$name/LICENSE" "$name/README.md" "$name/doc/" + lein new app "$name" + cp "$boilerplates/$mode/run" "$name" + rm -rf "$name/CHANGELOG.md" "$name/LICENSE" "$name/README.md" "$name/doc/" elif [ "${mode}" = "md" ] || [ "${mode}" = "ms" ]; then - cp "$boilerplates/txt/$mode.$mode" "$name.$mode" + cp "$boilerplates/txt/$mode.$mode" "$name.$mode" elif [ "${mode}" = "run" ]; then - cp "$boilerplates/txt/run" run + cp "$boilerplates/txt/run" run +elif [ "${mode}" = "cs" ]; then + mkdir -p "$name" + cd "$name" || exit 1 + dotnet new console + cp "$boilerplates/cs/run" run else - cp -r "$boilerplates/$mode" "$name" || echo "Something went wrong" + cp -r "$boilerplates/$mode" "$name" || echo "Something went wrong" fi diff --git a/.scripts/commstat b/.scripts/commstat deleted file mode 100755 index f1f641a..0000000 --- a/.scripts/commstat +++ /dev/null @@ -1 +0,0 @@ -#!/usr/bin/env bash diff --git a/.scripts/compile b/.scripts/compile index 38295e2..95f70c8 100755 --- a/.scripts/compile +++ b/.scripts/compile @@ -6,8 +6,8 @@ base="${file%.*}" ext="${file##*.}" if [ -f "$dir/run" ]; then - echo "Using run file" - exec "$dir/run" + echo "Using run file" + exec "$dir/run" fi case "$ext" in diff --git a/.scripts/dwm_time b/.scripts/dwm_time index fddff39..a68b913 100755 --- a/.scripts/dwm_time +++ b/.scripts/dwm_time @@ -1,7 +1,9 @@ #!/usr/bin/env sh while true; do - time=$( date +'%H:%M') - xsetroot -name "$time" - sleep 1 + time=$(date +'%H:%M') + # bat=$(acpi | awk '{print $4}' | head -c3) + # xsetroot -name " $bat | $time " + xsetroot -name " $time " + sleep 1 done diff --git a/.scripts/ext b/.scripts/ext index 3b41b1a..a1b9d0e 100755 --- a/.scripts/ext +++ b/.scripts/ext @@ -1,30 +1,30 @@ #!/usr/bin/env sh archive="$(readlink -f "$*")" && - directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" && - mkdir -p "$directory" && - cd "$directory" || exit + directory="$(echo "$archive" | sed 's/\.[^\/.]*$//')" && + mkdir -p "$directory" && + cd "$directory" || exit [ "$archive" = "" ] && printf "Give archive to extract as argument\\n" && exit if [ -f "$archive" ]; then - case "$archive" in - *.tar.bz2 | *.tbz2) tar xvjf "$archive" ;; - *.tar.xz) tar -xf "$archive" ;; - *.tar.gz | *.tgz) tar xvzf "$archive" ;; - *.tar.lz) tar --lzip -xvf "$archive" ;; - *.lzma) unlzma "$archive" ;; - *.bz2) bunzip2 "$archive" ;; - *.rar) unrar x -ad "$archive" ;; - *.gz) gunzip "$archive" ;; - *.tar) tar xvf "$archive" ;; - *.zip) unzip "$archive" ;; - *.Z) uncompress "$archive" ;; - *.7z) 7z x "$archive" ;; - *.xz) unxz "$archive" ;; - *.exe) cabextract "$archive" ;; - *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; - esac + case "$archive" in + *.tar.bz2 | *.tbz2) tar xvjf "$archive" ;; + *.tar.xz) tar -xf "$archive" ;; + *.tar.gz | *.tgz) tar xvzf "$archive" ;; + *.tar.lz) tar --lzip -xvf "$archive" ;; + *.lzma) unlzma "$archive" ;; + *.bz2) bunzip2 "$archive" ;; + *.rar) unrar x -ad "$archive" ;; + *.gz) gunzip "$archive" ;; + *.tar) tar xvf "$archive" ;; + *.zip) unzip "$archive" ;; + *.Z) uncompress "$archive" ;; + *.7z) 7z x "$archive" ;; + *.xz) unxz "$archive" ;; + *.exe) cabextract "$archive" ;; + *) printf "extract: '%s' - unknown archive method\\n" "$archive" ;; + esac else - printf "File \"%s\" not found\\n" "$archive" + printf "File \"%s\" not found\\n" "$archive" fi diff --git a/.scripts/preview b/.scripts/preview index 43ef6f0..099eb1b 100755 --- a/.scripts/preview +++ b/.scripts/preview @@ -5,13 +5,13 @@ if [ -z "$1" ]; then exit 1; fi basename="$(echo "$1" | sed 's/\.[^\/.]*$//')" wait_pdf() { - sleep 5 # Some start delay - while true; do - if ! pgrep -x "zathura" >/dev/null; then - rm -f "$basename".pdf - exit 0 - fi - done + sleep 5 # Some start delay + while true; do + if ! pgrep -x "zathura" >/dev/null; then + rm -f "$basename".pdf + exit 0 + fi + done } case "$1" in diff --git a/.scripts/rotate b/.scripts/rotate new file mode 100755 index 0000000..97b045a --- /dev/null +++ b/.scripts/rotate @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +nibble="TPPS/2 IBM TrackPoint" +stylus="Wacom ISDv4 90 Pen stylus" +eraser="Wacom ISDv4 90 Pen eraser" + +matrix="$(xinput list-props "$stylus" | awk '/Coordinate Transformation Matrix/{print $5$6$7$8$9$10$11$12$NF}')" + +# Matrix declarations + +normal="1 0 0 0 1 0 0 0 1" +normal_float="1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000" + +inverted="-1 0 1 0 -1 1 0 0 1" +inverted_float="-1.000000,0.000000,1.000000,0.000000,-1.000000,1.000000,0.000000,0.000000,1.000000" + +left="0 -1 1 1 0 0 0 0 1" +left_float="0.000000,-1.000000,1.000000,1.000000,0.000000,0.000000,0.000000,0.000000,1.000000" + +right="0 1 0 -1 0 1 0 0 1" + +if [ "$matrix" == $normal_float ] && [ "$1" != "-n" ]; then + xrandr -o inverted + xinput set-prop "$stylus" 166 $inverted + xinput set-prop ""$eraser"" 166 $inverted + xinput set-prop ""$nibble"" 166 $inverted +elif [ "$matrix" == $inverted_float ] && [ "$1" != "-j" ] && [ "$1" != "-n" ]; then + xrandr -o left + xinput set-prop "$stylus" 166 $left + xinput set-prop "$eraser" 166 $left + xinput set-prop "$nibble" 166 $left +elif [ "$matrix" == $left_float ] && [ "$1" != "-j" ] && [ "$1" != "-n" ]; then + xrandr -o right + xinput set-prop "$stylus" 166 $right + xinput set-prop "$eraser" 166 $right + xinput set-prop "$nibble" 166 $right +else + xrandr -o normal + xinput set-prop "$stylus" 166 $normal + xinput set-prop "$eraser" 166 $normal + xinput set-prop "$nibble" 166 $normal +fi diff --git a/.scripts/wlan b/.scripts/wlan new file mode 100755 index 0000000..0df4aea --- /dev/null +++ b/.scripts/wlan @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Melvin's awesome wifi connection script! + +netctl list | grep -q "$1" || { + echo "This network doesn't exist. Please use 'sudo wifi-menu' to add a new network or use one of the following:" + netctl list + exit 1 +} + +sudo netctl stop-all +sudo killall -9 dhcpcd +sudo systemctl start dhcpcd || exit 1 +sudo ip link set wlp3s0 down +sudo netctl start "$1" || exit 1 + +echo "Connecting..." +while ! ping -c1 1.1.1.1 &>/dev/null; do sleep 1; done +echo "Connected!" |