Compare commits

..

No commits in common. "0974ea361a66df39886d4bd18ae1b721e40701aa" and "6de54314773fe3cd7ea9b278118c904b8b075a24" have entirely different histories.

15 changed files with 1 additions and 248 deletions

View File

@ -4,6 +4,6 @@
device_id="$(xsetwacom list devices | grep STYLUS | cut -f2 | cut -d' ' -f2)" device_id="$(xsetwacom list devices | grep STYLUS | cut -f2 | cut -d' ' -f2)"
xsetwacom set "$device_id" MapToOutput 1920x1200+0+0 xsetwacom set "$device_id" MapToOutput 1920x1080+0+0
xsetwacom set "$device_id" Area 0 0 15200 8550 xsetwacom set "$device_id" Area 0 0 15200 8550

View File

@ -1 +0,0 @@
../display-config/display-config.sh

View File

@ -1 +0,0 @@
../display-restore/display-restore.sh

View File

@ -1 +0,0 @@
../latex_hotreload/latex_hotreload.sh

View File

@ -1 +0,0 @@
../screen-saver/screen-saver.sh

View File

@ -6,10 +6,6 @@ time="$(upower -i $DEVICE | grep time | cut -d':' -f2 | tr -s ' ' | cut -c2-)"
perc="$(upower -i $DEVICE | grep percentage | awk '{print $2}' | tr -d '%')" perc="$(upower -i $DEVICE | grep percentage | awk '{print $2}' | tr -d '%')"
stat="$(upower -i $DEVICE | grep state | awk '{print $2}')" stat="$(upower -i $DEVICE | grep state | awk '{print $2}')"
if [ "$stat" = "charging" ]; then
exit 0
fi
if [ "$perc" -le "20" ]; then if [ "$perc" -le "20" ]; then
urgency="normal" urgency="normal"
if [ "$perc" -le "10" ]; then if [ "$perc" -le "10" ]; then

View File

@ -1,7 +0,0 @@
# display-config
## About
-- about section here --
## Requirements
-- any requirements --

View File

@ -1,128 +0,0 @@
#!/bin/sh
if [ "$(command -v rofi)" ]; then
CMD='rofi -dmenu -i';
elif [ "$(command -v dmenu)" ]; then
CMD='dmenu';
else
echo 'Could not find either dmenu or rofi, exiting'
exit 1;
fi
# $1 - monitor name
#
# return "WIDTH1xHEIGTH1\nWIDTH2xHEIGTH2\n..."
get_monitor_sizes() {
xrandr | awk -v monitor="$1" \
'$1 == monitor { display=1; next } /^[A-Z]/ { display=0 } display { print $1 }'
}
# $1 - monitor name
#
# return xrandr "--mode WIDTHxHEIGTH" or "--preferred"
monitor_config() {
sizes="$(get_monitor_sizes "$1")"
if [ "$1" = "eDP-1" ]; then
DISPLAY_CONFIGS="Preferred\n$sizes"
else
DISPLAY_CONFIGS="$sizes"
fi
CONFIG="$(echo "$DISPLAY_CONFIGS" | $CMD -p "Monitor $1 config" | xargs)"
case "$CONFIG" in
Preferred)
echo "--preferred"
return
;;
"")
exit 1
;;
*)
echo "--mode $CONFIG"
return
;;
esac
}
# return "eDP-1\nHDMI-1\n..."
get_monitors() {
xrandr | awk '$2 == "connected" {print $1}'
}
monitors="$(get_monitors)"
n_monitors="$(echo "$monitors" | wc -l)"
if [ "$n_monitors" -eq "1" ]; then
config="$(monitor_config "$monitors")" || exit 1
# shellcheck disable=SC2086
xrandr --output "$monitors" $config
elif [ "$n_monitors" -eq "2" ]; then
DISPLAY_ARRANGEMENTS="Join\nMirror\nOnly"
N_ARRANGEMENTS="$(echo $DISPLAY_ARRANGEMENTS | wc -l)"
ARRANGEMENT="$(echo "$DISPLAY_ARRANGEMENTS" | $CMD -l "$N_ARRANGEMENTS" -p "Display arrangement" | xargs)"
case "$ARRANGEMENT" in
Join)
args=""
prev_monitor=""
for monitor in $(get_monitors); do
position=""
if [ "$prev_monitor" != "" ]; then
POSITIONS="right-of\nleft-of\nabove\nbelow"
N_POSITIONS=4
position_flag="$(echo "$POSITIONS" | $CMD -l "$N_POSITIONS" -p "Select position" | xargs)"
if [ "$position_flag" = "" ]; then exit 1; fi
position="--$position_flag $prev_monitor"
fi
config="$(monitor_config "$monitor")" || exit 1
args="$args --output $monitor $config $position"
prev_monitor="$monitor"
done
# shellcheck disable=SC2086
xrandr $args
;;
Mirror)
args=""
prev_monitor=""
for monitor in $(get_monitors); do
config="$(monitor_config "$monitor")" || exit 1
args="$args --output $monitor $config"
if [ "$prev_monitor" != "" ]; then
args="$args --same-as $prev_monitor"
fi
prev_monitor="$monitor"
done
# shellcheck disable=SC2086
xrandr $args
;;
Only)
monitors="$(get_monitors)"
n_monitors="$(echo "$monitors" | wc -l)"
monitor="$(echo "$monitors" | $CMD -l "$n_monitors" -p "Select monitor" | xargs)"
if [ "$monitor" = "" ]; then exit 1; fi
config="$(monitor_config "$monitor")" || exit 1
args=""
for monitor_i in $monitors; do
if [ "$monitor_i" = "$monitor" ]; then
args="$args --output $monitor_i $config"
else
args="$args --output $monitor_i --off"
fi
done
# I do want word splitting for argument config
# shellcheck disable=SC2086
xrandr $args
;;
*)
exit 0
;;
esac
else
arandr
fi

View File

@ -1,7 +0,0 @@
# display-restore
## About
-- about section here --
## Requirements
-- any requirements --

View File

@ -1,23 +0,0 @@
#!/bin/sh
restore() {
n_active_displays="$(xrandr | awk '/ connected/ && /[0-9]+x[0-9]+\+[0-9]+\+[0-9]+/ { print $1 }' | wc -l)"
if [ "$n_active_displays" -ge "1" ]; then
return 0
fi
monitor="$(xrandr | awk '$2 == "connected" {print $1; exit}')"
xrandr --output "$monitor" --preferred
}
if [ "$1" = "loop" ]; then
while true
do
restore
sleep 5
done
else
restore
fi

View File

@ -1,7 +0,0 @@
# latex_hotreload
## About
-- about section here --
## Requirements
-- any requirements --

View File

@ -1,51 +0,0 @@
#!/bin/bash
entry="$1"
files_to_watch=$()
if [ -z "$entry" ]; then
echo "Error: no entry provided. See --help for usage"
exit 1
fi
if [ "$entry" == "--help" ]; then
echo "Usage: latex_hotreload [OPTIONS] entry_tex_file"
echo ""
echo " OPTIONS:"
echo " --help: show this help"
echo ""
echo " STDIN:"
echo " The stdin should contain the files that should be watched for recompilation"
echo " Defaults to ./*.tex"
echo ""
echo " ARGUMENTS:"
echo " entry_tex_file: the entry latex file for compilation"
echo ""
exit 0
fi
output="$(echo "$entry" | sed 's/\.tex$/.pdf/')"
if test ! -t 0; then
while IFS= read -r line
do
files_to_watch+=("$line")
done
files=$(printf "%s" "${files_to_watch[*]}")
files="$(echo $files | sed 's/ /\n/')"
else
files="$(find . -type f | grep "\.tex")"
fi
echo $files | sed 's/ /\n/g' | entr -s "pdflatex -shell-escape $entry" &
entr_pid=$!
while [ ! -f "$output" ]
do
sleep 0.5
done
zathura "$output"
kill -s 2 "$entr_pid"

View File

@ -3,7 +3,6 @@
id="$(xinput list | grep Touchpad | cut -f 2 | sed 's/id=//')" id="$(xinput list | grep Touchpad | cut -f 2 | sed 's/id=//')"
xinput disable "$id" xinput disable "$id"
sleep 1
xinput enable "$id" xinput enable "$id"
# $1 prop name # $1 prop name
@ -23,7 +22,3 @@ xinput set-prop "$id" "$prop" 1, 1, 1, 2, 1, 3
# Enable Horizontal and Vertical Two-Finger scrolling # Enable Horizontal and Vertical Two-Finger scrolling
prop="$(get_prop 'Synaptics Two-Finger Scrolling')" prop="$(get_prop 'Synaptics Two-Finger Scrolling')"
xinput set-prop "$id" "$prop" 1, 1 xinput set-prop "$id" "$prop" 1, 1
if [ "$1" = "--notify" ]; then
notify-send -u "low" --icon="input-touchpad" "Restarting touchpad"
fi

View File

@ -1,7 +0,0 @@
# screen-saver
## About
-- about section here --
## Requirements
-- any requirements --

View File

@ -1,4 +0,0 @@
#!/bin/sh
id="$(xprop | grep WM_CLIENT_LEADER | cut -d' ' -f5)"
xdg-screensaver suspend "$id"