diff options
| author | Luke <luke@lukesmith.xyz> | 2018-02-20 14:29:53 -0700 |
|---|---|---|
| committer | Luke <luke@lukesmith.xyz> | 2018-02-20 14:29:53 -0700 |
| commit | 838eeec9acdc320bbab24b69db3041e436cdc996 (patch) | |
| tree | e220c4843b25626a9733ee39cb45fcf1dadc1394 /.config/Scripts | |
| parent | f1366ff22b4f6f97b27edecda9ecf434c38ae426 (diff) | |
| download | eibhear-838eeec9acdc320bbab24b69db3041e436cdc996.tar.gz eibhear-838eeec9acdc320bbab24b69db3041e436cdc996.tar.zst eibhear-838eeec9acdc320bbab24b69db3041e436cdc996.zip | |
scripts folder moved to ~/.scripts
Diffstat (limited to '.config/Scripts')
| -rwxr-xr-x | .config/Scripts/audio_alsa.sh | 18 | ||||
| -rwxr-xr-x | .config/Scripts/audio_pulse.sh | 18 | ||||
| -rwxr-xr-x | .config/Scripts/camtoggle | 2 | ||||
| -rwxr-xr-x | .config/Scripts/clear.sh | 1 | ||||
| -rw-r--r-- | .config/Scripts/configs | 17 | ||||
| -rwxr-xr-x | .config/Scripts/extract | 30 | ||||
| -rw-r--r-- | .config/Scripts/folders | 10 | ||||
| -rwxr-xr-x | .config/Scripts/offlineimap-daemon.py | 93 | ||||
| -rwxr-xr-x | .config/Scripts/offlineimap-daemonctl.sh | 40 | ||||
| -rw-r--r-- | .config/Scripts/remaps | 1 | ||||
| -rwxr-xr-x | .config/Scripts/screen.sh | 24 | ||||
| -rwxr-xr-x | .config/Scripts/screencast_alsa.sh | 22 | ||||
| -rwxr-xr-x | .config/Scripts/screencast_pulse.sh | 24 | ||||
| -rwxr-xr-x | .config/Scripts/shortcuts.sh | 62 | ||||
| -rwxr-xr-x | .config/Scripts/spawndl | 2 | ||||
| -rwxr-xr-x | .config/Scripts/speedvid.sh | 7 | ||||
| -rwxr-xr-x | .config/Scripts/tmuxinit | 4 | ||||
| -rwxr-xr-x | .config/Scripts/transmission.sh | 7 | ||||
| -rwxr-xr-x | .config/Scripts/video.sh | 21 | ||||
| -rwxr-xr-x | .config/Scripts/webview | 23 | ||||
| -rwxr-xr-x | .config/Scripts/welcome | 4 |
21 files changed, 0 insertions, 430 deletions
diff --git a/.config/Scripts/audio_alsa.sh b/.config/Scripts/audio_alsa.sh deleted file mode 100755 index cda07a2..0000000 --- a/.config/Scripts/audio_alsa.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -#This is the ffmpeg command that the screencast shortcut in i3 will run. - -#Picks a file name for the output file based on availability: - -while [[ -f $HOME/audio$n.flac ]] -do - n=$((n+1)) -done -filename="$HOME/audio$n.flac" - -#The actual ffmpeg command: - -ffmpeg -y \ - -f alsa -ar 44100 -i hw:1 \ - $filename - diff --git a/.config/Scripts/audio_pulse.sh b/.config/Scripts/audio_pulse.sh deleted file mode 100755 index 21e46ea..0000000 --- a/.config/Scripts/audio_pulse.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -#This is the ffmpeg command that the audio shortcut in i3 will run. - -#Picks a file name for the output file based on availability: - -while [[ -f $HOME/audio$n.flac ]] -do - n=$((n+1)) -done -filename="$HOME/audio$n.flac" - -#The actual ffmpeg command: - -ffmpeg \ --f alsa -i default \ --c:a flac \ -$filename diff --git a/.config/Scripts/camtoggle b/.config/Scripts/camtoggle deleted file mode 100755 index 9a7879c..0000000 --- a/.config/Scripts/camtoggle +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% /dev/video0 diff --git a/.config/Scripts/clear.sh b/.config/Scripts/clear.sh deleted file mode 100755 index af13a73..0000000 --- a/.config/Scripts/clear.sh +++ /dev/null @@ -1 +0,0 @@ -find . -maxdepth 1 -regextype gnu-awk -regex "^.*\.(pyc|p yo|bak|swp|aux|log|lof|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)" -delete diff --git a/.config/Scripts/configs b/.config/Scripts/configs deleted file mode 100644 index 58a5542..0000000 --- a/.config/Scripts/configs +++ /dev/null @@ -1,17 +0,0 @@ -cfb ~/.bashrc -cfz ~/.zshrc -cfv ~/.vimrc -cfr ~/.config/ranger/rc.conf -cfi ~/.config/i3/config -cfq ~/.config/qutebrowser/config.py -cfm ~/.config/mutt/muttrc -cfM ~/.config/moc/keymap -cff ~/.config/Scripts/folders -cfc ~/.config/Scripts/configs -cft ~/.config/termite/config -cfT ~/.tmux.conf -eb ~/Documents/LaTeX/uni.bib -cv ~/Documents/LaTeX/cv.tex -cfa ~/.config/mutt/etc/aliases -cfp ~/.config/polybar/config -cfd ~/.Xdefaults diff --git a/.config/Scripts/extract b/.config/Scripts/extract deleted file mode 100755 index aaf2911..0000000 --- a/.config/Scripts/extract +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# there are two different ways this script can work. -# for the first way, uncomment the two lines after the if and place two '.' in front of the /$1 -# this creates a new directory in the directory where the compressed file is and dumps the content in it -# for the second way, comment the two lines under the if and place just one '.' in front of the /$1 -# this just dumps the content of the compressed file in the same directory of the compressed file -if [ -f $1 ] ; then - NAME=${1%.*} - mkdir $NAME && cd $NAME - case $1 in - *.tar.bz2) tar xvjf ../$1 ;; - *.tar.gz) tar xvzf ../$1 ;; - *.tar.xz) tar xvJf ../$1 ;; - *.lzma) unlzma ../$1 ;; - *.bz2) bunzip2 ../$1 ;; - *.rar) unrar x -ad ../$1 ;; - *.gz) gunzip ../$1 ;; - *.tar) tar xvf ../$1 ;; - *.tbz2) tar xvjf ../$1 ;; - *.tgz) tar xvzf ../$1 ;; - *.zip) unzip ../$1 ;; - *.Z) uncompress ../$1 ;; - *.7z) 7z x ../$1 ;; - *.xz) unxz ../$1 ;; - *.exe) cabextract ../$1 ;; - *) echo "extract: '$1' - unknown archive method" ;; - esac -else -echo "$1 - file does not exist" - fi diff --git a/.config/Scripts/folders b/.config/Scripts/folders deleted file mode 100644 index 17a4b8d..0000000 --- a/.config/Scripts/folders +++ /dev/null @@ -1,10 +0,0 @@ -h ~/ -d ~/Documents -D ~/Downloads -pp ~/Pictures -vv ~/Videos -m ~/Music -b ~/Books -s ~/.config/Scripts -r / -cf ~/.config diff --git a/.config/Scripts/offlineimap-daemon.py b/.config/Scripts/offlineimap-daemon.py deleted file mode 100755 index fea76fc..0000000 --- a/.config/Scripts/offlineimap-daemon.py +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env python3 - -import subprocess -import signal -import threading -import sys - -import dbus -from dbus.mainloop.glib import DBusGMainLoop -from gi.repository import GLib - - -class OfflineimapCtl(object): - def __init__(self): - self.daemon_proc = None - self.run_ev = threading.Event() - self.run_daemon = False - - def run(self): - t = threading.Thread(target=self._watch_daemon, daemon=True) - t.start() - - def _watch_daemon(self): - while True: - self.run_ev.wait() - self.run_ev.clear() - if self.run_daemon: - self.is_running = True - print('offlineimap is being started') - self._spawn_daemon() - print('offlineimap has stopped') - self.run_ev.set() # check state and restart if needed - - def _spawn_daemon(self): - self.daemon_proc = subprocess.Popen(['offlineimap', '-u', 'basic'], shell=False) - self.daemon_proc.wait() - self.daemon_proc = None - - def start(self): - print('starting offlineimap') - self.run_daemon = True - self.run_ev.set() - - def stop(self): - print('stopping offlineimap') - self.run_daemon = False - if self.daemon_proc: - try: - self.daemon_proc.send_signal(signal.SIGUSR2) - except OSError: - print('Unable to stop offlineimap') - - def restart(self): - print('restarting offlineimap') - if self.run_daemon: - self.stop() - self.start() - - def onConnectivityChanged(self, state): - # 70 means fully connected - if state == 70: - self.start() - else: - self.stop() - -def main(): - oi_ctl = OfflineimapCtl() - oi_ctl.run() - - try: - bus = dbus.SystemBus(mainloop=DBusGMainLoop()) - network_manager = bus.get_object( - 'org.freedesktop.NetworkManager', - '/org/freedesktop/NetworkManager') - network = dbus.Interface(network_manager, - dbus_interface='org.freedesktop.NetworkManager') - - network.connect_to_signal('StateChanged', oi_ctl.onConnectivityChanged) - - # send current state as first event - state = network.state() - oi_ctl.onConnectivityChanged(state) - - except dbus.exceptions.DBusException: - print('Unable to connect to dbus') - sys.exit(3) - - # start receiving events from dbus - loop = GLib.MainLoop() - loop.run() - -if __name__ == '__main__': - main() diff --git a/.config/Scripts/offlineimap-daemonctl.sh b/.config/Scripts/offlineimap-daemonctl.sh deleted file mode 100755 index 18daf3d..0000000 --- a/.config/Scripts/offlineimap-daemonctl.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# this script runs offline imap as daemon (configured to check periodically) - -LOG=~/.offlineimap/sync.log -PIDFILE=~/.offlineimap/pid - -# if not present on PATH, those vars must point to proper locations -THIS_SCRIPT=offlineimap-daemonctl.sh -PYTHON_DAEMON=offlineimap-daemon.py - -daemon(){ - $PYTHON_DAEMON 2>&1 | - # add timestamps to logs - (while read line; do - echo `date` "$line" >> $LOG - done) -} - -stop(){ - kill -USR2 `cat $PIDFILE` -} - -refresh(){ - kill -USR1 `cat $PIDFILE` -} - -case "$1" in - '--daemon' | '-d' ) - nohup $THIS_SCRIPT < /dev/null > /dev/null 2>&1 & - ;; - '--kill' | '-k' ) - stop - ;; - '--refresh' | '-r' ) - refresh - ;; - * ) - daemon - ;; -esac
\ No newline at end of file diff --git a/.config/Scripts/remaps b/.config/Scripts/remaps deleted file mode 100644 index aa5a5f2..0000000 --- a/.config/Scripts/remaps +++ /dev/null @@ -1 +0,0 @@ -keycode 135 = Super_R NoSymbol Super_R diff --git a/.config/Scripts/screen.sh b/.config/Scripts/screen.sh deleted file mode 100755 index 03a8e79..0000000 --- a/.config/Scripts/screen.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -#Feed this script either: -# "l" for laptop screen only, -# "v" for vga screen only, -# or "d" for dual vga/laptop. - -d() { if [[ $(xrandr -q | grep VGA1\ con) ]] - then param $1 - else echo "No VGA input detected." - fi ;} -dual() { xrandr --output LVDS1 --auto --output VGA1 --auto --right-of LVDS1 ;} -laptop() { xrandr --output LVDS1 --auto --output VGA1 --off ;} -vga() { xrandr --output VGA1 --auto --output LVDS1 --off ;} -#mirror() { xrandr --addmode VGA1 $lapres && xrandr --output LVDS1 --mode $lapres --output VGA1 --mode $lapres ;} - -param() { -case $1 in - d) dual ;; - v) vga ;; - l) laptop ;; - *) echo -e "Invalid parameter. Add one of the following:\n\"d\" for dualscreen laptop and VGA.\n\"l\" for laptop only\n\"v\" for VGA only." ;; -esac ;} -d $1 diff --git a/.config/Scripts/screencast_alsa.sh b/.config/Scripts/screencast_alsa.sh deleted file mode 100755 index 95c1d5d..0000000 --- a/.config/Scripts/screencast_alsa.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -#This is the ffmpeg command that the screencast shortcut in i3 will run. - -#Picks a file name for the output file based on availability: - -while [[ -f $HOME/screencast$n.mkv ]] -do - n=$((n+1)) -done -filename="$HOME/screencast$n.mkv" - -#The actual ffmpeg command: - -ffmpeg -y \ --f x11grab \ --s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ --i :0.0 \ --thread_queue_size 1024 \ - -f alsa -ar 44100 -i hw:1 \ - -c:v libx264 -r 30 -c:a flac $filename - #-c:v ffvhuff -r 30 -c:a flac $filename diff --git a/.config/Scripts/screencast_pulse.sh b/.config/Scripts/screencast_pulse.sh deleted file mode 100755 index 8491606..0000000 --- a/.config/Scripts/screencast_pulse.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -#This is the ffmpeg command that the screencast shortcut in i3 will run. - -#Picks a file name for the output file based on availability: - -while [[ -f $HOME/screencast$n.mkv ]] -do - n=$((n+1)) -done -filename="$HOME/screencast$n.mkv" - -#The actual ffmpeg command: - -ffmpeg -y \ --f x11grab \ --framerate 60 \ --s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ --i :0.0 \ --f alsa -i default \ --r 30 \ - -c:v libx264 -r 30 -c:a flac $filename - #-c:v ffvhuff -r 30 -c:a flac $filename - #-f pulse -ac 1 -ar 44100 -i default \ diff --git a/.config/Scripts/shortcuts.sh b/.config/Scripts/shortcuts.sh deleted file mode 100755 index 0976e5f..0000000 --- a/.config/Scripts/shortcuts.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Config locations -folders="$HOME/.config/Scripts/folders" -configs="$HOME/.config/Scripts/configs" - -# Output locations -bash_shortcuts="$HOME/.bash_shortcuts" -ranger_shortcuts="$HOME/.config/ranger/shortcuts.conf" -qute_shortcuts="$HOME/.config/qutebrowser/shortcuts.py" - -# Ensuring that output locations are properly sourced -cat ~/.bashrc | grep "source ~/.bash_shortcuts" >/dev/null && - echo Bashrc already ready. || - (echo "source ~/.bash_shortcuts" >> ~/.bashrc && - echo Bashrc now prepared for shortcuts.) - -cat ~/.config/ranger/rc.conf | grep "source ~/.config/ranger/shortcuts.conf" >/dev/null && - echo Rc.conf already ready. || - (echo "source ~/.config/ranger/shortcuts.conf" >> ~/.config/ranger/rc.conf && - echo rc.conf now prepared for shortcuts.) - -cat ~/.config/qutebrowser/config.py | grep shortcuts.py >/dev/null && - echo "Qutebrowser's config.py already ready." || - (echo "config.source('shortcuts.py')" >> ~/.config/qutebrowser/config.py && - echo "qutebrowser's config.py now prepared for shortcuts.") - -#Delete old shortcuts -echo "# vim: filetype=sh" > $bash_shortcuts -echo "# ranger shortcuts" > $ranger_shortcuts -echo "# qutebrowser shortcuts" > $qute_shortcuts - -writeDirs() { echo "alias $1='cd $2 && ls -a'" >> $bash_shortcuts - echo "map g$1 cd $2" >> $ranger_shortcuts - echo "map t$1 tab_new $2" >> $ranger_shortcuts - echo "map m$1 shell mv %s $2" >> $ranger_shortcuts - echo "map Y$1 shell cp -r %s $2" >> $ranger_shortcuts - echo "config.bind(';$1', 'set downloads.location.directory $2 ;; hint links download')" >> $qute_shortcuts ;} - -writeConfs() { - echo "alias $1='vim $2'" >> $bash_shortcuts - echo "map $1 shell vim $2" >> $ranger_shortcuts ;} - -IFS=$'\n' -set -f -for line in $(cat "$folders"); do - line=$(echo $line | sed 's/#.*//') - key=$(echo $line | awk '{print $1}') - dir=$(echo $line | awk '{print $2}') - [ "$dir" == "" ] || writeDirs $key $dir -done && echo "Directory shortcuts done." - -set -f -for line in $(cat "$configs"); -do - line=$(echo $line | sed 's/#.*//') - short=$(echo $line | awk '{print $1}') - conf=$(echo $line | awk '{print $2}') - [ "$conf" == "" ] || writeConfs $short $conf -done && echo "Config file shortcuts done." - -echo "All done!" diff --git a/.config/Scripts/spawndl b/.config/Scripts/spawndl deleted file mode 100755 index a419041..0000000 --- a/.config/Scripts/spawndl +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -i3 exec "st -n dl -e youtube-dl $1" diff --git a/.config/Scripts/speedvid.sh b/.config/Scripts/speedvid.sh deleted file mode 100755 index ba3a4f6..0000000 --- a/.config/Scripts/speedvid.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -base=$(basename $1) -ext="${base##*.}" -base="${base%.*}" - -ffmpeg -i $1 -vf "setpts=$2*PTS" -an $base'_sped.'$ext diff --git a/.config/Scripts/tmuxinit b/.config/Scripts/tmuxinit deleted file mode 100755 index 68a4b86..0000000 --- a/.config/Scripts/tmuxinit +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -# This is the script that i3 runs to either start tmux in -# the dropdown terminal or log into a previous session. -tmux a || tmux diff --git a/.config/Scripts/transmission.sh b/.config/Scripts/transmission.sh deleted file mode 100755 index 794f6bb..0000000 --- a/.config/Scripts/transmission.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [ -f $(pgrep transmission) ]; - then - urxvt -e transmission-remote-cli - else - transmission-daemon && urxvt -e transmission-remote-cli -fi diff --git a/.config/Scripts/video.sh b/.config/Scripts/video.sh deleted file mode 100755 index ac3dc5c..0000000 --- a/.config/Scripts/video.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -#This is the ffmpeg command that the screencast shortcut in i3 will run. - -#Picks a file name for the output file based on availability: - -while [[ -f $HOME/video$n.mkv ]] -do - n=$((n+1)) -done -filename="$HOME/video$n.mkv" - - -#The actual ffmpeg command: - -ffmpeg \ --f x11grab \ --s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ --i :0.0 \ - -c:v libx264 -qp 0 -r 30 $filename - #-c:v ffvhuff -r 30 -c:a flac $filename diff --git a/.config/Scripts/webview b/.config/Scripts/webview deleted file mode 100755 index 17462fc..0000000 --- a/.config/Scripts/webview +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -# Feed script a url. -# Opens the url with xdg-open unless it is an image, -# in which case it downloads in feh. - -ext="${1##*.}" -mpvFiles="mkv mp4 gif" -fehFiles="png jpg jpeg jpe" -wgetFiles="mp3 flac opus mp3?source=feed pdf" - -pgrep i3 ifi3="i3 exec" - -if echo $fehFiles | grep -w $ext > /dev/null; then - nohup feh "$1" >/dev/null & -#elif [[ "$ext" == "gif" ]]; then -elif echo $mpvFiles | grep -w $ext > /dev/null; then - nohup mpv --loop --quiet "$1" > /dev/null & -elif echo $wgetFiles | grep -w $ext > /dev/null; then - nohup wget "$1" >/dev/null & -else - nohup $BROWSER "$1" >/dev/null & -fi diff --git a/.config/Scripts/welcome b/.config/Scripts/welcome deleted file mode 100755 index 2e33713..0000000 --- a/.config/Scripts/welcome +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -dialog --title "Welcome to LARBS!" --msgbox "If you're new to the system, hold down the Windows key and press F1 for a full tutorial! - -(This infobox will greet you at each login until you run the command \"hello-larbs\" in the terminal.)" 10 60 |
