let a thousand autistic tweaks bloom
This commit is contained in:
parent
5da0c95a7d
commit
6efc27037a
11 changed files with 37 additions and 41 deletions
|
@ -1,7 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# This script move the selected window to the bottom left of the screen.
|
# This script move the selected window to the bottom left of the screen.
|
||||||
|
|
||||||
current=$(xdotool getwindowfocus)
|
current=$(xdotool getwindowfocus)
|
||||||
|
|
||||||
# The window will take up no more than a third of
|
# The window will take up no more than a third of
|
||||||
|
@ -9,9 +8,9 @@ current=$(xdotool getwindowfocus)
|
||||||
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
newwidth=$(($(xdotool getdisplaygeometry | awk '{print $2}') / 3))
|
||||||
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
newheight=$(($(xdotool getdisplaygeometry | awk '{print $1}') / 3))
|
||||||
|
|
||||||
xdotool windowsize $(xdotool getwindowfocus) $newheight $newwidth
|
xdotool windowsize "$(xdotool getwindowfocus)" $newheight $newwidth
|
||||||
|
|
||||||
newsize=$(xdotool getwindowgeometry $(xdotool getwindowfocus) | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
newsize=$(xdotool getwindowgeometry "$(xdotool getwindowfocus)" | grep Geometry | sed -e 's/x/ /g' | awk '{print $3}')
|
||||||
|
|
||||||
height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
height=$(($(xdotool getdisplaygeometry | awk '{print $2}') - newsize))
|
||||||
xdotool windowmove $current 0 $height
|
xdotool windowmove "$current" 0 $height
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% --title="mpvfloat" /dev/video0
|
pkill -f /dev/video || mpv --no-osc --no-input-default-bindings --input-conf=/dev/null --geometry=-0-0 --autofit=30% --title="mpvfloat" /dev/video0
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
# bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24
|
# bindsym $mod+a exec --no-startup-id ddspawn dropdowncalc -f mono:pixelsize=24
|
||||||
# Similar to above but with `dropdowncalc` and the other args are interpretated as for my terminal emulator (to increase font)
|
# Similar to above but with `dropdowncalc` and the other args are interpretated as for my terminal emulator (to increase font)
|
||||||
|
|
||||||
|
|
||||||
[ -z "$1" ] && exit
|
[ -z "$1" ] && exit
|
||||||
|
|
||||||
if xwininfo -tree -root | grep "(\"$1\" ";
|
if xwininfo -tree -root | grep "(\"$1\" ";
|
||||||
|
|
|
@ -43,7 +43,5 @@ esac
|
||||||
|
|
||||||
# Fix feh background if screen size/arangement has changed.
|
# Fix feh background if screen size/arangement has changed.
|
||||||
feh --bg-scale "$HOME/.config/wall.png"
|
feh --bg-scale "$HOME/.config/wall.png"
|
||||||
# Polybar users will want to uncomment this line, which reactivates polybar on all new displays:
|
|
||||||
#polybar_launch
|
|
||||||
# Re-remap keys if keyboard added (for laptop bases)
|
# Re-remap keys if keyboard added (for laptop bases)
|
||||||
remaps
|
remaps
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
|
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
|
||||||
|
|
||||||
CMD=$TERMINAL
|
CMD=$TERMINAL
|
||||||
|
@ -8,20 +8,20 @@ CWD=''
|
||||||
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
|
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
|
||||||
|
|
||||||
# Get PID of process whose window this is
|
# Get PID of process whose window this is
|
||||||
PID=$(xprop -id $ID | grep -m 1 PID | cut -d " " -f 3)
|
PID=$(xprop -id "$ID" | grep -m 1 PID | cut -d " " -f 3)
|
||||||
|
|
||||||
# Get last child process (shell, vim, etc)
|
# Get last child process (shell, vim, etc)
|
||||||
if [ -n "$PID" ]; then
|
if [ -n "$PID" ]; then
|
||||||
TREE=$(pstree -lpA $PID | tail -n 1)
|
TREE=$(pstree -lpA "$PID" | tail -n 1)
|
||||||
PID=$(echo $TREE | awk -F'---' '{print $NF}' | sed -re 's/[^0-9]//g')
|
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 we find the working directory, run the command in that directory
|
||||||
if [ -e "/proc/$PID/cwd" ]; then
|
if [ -e "/proc/$PID/cwd" ]; then
|
||||||
CWD=$(readlink /proc/$PID/cwd)
|
CWD=$(readlink /proc/"$PID"/cwd)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ -n "$CWD" ]; then
|
if [ -n "$CWD" ]; then
|
||||||
cd $CWD && $CMD
|
cd "$CWD" && "$CMD"
|
||||||
else
|
else
|
||||||
$CMD
|
"$CMD"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
clip=$(xclip -o -selection clipboard)
|
clip=$(xclip -o -selection clipboard)
|
||||||
|
|
||||||
|
|
||||||
prim=$(xclip -o -selection primary)
|
prim=$(xclip -o -selection primary)
|
||||||
|
|
||||||
[ "$prim" != "" ] && notify-send "<b>Clipboard:</b>
|
[ "$prim" != "" ] && notify-send "<b>Clipboard:</b>
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
echo | dmenu -p "Give width and height:" | xargs xdotool windowsize "$(xdotool getwindowfocus)"
|
echo "📐" | dmenu -p "Give width and height:" | xargs xdotool windowsize "$(xdotool getwindowfocus)"
|
||||||
|
|
|
@ -1,15 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Give this script a .pdf and it will attempt
|
# Give this script a .pdf and it will attempt
|
||||||
# to return a proper .bib citation via doi.
|
# to return a proper .bib citation via doi.
|
||||||
# Internet connection required.
|
# Internet connection required.
|
||||||
|
|
||||||
|
if [ -f "$1" ];
|
||||||
|
then
|
||||||
# Get the doi from metadata, if not possible, get
|
# Get the doi from metadata, if not possible, get
|
||||||
# doi from pdftotext output, if not possible, exit.
|
# doi from pdftotext output, if not possible, exit.
|
||||||
doi=$(pdfinfo "$1" | grep -o doi:.*) ||
|
doi=$(pdfinfo "$1" | grep -io "doi:.*") ||
|
||||||
doi=$(pdftotext "$1" - | grep -o doi.* -m 1) ||
|
doi=$(pdftotext "$1" 2>/dev/null - | grep -o "doi:.*" -m 1) ||
|
||||||
exit 1
|
exit 1
|
||||||
|
else
|
||||||
|
# If not given file, assume argument is doi
|
||||||
|
doi="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
# Check crossref.org for the bib citation.
|
# Check crossref.org for the bib citation.
|
||||||
curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\n" |
|
curl -s "http://api.crossref.org/works/$doi/transform/application/x-bibtex" -w "\\n" |
|
||||||
sed -e "/^[^\(\t\|@\|}\)]/d"
|
sed -e "/^[^\\(\\t\\|@\\|}\\)]/d"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# A general audio interface for LARBS.
|
# A general audio interface for LARBS.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ case "$1" in
|
||||||
p*) mpc pause ; pauseallmpv ;;
|
p*) mpc pause ; pauseallmpv ;;
|
||||||
f*) mpc seek +"$num" ;;
|
f*) mpc seek +"$num" ;;
|
||||||
b*) mpc seek -"$num" ;;
|
b*) mpc seek -"$num" ;;
|
||||||
r*) mpc seek 0\% ;;
|
r*) mpc seek 0% ;;
|
||||||
*) cat << EOF
|
*) cat << EOF
|
||||||
lmc: cli music interface for mpd and pulse for those with divine intellect too
|
lmc: cli music interface for mpd and pulse for those with divine intellect too
|
||||||
grand to remember the mpc/pamixer commands.
|
grand to remember the mpc/pamixer commands.
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
base=$(basename $1)
|
|
||||||
ext="${base##*.}"
|
|
||||||
base="${base%.*}"
|
|
||||||
|
|
||||||
ffmpeg -i $1 -vf "setpts=$2*PTS" -an $base'_sped.'$ext
|
|
|
@ -1,12 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# Clears the build files of a LaTeX/XeLaTeX build.
|
# Clears the build files of a LaTeX/XeLaTeX build.
|
||||||
# I have vim run this file whenever I exit a .tex file.
|
# I have vim run this file whenever I exit a .tex file.
|
||||||
|
|
||||||
[[ "$1" == *.tex ]] || exit
|
case "$1" in
|
||||||
|
*.tex)
|
||||||
file=$(readlink -f "$1")
|
file=$(readlink -f "$1")
|
||||||
dir=$(dirname "$file")
|
dir=$(dirname "$file")
|
||||||
base="${file%.*}"
|
base="${file%.*}"
|
||||||
|
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\\(busy\\)|lof|nav|out|snm|toc|bcf|run\\.xml|synctex\\.gz|blg|bbl)" -delete ;;
|
||||||
|
*) printf "Give .tex file as argument.\\n" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
find "$dir" -maxdepth 1 -type f -regextype gnu-awk -regex "^$base\.(4tc|xref|tmp|pyc|pyo|fls|vrb|fdb_latexmk|bak|swp|aux|log|synctex\(busy\)|lof|nav|out|snm|toc|bcf|run\.xml|synctex\.gz|blg|bbl)" -delete
|
|
||||||
|
|
Loading…
Reference in a new issue