From 777498e2ed6db0426b1366fe218bea905c881439 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Fri, 9 Oct 2015 17:26:07 +0100 Subject: Add shortcut to run any script from bin --- .i3/config | 1 + bin/books | 5 +++++ bin/clean | 2 +- bin/install | 2 +- bin/run | 5 +++++ bin/xopen | 9 --------- 6 files changed, 13 insertions(+), 11 deletions(-) create mode 100755 bin/books create mode 100755 bin/run delete mode 100755 bin/xopen diff --git a/.i3/config b/.i3/config index 82eb35c..0963373 100644 --- a/.i3/config +++ b/.i3/config @@ -192,3 +192,4 @@ bindsym XF86MonBrightnessDown exec xbacklight -dec 10 # font pango:DejaVu Sans Mono 10 bindsym F1 exec --no-startup-id feh --bg-fill --randomize /usr/share/backgrounds +bindsym $mod+semicolon exec --no-startup-id /home/urbain/dotfiles/bin/run 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" & -- cgit v1.2.3