diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bin/dot | 48 | ||||
-rwxr-xr-x | bin/bin/dyndns | 5 | ||||
-rwxr-xr-x | bin/bin/i3-shell | 27 | ||||
-rwxr-xr-x | bin/bin/keyboard | 3 | ||||
-rwxr-xr-x | bin/bin/references | 5 | ||||
-rwxr-xr-x | bin/bin/rename_workspace | 12 | ||||
-rwxr-xr-x | bin/bin/swap | 16 | ||||
-rwxr-xr-x | bin/bin/vimin | 2 | ||||
-rwxr-xr-x | bin/bin/workspace | 2 |
9 files changed, 10 insertions, 110 deletions
diff --git a/bin/bin/dot b/bin/bin/dot deleted file mode 100755 index acb0e64..0000000 --- a/bin/bin/dot +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -get_links() -{ - find $HOME -not -path "$HOME/dotfiles/*" -type l | while read line; do - if [[ "$(realpath -q $line)" == "${HOME}/dotfiles/"* ]]; then - echo $line - fi - done -} - -clean() -{ - get_links | while read link; do - rm -v ${link} - done -} - -down() -{ - source $HOME/dotfiles/.dotmap - for link in "${!dotmap[@]}"; do - echo "Removing ${link}." - rm -rf $link - done -} - -up() -{ - source $HOME/dotfiles/.dotmap - for link in "${!dotmap[@]}"; do - target=${dotmap[$link]} - mkdir -p $(dirname ${link}) - echo "Linking $target." - rm -rf $link && ln -s $target $link - done -} - -save() -{ - echo "declare -A dotmap" > .dotmap - get_links | while read link; do - echo "dotmap[$link]=$(readlink -f -q $link)" | sed "s#$HOME#"'$HOME#g' >> .dotmap - done - sort .dotmap -o .dotmap -} - -$1 diff --git a/bin/bin/dyndns b/bin/bin/dyndns deleted file mode 100755 index 8d1f553..0000000 --- a/bin/bin/dyndns +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -PASSWORD=$(pass show email/urbain@vaes.uk) - -curl -4 -X PUT --user "urbain@vaes.uk:$PASSWORD" https://box.bknguyen.org/admin/dns/custom/urbainvaes.com diff --git a/bin/bin/i3-shell b/bin/bin/i3-shell deleted file mode 100755 index 120e4b4..0000000 --- a/bin/bin/i3-shell +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152 - -CMD=urxvt -CWD='' - -# Get window ID -ID=$(xdpyinfo | grep focus | cut -f4 -d " ") - -# Get PID of process whose window this is -PID=$(xprop -id $ID | grep -m 1 PID | cut -d " " -f 3) - -# Get last child process (shell, vim, etc) -if [ -n "$PID" ]; then - TREE=$(pstree -lpA $PID | tail -n 1) - PID=$(echo $TREE | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g') - - # If we find the working directory, run the command in that directory - if [ -e "/proc/$PID/cwd" ]; then - CWD=$(readlink /proc/$PID/cwd) - fi -fi -if [ -n "$CWD" ]; then - cd $CWD && $CMD -else - $CMD -fi diff --git a/bin/bin/keyboard b/bin/bin/keyboard index d00035b..45d9972 100755 --- a/bin/bin/keyboard +++ b/bin/bin/keyboard @@ -30,6 +30,9 @@ xmodmap -e "keysym g = g G 7" xmodmap -e "keysym c = c C 8" xmodmap -e "keysym r = r R 9" +# Special characters +xmodmap -e "keysym XF86Eject = Insert" + # Xcape settings killall -9 xcape diff --git a/bin/bin/references b/bin/bin/references new file mode 100755 index 0000000..a578728 --- /dev/null +++ b/bin/bin/references @@ -0,0 +1,5 @@ +#!/bin/bash +REF_DIR="$HOME/phd/references" +PDF=$(locate "$REF_DIR/**/*.pdf") +TARGET=$(echo "${PDF//"$REF_DIR/"/}" | dmenu -i -p "Open File:") +[[ -n $TARGET ]] && zathura "$REF_DIR/$TARGET" & diff --git a/bin/bin/rename_workspace b/bin/bin/rename_workspace deleted file mode 100755 index 61fffd3..0000000 --- a/bin/bin/rename_workspace +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -workspace=$(i3-msg -t get_workspaces | grep -Po '{[^}]*"focused":true[^}]*}' | sed 's/.*"name":"\([^"]*\)".*$/\1/g') -number=$(i3-msg -t get_workspaces | grep -Po '{[^}]*"focused":true[^}]*}' | sed 's/{"num":\([^,]*\),.*$/\1/g') - -new_name=$(zenity --entry --title="Rename workspace" --entry-text "$workspace") -if [[ "$new_name" != *:* ]]; then - new_name="$number:$new_name" -fi - -echo $new_name -exec i3-msg rename workspace to "$new_name" diff --git a/bin/bin/swap b/bin/bin/swap deleted file mode 100755 index 4c17dc7..0000000 --- a/bin/bin/swap +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python - -import i3 -outputs = i3.get_outputs() -print(outputs[0]) - -# set current workspace to output 0 -i3.workspace(outputs[0]['current_workspace']) - -# ..and move it to the other output. -# outputs wrap, so the right of the right is left ;) -i3.command('move', 'workspace to output right') - -# rinse and repeat -i3.workspace(outputs[1]['current_workspace']) -i3.command('move', 'workspace to output right') diff --git a/bin/bin/vimin b/bin/bin/vimin index 905b30f..b00d8fa 100755 --- a/bin/bin/vimin +++ b/bin/bin/vimin @@ -1,4 +1,4 @@ #!/usr/bin/env bash tempfile=$(mktemp) -urxvt -e vim ${tempfile} +urxvt -e nvim ${tempfile} +star cat ${tempfile} | xclip -i diff --git a/bin/bin/workspace b/bin/bin/workspace index a9e4aa0..e380f98 100755 --- a/bin/bin/workspace +++ b/bin/bin/workspace @@ -11,7 +11,7 @@ workspaces=$(i3-msg -t get_workspaces | grep -Po '"name":.*?[^\\]"' | sed 's/"na workspaces=$(echo $workspaces | sed '/:/!d') # Get desired workspace -target=$(echo $workspaces | dmenu -b -i -sf green -p "Go to workspace:") +target=$(echo $workspaces | dmenu "Go to workspace:") # Exit if empty [[ -z $target ]] && exit |