mirror of
https://gitea.blesmrt.net/mikaela/shell-things.git
synced 2024-11-10 02:29:22 +01:00
profile.d: add xdg screenshots dir setting
This commit is contained in:
parent
c4b20f481d
commit
81e8ef2754
26
etc/profile.d/50-xdg-screenshots.sh
Normal file
26
etc/profile.d/50-xdg-screenshots.sh
Normal file
@ -0,0 +1,26 @@
|
||||
# This script currently sets just the xdg screenshots directory, while I am
|
||||
# unsure of whether anything else than grimshot utilizes it.
|
||||
|
||||
# WARNING: my train of thought got disturbed writing this and I lost the red
|
||||
# thread of what the fluff was I doing again.
|
||||
|
||||
if [ $(hash xdg-user-dir 2> /dev/null) ] && [ $(hash xdg-user-dir-update 2> /dev/null) ]; then
|
||||
echo "50-xdg-screenshots.sh ok"
|
||||
fi
|
||||
|
||||
if [[ $(xdg-user-dir SCREENSHOTS) != $(xdg-user-dir) ]]; then
|
||||
echo "50-xdg-screenshots.sh ok"
|
||||
fi
|
||||
|
||||
# Check if the user has a locale preference
|
||||
XDGLOCALE="$(cat $(xdg-user-dir)/.config/user-dirs.locale)"
|
||||
|
||||
# If the user wants Finnish, then let's respect that...
|
||||
if [[ "$XDGLOCALE" == "fi" || "$XDGLOCALE" == "fi_FI" ]]; then
|
||||
xdg-user-dirs-update --set SCREENSHOTS $(xdg-user-dir PICTURES)/Kuvakaappaukset
|
||||
# ...otherwise English it is.
|
||||
else
|
||||
xdg-user-dirs-update --set SCREENSHOTS $(xdg-user-dir PICTURES)/Screenshots
|
||||
fi
|
||||
|
||||
mkdir -p "$(xdg-user-dir SCREENSHOTS)"
|
Loading…
Reference in New Issue
Block a user