2022-08-15 12:23:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
function mkuserdirs {
|
|
|
|
|
2022-09-10 13:26:51 +00:00
|
|
|
local PKG_DIR i IFS=$'\n'
|
|
|
|
for i in $( reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" \
|
|
|
|
| grep "^ [A-Za-z ]\+" \
|
|
|
|
| tr -d '\r' \
|
|
|
|
| sed -e "s/.\+REG_EXPAND_SZ[ ]\+//g"
|
|
|
|
); do
|
|
|
|
|
|
|
|
if [[ "$i" =~ .*"\\AppData\\".* ]]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$i" =~ "%USERPROFILE".* ]]; then
|
|
|
|
i=$USERPROFILE${i/\%USERPROFILE\%/}
|
|
|
|
fi
|
|
|
|
|
|
|
|
ln -vs "$( cygpath "$i" )" $HOME/
|
2022-08-15 12:23:00 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Package Directory
|
2022-09-10 13:26:51 +00:00
|
|
|
PKG_DIR=$( cygpath "$APPDATA/../Local/Packages" )
|
2022-08-15 12:23:00 +00:00
|
|
|
if [ -d "$PKG_DIR" ]; then
|
|
|
|
ln -vs "$PKG_DIR" $HOME/
|
|
|
|
fi
|
2022-09-10 13:26:51 +00:00
|
|
|
|
2022-08-15 12:23:00 +00:00
|
|
|
}
|