Update archbox-desktop
This commit is contained in:
parent
ca6b078ee4
commit
0b29ff372d
@ -133,6 +133,8 @@ help_text(){
|
|||||||
USAGE: $0 <arguments>
|
USAGE: $0 <arguments>
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
<no option> Choice to install or uninstall desktop entries
|
<no option> Choice to install or uninstall desktop entries
|
||||||
|
-i, --install FILE Installs desktop entries in /usr/share/applications
|
||||||
|
-r, --remove FILE Removes desktop entries in ~/.local/share/applications/archbox
|
||||||
-l, --list List available desktop entries
|
-l, --list List available desktop entries
|
||||||
-s, --list-installed List installed desktop entries
|
-s, --list-installed List installed desktop entries
|
||||||
-h, --help Displays this help message
|
-h, --help Displays this help message
|
||||||
@ -146,6 +148,21 @@ list(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
case $1 in
|
case $1 in
|
||||||
|
-i|--install)
|
||||||
|
checkdep update-desktop-database
|
||||||
|
install_desktop ${@#$1}
|
||||||
|
update-desktop-database
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
|
-r|--remove)
|
||||||
|
checkdep update-desktop-database
|
||||||
|
selected_entry=${@#$1}
|
||||||
|
for i in $selected_entry; do
|
||||||
|
rm ~/.local/share/applications/archbox/$i
|
||||||
|
done
|
||||||
|
update-desktop-database
|
||||||
|
exit $?
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
help_text
|
help_text
|
||||||
exit 0
|
exit 0
|
||||||
@ -160,6 +177,7 @@ case $1 in
|
|||||||
*)
|
*)
|
||||||
checkdep sed
|
checkdep sed
|
||||||
checkdep tr
|
checkdep tr
|
||||||
|
checkdep update-desktop-databse
|
||||||
printf "What do you want to do?\nPress I to install desktop entries.\nPress R to remove desktop entries. (I/r)"
|
printf "What do you want to do?\nPress I to install desktop entries.\nPress R to remove desktop entries. (I/r)"
|
||||||
read -rn 1
|
read -rn 1
|
||||||
case $REPLY in
|
case $REPLY in
|
||||||
@ -173,6 +191,7 @@ case $1 in
|
|||||||
rm ${HOME}/.local/share/applications/archbox/"$(sed "$((i+1))q;d" /tmp/archboxlist | sed 's|.*/||')"
|
rm ${HOME}/.local/share/applications/archbox/"$(sed "$((i+1))q;d" /tmp/archboxlist | sed 's|.*/||')"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
update-desktop-database
|
||||||
rm /tmp/archboxlist
|
rm /tmp/archboxlist
|
||||||
exit $?
|
exit $?
|
||||||
;;
|
;;
|
||||||
@ -186,11 +205,11 @@ case $1 in
|
|||||||
install_desktop "$(sed "$((i+1))q;d" /tmp/archboxlist)"
|
install_desktop "$(sed "$((i+1))q;d" /tmp/archboxlist)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
update-desktop-database
|
||||||
rm /tmp/archboxlist
|
rm /tmp/archboxlist
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 1
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
Reference in New Issue
Block a user