File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -688,3 +688,26 @@ function create_launcher() {
688688 run_as_su chmod +x " ${FILE_PATH} "
689689 fi
690690}
691+
692+ function get_directory_icon() {
693+ local DIRECTORY_PATH=" ${1} "
694+
695+ ! does_directory_exist " ${DIRECTORY_PATH} " && return
696+
697+ gio info -a ' metadata::custom-icon-name' " ${DIRECTORY_PATH} " | awk -F' : ' ' /custom-icon-name/ {print $2}'
698+ }
699+
700+ function set_directory_icon() {
701+ local DIRECTORY_PATH=" ${1} "
702+ local ICON_NAME=" ${2} "
703+
704+ ! does_directory_exist " ${DIRECTORY_PATH} " && return
705+
706+ local CURRENT_ICON
707+ CURRENT_ICON=" $( get_directory_icon " ${DIRECTORY_PATH} " ) "
708+
709+ if [[ " ${CURRENT_ICON} " != " ${ICON_NAME} " ]]; then
710+ echo -e " Setting the icon of \e[0;33m${DIRECTORY_PATH} \e[0m to \e[0;33m${ICON_NAME} \e[0m..."
711+ gio set " ${PATH_NAME} " metadata::custom-icon-name " ${ICON_NAME} "
712+ fi
713+ }
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ if ${HAS_GUI} && [ "${OS}" = 'Linux' ]; then
3939 XDG_TEMPLATES_DIR " \" ${XDG_TEMPLATES_DIR} \" " \
4040 XDG_VIDEOS_DIR " \" ${XDG_VIDEOS_DIR} \" "
4141
42+ set_directory_icon " ${XDG_PROJECTS_DIR} " ' folder-projects'
4243
4344 if does_bin_exist ' org.prismlauncher.PrismLauncher' ' prismlauncher' ; then
4445 MINECRAFT_SCREENSHOTS_DIR=" ${XDG_PICTURES_DIR} /Screenshots/Minecraft"
You can’t perform that action at this time.
0 commit comments