initial
This commit is contained in:
commit
c0e7f7c24d
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
if [ -f ./build.sh ]; then
|
||||
./build.sh
|
||||
elif [ -f Makefile ]; then
|
||||
make
|
||||
else
|
||||
echo "no makefile or build script in current directory"
|
||||
fi
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# chromium launcher
|
||||
# chromium clears my bitmap font from my font cache, so i just reload it
|
||||
|
||||
chromium ; fc-cache -fv
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
|
||||
# program for searching the c/c++ reference
|
||||
|
||||
if [ -z ${BROWSER+x} ]; then
|
||||
echo "set BROWSER before running this script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
string="https://en.cppreference.com/mwiki/index.php?title=Special%3ASearch&search=$1"
|
||||
|
||||
$BROWSER $string
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Intialize git repos on my own server
|
||||
|
||||
ssh git@skoskapet "cd opfez && mkdir $1 && cd $1 && git init --bare"
|
||||
|
||||
echo -n "Do you want to add this repo as origin? (y/N) " && read answer && \
|
||||
[[ $answer == "y" ]] && git remote add origin git@skoskapet:~/opfez/$1
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/sh
|
||||
if [ $# -lt 3 ]; then exit 1; fi
|
||||
|
||||
curdir="$(pwd)"
|
||||
prog="$2"
|
||||
cd "$1"
|
||||
shift
|
||||
shift
|
||||
$prog $@
|
||||
cd $curdir
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
curl https://am.i.mullvad.net/connected
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/sh
|
||||
|
||||
# New Norwegian linter
|
||||
|
||||
input_file="$(cat $1)"
|
||||
|
||||
get_page() {
|
||||
curl "https://ordbok.uib.no/perl/ordbok.cgi?OPP=$1&ant_bokmaal=5&ant_nynorsk=5&nynorsk=+&ordbok=nynorsk" 2>/dev/null
|
||||
}
|
||||
|
||||
no_errors=1
|
||||
|
||||
for token in $input_file; do
|
||||
word="$(echo $token | sed 's/\.//g')"
|
||||
get_page "$word" | grep "class=\"ikkefunnet\"" >/dev/null
|
||||
status=$?
|
||||
if [ 0 -eq $status ]; then
|
||||
echo "word not found: $word"
|
||||
no_errors=0
|
||||
fi
|
||||
done
|
||||
|
||||
if [ 1 -eq $no_errors ]; then
|
||||
echo "all good!"
|
||||
fi
|
|
@ -0,0 +1,96 @@
|
|||
#!/bin/sh
|
||||
|
||||
# pams - the posix aur management script
|
||||
# simple script for interacting with the aur
|
||||
# options:
|
||||
# -S - synchronize list of aur packages.
|
||||
# -a pkg_name - audit a specific package's pkgbuild.
|
||||
# -d pkg_name - downloads a specific package from the aur to $aur and shows the pkgbuild file.
|
||||
# -i pkg_name - install downloaded packages using the 'makepkg -si' command.
|
||||
# -r pkg_name - removes package from the ~/aur directory
|
||||
# -s search_term - list packages with the search team in the title.
|
||||
# -u pkg_name - updates a package.
|
||||
|
||||
|
||||
# error messages
|
||||
|
||||
err_usage() {
|
||||
echo "usage: [-S | -a pkg_name | -d pkg_name | -i pkg_name | -r pkg_name | -s search_term]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
err_add_args() {
|
||||
echo "this flag requires an additional argument"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# main program
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
err_usage
|
||||
else
|
||||
aur="$HOME/aur"
|
||||
case "$1" in
|
||||
|
||||
-S) mkdir "$aur" 2>/dev/null
|
||||
curl https://aur.archlinux.org/packages.gz \
|
||||
--silent --output - \
|
||||
| gunzip > "$aur"/aurlist
|
||||
;;
|
||||
|
||||
-a) if [ $# -ne 2 ]; then
|
||||
err_add_args
|
||||
else
|
||||
less "$aur"/"$2"/PKGBUILD
|
||||
fi
|
||||
;;
|
||||
|
||||
-d) if [ $# -ne 2 ]; then
|
||||
err_add_args
|
||||
else
|
||||
originaldir="$(pwd)"
|
||||
mkdir "$aur" 2>/dev/null
|
||||
cd "$aur" || exit
|
||||
git clone https://aur.archlinux.org/"$2".git
|
||||
less "$aur"/"$2"/PKGBUILD
|
||||
cd "$originaldir" || exit
|
||||
fi
|
||||
;;
|
||||
|
||||
-i) if [ $# -ne 2 ]; then
|
||||
err_add_args
|
||||
else
|
||||
originaldir="$(pwd)"
|
||||
cd "$aur"/"$2" || exit
|
||||
makepkg -si
|
||||
cd "$originaldir" || exit
|
||||
fi
|
||||
;;
|
||||
|
||||
-r) if [ $# -ne 2 ]; then
|
||||
err_add_args
|
||||
else
|
||||
rm -rf "{$aur/$2:?}"
|
||||
fi
|
||||
;;
|
||||
|
||||
-s) if [ $# -ne 2 ]; then
|
||||
err_add_args
|
||||
else
|
||||
grep "$2" "$aur"/aurlist
|
||||
fi
|
||||
;;
|
||||
|
||||
-u) if [ $# -ne 2 ]; then
|
||||
err_add_args
|
||||
else
|
||||
rm -rf "{$aur/$2:?}"
|
||||
pams -d "$2"
|
||||
pams -i "$2"
|
||||
fi
|
||||
;;
|
||||
|
||||
*) err_usage
|
||||
esac
|
||||
fi
|
|
@ -0,0 +1,20 @@
|
|||
#! /bin/bash
|
||||
|
||||
file="$HOME/.local/share/unhide"
|
||||
app="$1"
|
||||
#target="$2"
|
||||
|
||||
tid=$(xdo id)
|
||||
|
||||
|
||||
hidecurrent() {
|
||||
echo $tid+$app >> $file & xdo hide
|
||||
}
|
||||
|
||||
showlast() {
|
||||
sid=$(cat $file | grep "$app" | awk -F "+" 'END{print $1}')
|
||||
xdo show -r $sid
|
||||
}
|
||||
|
||||
hidecurrent & $@ ; showlast
|
||||
|
Loading…
Reference in New Issue