summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorUrbain Vaes <urbain@vaes.uk>2015-10-09 17:26:07 +0100
committerUrbain Vaes <urbain@vaes.uk>2015-10-09 17:26:07 +0100
commit777498e2ed6db0426b1366fe218bea905c881439 (patch)
tree122d7ea93e65a1be00421e86195096cdcb5713bd /bin
parentf2c1c49654862c14b214e91d9b40eabed255f3af (diff)
Add shortcut to run any script from bin
Diffstat (limited to 'bin')
-rwxr-xr-xbin/books5
-rwxr-xr-xbin/clean2
-rwxr-xr-xbin/install2
-rwxr-xr-xbin/run5
-rwxr-xr-xbin/xopen9
5 files changed, 12 insertions, 11 deletions
diff --git a/bin/books b/bin/books
new file mode 100755
index 0000000..8524277
--- /dev/null
+++ b/bin/books
@@ -0,0 +1,5 @@
+#!/bin/bash
+BOOKS_DIR="$HOME/Dropbox/books"
+PDF=$(locate "$BOOKS_DIR/*.pdf")
+TARGET=$(echo "${PDF//"$BOOKS_DIR/"/}" | dmenu -i -p "Open File:")
+[[ -n $TARGET ]] && zathura "$BOOKS_DIR/$TARGET" &
diff --git a/bin/clean b/bin/clean
index f2bb7e4..19a0455 100755
--- a/bin/clean
+++ b/bin/clean
@@ -1,5 +1,5 @@
#! /bin/bash
-dotdir=/home/urbain/dotfiles
+dotdir=/home/urbain/dotfiles && cd $dotdir
for file in `ls -A --ignore="Makefile" --ignore="README.md" --ignore=".git*"`; do
if [[ -f $file/Makefile ]]; then
cd $file && make clean && cd $dotdir
diff --git a/bin/install b/bin/install
index 438c5b9..bc21136 100755
--- a/bin/install
+++ b/bin/install
@@ -1,5 +1,5 @@
#! /bin/bash
-dotdir=/home/urbain/dotfiles
+dotdir=/home/urbain/dotfiles && cd $dotdir
for file in `ls -A --ignore="Makefile" --ignore="README.md" --ignore=".git*"`; do
if [[ -f $file/Makefile ]]; then
cd $file && make && cd $dotdir
diff --git a/bin/run b/bin/run
new file mode 100755
index 0000000..4b57856
--- /dev/null
+++ b/bin/run
@@ -0,0 +1,5 @@
+#!/bin/bash
+SCRIPTS_DIR="$HOME/dotfiles/bin" && cd $SCRIPTS_DIR
+SCRIPTS=$(ls -A $SCRIPTS_DIR)
+TARGET=$(echo "${SCRIPTS//"$SCRIPTS_DIR/"/}" | dmenu -i -p "Run script:")
+[[ -n $TARGET ]] && "$SCRIPTS_DIR/$TARGET"
diff --git a/bin/xopen b/bin/xopen
deleted file mode 100755
index a133a47..0000000
--- a/bin/xopen
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/bash
-cd ~
-PDF=$(locate "$HOME/*.pdf")
-DJVU=$(locate "$HOME/*.djvu")
-RESULTS="$PDF
-$DJVU"
-TARGET=$(echo "${RESULTS//"$HOME/"/}" | dmenu -i -p "Open File:" | tr -d '[[:space:]]')
-[[ -n $TARGET ]] || exit
-xdg-open "$TARGET" &