mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 11:47:09 -04:00
25 lines
382 B
Plaintext
25 lines
382 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
die() {
|
||
|
printf '%s: %s\n' "${0##*/}" "$1" >&2
|
||
|
|
||
|
exit 1
|
||
|
}
|
||
|
|
||
|
if [ "$1" = "-" ]; then
|
||
|
while IFS= read -r line; do
|
||
|
input="$line"
|
||
|
done
|
||
|
else
|
||
|
input="$1"
|
||
|
fi
|
||
|
|
||
|
[ -f "$input" ] || die "$input: no such file"
|
||
|
case "$input" in
|
||
|
/*) ;;
|
||
|
*) die "$input: not an absolute path" ;;
|
||
|
esac
|
||
|
|
||
|
ln -sf "$input" "$XDG_DATA_HOME/screenlayout"
|
||
|
. "$XDG_DATA_HOME/screenlayout"
|