diff --git a/src/cursorList b/src/cursorList new file mode 100644 index 00000000..3f688f84 --- /dev/null +++ b/src/cursorList @@ -0,0 +1,96 @@ +00000000000000020006000e7e9ffc3f progress +00008160000006810000408080010102 size_ver +03b6e0fcb3499374a867c041f52298f0 circle +08e8e1c95fe2fc01f976f1e063a24ccd progress +3ecb610c1bf2410f44200f48c40d3599 progress +5c6cd98b3f3ebcb1f9c7f1c204630408 help +9d800788f1b08800ae810202380a0822 pointer +640fb0e74195791501fd1ed57b41487f alias +1081e37283d90000800003c07f3ef6bf copy +3085a0e285430894940527032f8b26df alias +4498f0e0c1937ffe01fd06f973665830 dnd-move +6407b0e94181790501fd1e167b474872 copy +9081237383d90e509aa00f00170e968f dnd-move +a2a266d0498c3104214a47bd64ab0fc8 alias +b66166c04f8c3109214a4fbd64a50fc8 copy +d9ce0ab605698f320427677b458ad60b help +e29285e634086352946a0e7090d73106 pointer +fcf21c00b30f7e3f83fe0dfd12e71cff dnd-move +alias copy +all-scroll fleur +bottom_left_corner size_bdiag +bottom_right_corner size_fdiag +cell crosshair +center_ptr default +circle not-allowed +closedhand dnd-move +col-resize size_hor +color-picker crosshair +context-menu default +copy dnd-move +cross crosshair +crossed_circle not-allowed +dnd-copy copy +dnd-none dnd-move +dnd-no-drop not-allowed +draft pencil +e-resize size_hor +forbidden no-drop +h_double_arrow size_hor +half-busy progress +hand1 pointer +hand2 pointer +help default +ibeam text +left_ptr default +left_ptr_help help +left_ptr_watch progress +left_side left-arrow +link alias +move dnd-move +n-resize size-ver +no-drop not-allowed +plus cell +pointing_hand pointer +question_arrow help +right_ptr default +right_side right-arrow +row-resize size_ver +s-resize size_ver +sb_h_double_arrow size_hor +sb_v_double_arrow size_ver +size_all fleur +split_h col-resize +split_v row-resize +top_left_corner size_fdiag +top_right_corner size_bdiag +top_side up-arrow +v_double_arrow size_ver +vertical-text text +w-resize size_hor +watch wait +whats_this help +xterm text +dnd-move default +down-arrow default +crosshair default +fleur default +left-arrow default +not-allowed default +openhand default +pencil default +pirate default +pointer default +progress default +right-arrow default +size-bdiag default +size-fdiag default +size-hor default +size-ver default +text default +up-arrow default +wait default +x-cursor default +wayland-cursor default +zoom-in default +zoom-out default diff --git a/src/in.inst b/src/in.inst new file mode 100644 index 00000000..5104584e --- /dev/null +++ b/src/in.inst @@ -0,0 +1,132 @@ +#! /bin/bash + +show_question() { + echo -e "\033[1;34m$@\033[0m" +} + +show_dir() { + echo -e "\033[1;32m$@\033[0m" +} + +show_error() { + echo -e "\033[1;31m$@\033[0m" +} + +end() { + echo -e "\nExiting...\n" + exit 0 +} + +continue() { + show_question "\nDo you want to continue? (Y)es, (N)o : \n" + read INPUT + case $INPUT in + [Yy]* ) ;; + [Nn]* ) end;; + * ) show_error "\nSorry, try again."; continue;; + esac +} + +replace() { + show_question "\nFound an existing installation. Replace it? (Y)es, (N)o :\n" + read INPUT + case $INPUT in + [Yy]* ) rm -rf "$@/Bibata" 2>/dev/null;; + [Nn]* ) ;; + * ) show_error "\tSorry, try again."; replace $@;; + esac +} + +install() { + + # PREVIEW + + # Show destination directory + echo -e "\nBibata Cursor Theme will be installed in:\n" + show_dir "\t$DEST_DIR" + if [ "$UID" -eq "$ROOT_UID" ]; then + echo -e "\nIt will be available to all users." + else + echo -e "\nTo make them available to all users, run this script as root." + fi + + continue + + # INSTALL + + # Check destination directory + if [ ! -d $DEST_DIR ]; then + mkdir -p $DEST_DIR + elif [[ -d $DEST_DIR/Bibata ]]; then + replace $DEST_DIR + fi + + echo -e "\nInstalling Bibata..." + + # Copying files + cp -rf Bibata $DEST_DIR + chmod -R 755 $DEST_DIR/Bibata + + echo "Installation complete!" + echo "Do not forget you have to set Bibata Cursor." +} + +remove() { + + # PREVIEW + + # Show installation directory + if [[ -d $DEST_DIR/Bibata ]]; then + echo -e "\nBibata Cursor Theme installed in:\n" + show_dir "\t$DEST_DIR" + if [ "$UID" -eq "$ROOT_UID" ]; then + echo -e "\nIt will remove for all users." + else + echo -e "\nIt will remove only for current user." + fi + + continue + + else + show_error "\nBibata Cursor is not installed in:\n" + show_dir "\t$DEST_DIR\n" + end + fi + + # REMOVE + + echo -e "\nRemoving Bibata..." + + # Removing files + rm -rf $DEST_DIR/Bibata + + echo "Removing complete!" + echo "I hope to see you soon." +} + +main() { + show_question "What you want to do: (I)nstall, (R)emove : \n" + read INPUT + case $INPUT in + [Ii]* ) install;; + [Rr]* ) remove;; + * ) show_error "\nSorry, try again."; main;; + esac +} + +ROOT_UID=0 +DEST_DIR= +cd "$( dirname "${BASH_SOURCE[0]}" )" || exit + +# Destination directory +if [ "$UID" -eq "$ROOT_UID" ]; then + DEST_DIR="/usr/share/icons" +else + DEST_DIR="$HOME/.local/share/icons" +fi + +echo -e "\e[1m\n+---------------------------------------------+" +echo -e "| Bibata Cursor Installer Script |" +echo -e "+---------------------------------------------+\n\e[0m" + +main \ No newline at end of file