Many changes

This commit is contained in:
Jonathan Hodgson 2019-10-10 17:29:09 +01:00
parent d6c23ea057
commit dbfbbd2623
39 changed files with 1416 additions and 18 deletions

19
bin/.bin/dmenu/get-bookmark Executable file
View file

@ -0,0 +1,19 @@
#!/usr/bin/env bash
BOOKMARKS="$HOME/.surf/bookmarks/"
function formatFile(){
keywords="$(grep -E '^keywords:' "$1" | sed 's/^keywords://')"
echo "$1 : $keywords" | sed 's/ / /g'
}
export -f formatFile
if [ -d "$BOOKMARKS" ]; then
cd "$BOOKMARKS"
selection=$(find . -type f -exec bash -c 'formatFile "{}"' \; | dmenu -l 20 | sed 's/ : .*//')
if [ -f "$selection" ]; then
head -n 1 "$selection"
fi
else
echo "$BOOKMARKS doesn't exist"
fi

12
bin/.bin/dmenu/man-page-pdf Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
man -k . |\
awk '{ print $1 " " $2 }' |\
rofi -dmenu -p man -i -matching regex |\
awk '{ print $2 " " $1 }' |\
tr -d '()' |\
xargs man -t |\
ps2pdf - - |\
zathura -

10
bin/.bin/dmenu/offline-aw Executable file
View file

@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Offline version of aw in markdown
AW_FOLDER="$HOME/GitRepos/arch-wiki-md-repo/wiki/_content/english/"
cd "$AW_FOLDER"
selection=$(find . -name \*.md | rofi -dmenu -i -p "Page")
compiler "$selection"
opout "$selection"

10
bin/.bin/dmenu/open-file Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
while name=$(xsel -o | dmenu -p 'Find File') || exit
do
[[ $name ]] || exit
list=$(sudo locate -A -e -i $name)
[[ $list ]] || continue
file=$(echo -e "$list" | dmenu -l 12 -p 'Open') || exit
echo -n "$file" | xsel -b -i
xdg-open "$file"
done

5
bin/.bin/dmenu/ports Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/env bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
cat "$SCRIPTPATH/ports-common.csv" "$SCRIPTPATH/ports-uncommon.csv" | tr ',' '\t' | rofi -dmenu -i

7
bin/.bin/dmenu/screenlayout Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
FOLDER="$HOME/.dotfiles/bin/.bin/screenlayouts/"
script=$(ls "$FOLDER" | sed 's/\.sh$//' | rofi -dmenu -p "Layout" )
"${FOLDER}${script}.sh"