From 758934e0d5b681adcef22df4b36a80eaa6f153c8 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 7 Sep 2021 20:22:09 +0100 Subject: [PATCH] Adding some moRe scripts and android variables --- .config/shell/profile | 8 +++++++- .local/bin/downloadhandler | 24 ++++++++++++++++++++++++ .local/bin/installfont | 11 +++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 .local/bin/downloadhandler create mode 100755 .local/bin/installfont diff --git a/.config/shell/profile b/.config/shell/profile index ce1a3ea..eaab4bf 100644 --- a/.config/shell/profile +++ b/.config/shell/profile @@ -3,7 +3,7 @@ # profile file. Runs on login. Environmental variables are set here. # Adds `~/.local/bin` to $PATH -export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}" +export PATH="$PATH:${$(find ~/.local/bin -type d -printf %p:)%%:}:$(yarn global bin)" unsetopt PROMPT_SP @@ -43,6 +43,7 @@ export HISTFILE="${XDG_DATA_HOME:-$HOME/.local/share}/history" export WEECHAT_HOME="${XDG_CONFIG_HOME:-$HOME/.config}/weechat" export MBSYNCRC="${XDG_CONFIG_HOME:-$HOME/.config}/mbsync/config" export ELECTRUMDIR="${XDG_DATA_HOME:-$HOME/.local/share}/electrum" +export ANDROID_AVD_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/android/avd" # Other program settings export DICS="/usr/share/stardicts/dic/" @@ -61,6 +62,11 @@ export QT_QPA_PLATFORMTHEME="gtk2" # Have QT use gtk2 theme. export MOZ_USE_XINPUT2="1" # Mozilla smooth scrolling/touchpads. export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for Java applications in dwm +# Development variables +export ANDROID_HOME="/opt/android" +export ANDROID_SDK_HOME="$ANDROID_HOME" +export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$ANDROID_AVD_HOME" + # This is the list for lf icons: export LF_ICONS="di=📁:\ fi=📃:\ diff --git a/.local/bin/downloadhandler b/.local/bin/downloadhandler new file mode 100755 index 0000000..e755e48 --- /dev/null +++ b/.local/bin/downloadhandler @@ -0,0 +1,24 @@ +#!/bin/sh + +echo "starting" +echo "$1" + +file="${1:-$HOME/Downloads}" + +[ -d "$file" ] && file="$file/$(ls -Art "$file" | tail -n 1)" + +echo "continuing" +echo "$file" + +case "$file" in + *ergodox*.hex) + wally-cli "$file" ;; + # *png|*jpg|*jpe|*jpeg|*gif) + # curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; + # *pdf|*cbz|*cbr) + # curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && zathura "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 & ;; + # *mp3|*flac|*opus|*mp3?source*) + # qndl "$1" 'curl -LO' >/dev/null 2>&1 ;; + # *) + # [ -f "$1" ] && setsid -f "$TERMINAL" -e "$EDITOR" "$1" >/dev/null 2>&1 || setsid -f "$BROWSER" "$1" >/dev/null 2>&1 +esac diff --git a/.local/bin/installfont b/.local/bin/installfont new file mode 100755 index 0000000..6b342ae --- /dev/null +++ b/.local/bin/installfont @@ -0,0 +1,11 @@ +# !/bin/bash + +dir=$(mktemp -d) + +unzip "$1" -d "$dir" + +mv "$dir/"*.ttf ~/.local/share/fonts/ +mv "$dir/"*.otf ~/.local/share/fonts/ +mv "$dir/"*.TTF ~/.local/share/fonts/ +mv "$dir/"*.OTF ~/.local/share/fonts/ +