mirror of
https://codeberg.org/frosty/dotfiles.git
synced 2024-09-19 03:37:10 -04:00
25 lines
382 B
Bash
Executable file
25 lines
382 B
Bash
Executable file
#!/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"
|