Skip to content

Commit

Permalink
Reworking of installation method (#18)
Browse files Browse the repository at this point in the history
* add get.sh.

* move get.sh

reason for this is i don't want people to run this after cloning the repo

* verbose installation script

* Update README.md

* Update README.md

Changed the notice to a single quote instead of a list with one item,
Changed around the names of the installation methods,
Restructured the lists in the Manual installation method

* Update install.sh

Switched to Cases from If cases in shell

* improved spacing and readability

* merging get.sh and install.sh (untested)

* formatting update

* Update install.sh

* Update install.sh

* Added Abort Install function

* rewrote install.sh

* Redundant code reduced, maintainability improved

* Changed spacing for echo statements
Current spacing for echo statements caused issues with how the statements
were printed onto the command line, changed tabbing to fix that.

* some refactoring.

* color stuff :3

* Reduced redundancy in the the unrecognised install

* test

* removed test, added exit status

* Update release.yml

testing self running github workflows

* Update release.yml

fucked up, was meaning to test something on another branch

* Update README.md

* tarballs and versioning system.

* update release.yml

* Update install.sh

---------

Co-authored-by: Disaster2life <Yashraj.moghe@gmail.com>
  • Loading branch information
derspyy and Disaster2life authored Aug 3, 2023
1 parent 65ea773 commit 79dda12
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 67 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ jobs:
uses: actions/checkout@v3

- name: Archive files
run: zip -r delta-linux.zip install.sh Delta
run: tar czf delta-linux.tar.gz Delta

- name: Add short commit hash to env
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Add calver to env
run: echo "CALVER=`date "+%Y.%m.%d"`" >> $GITHUB_ENV

- name: Create a GitHub release
uses: softprops/action-gh-release@v0.1.15
with:
files: delta-linux.zip
name: v1.0.0
tag_name: v1.0.0
files: delta-linux.tar.gz
tag_name: ${{ env.CALVER }}+${{ env.SHORT_SHA }}
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@
<img src="https://raw.githubusercontent.com/Delta-Icons/Linux/master/delta-showcase.png" alt="">
</p>

## Notice
* It is recommended to use dark themes with this icon pack.
> Notice, It is recommended to use dark themes with this icon pack.
## Installation
* Clone this repository to somewhere on your machine:
- `git clone https://github.com/Delta-Icons/linux.git`
## Installation Methods

* **Easy way**:
- There is now a new install script you can try out! Download the Delta Folder, and the "install.sh" and run the script in the terminal!
* **Recommended way**:
- `curl -sSf https://raw.githubusercontent.com/Delta-Icons/linux/master/install.sh | sh`

* **Harder way**:
- Move the `Delta` folder to `/usr/share/icons` (All Users), `~/.local/share/icons` (KDE), or `~/.icons` (GTK).

* Set the icon theme in one of the following ways:
- Set the icon theme to `Delta` in the Settings menu for your distro (e.g. GNOME Tweak Tool).
- **GNOME**: Run `gsettings set org.gnome.desktop.interface icon-theme "Delta"`.
* **Manual method**:
1. Clone this repository to somewhere on your machine: `git clone https://github.com/Delta-Icons/linux.git`
2. Move the `Delta` folder to `/usr/share/icons` (All Users), `~/.local/share/icons` (KDE), or `~/.icons` (GTK).
3. Set the icon theme in one of the following ways:
- Set the icon theme to `Delta` in the Settings menu for your distro (e.g. KDE System Settings).
- **GNOME**: Run `gsettings set org.gnome.desktop.interface icon-theme "Delta"`.
- **XFCE**: Run `xfconf-query -c xsettings -p /Net/IconThemeName -s "Delta"`.

## Our Discord Server
If you need help contributing or just want to chat with other contributors feel free to join us here: https://discord.gg/F9RFqHN <br>
Expand Down
171 changes: 121 additions & 50 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,54 +1,125 @@
#!/bin/bash
GTK_Apply () {
rm -rf ~/.icons/Delta
mkdir -p Delta ~/.icons
cp -r Delta ~/.icons/

RESET="\x1b[0m"
CORAL_PINK="\x1b[38;2;255;131;125m"
FUZZY_WUZZY="\x1b[38;2;186;101;97m"
PALE_GOLD="\x1b[38;2;248;193;140m"
JASMINE="\x1b[38;2;249;222;129m"
GRANNY_S_A="\x1b[38;2;152;220;154m"
PALE_R_E_B="\x1b[38;2;150;223;211m"
BABY_BLUE_E="\x1b[38;2;154;190;255m"
DARK_PASTEL_BLUE="\x1b[38;2;114;141;190m"
UBE="\x1b[38;2;140;114;189m"

case $DESKTOP_SESSION in
gnome | xubuntu | budgie-desktop | pantheon | xfce)
Installation_Method=GTK
Installation_Path=~/.icons
;;
plasma | plasmawayland | cinnamon)
Installation_Method=QT
Installation_Path=~/.local/share/icons
;;
esac

function Delta_Apply () {
echo -e "\nRunning $DARK_PASTEL_BLUE$Installation_Method$RESET\n"
curl -L -O https://github.com/Delta-Icons/linux/releases/latest/download/delta-linux.tar.gz
case $Installation_Method in
Generic)
sudo rm -rf "$Installation_Path"/Delta
tar xf delta-linux.tar.gz --directory=delta-linux
sudo mv delta-linux/ "$Installation_Path"
;;
*)
rm -rf "$Installation_Path"/Delta
tar xf delta-linux.tar.gz --directory="$Installation_Path"
;;
esac
echo -en "\n${UBE}Finished!$RESET\n "
}
QT_Apply () {
rm -rf ~/.local/share/icons/Delta
mkdir -p Delta ~/.local/share/icons
cp -r Delta ~/.local/share/icons/
}
Common_Apply () {
rm -rf /usr/share/icons/Delta
sudo mkdir -p Delta /usr/share/icons
sudo cp -r Delta /usr/share/icons
}
if [ "$DESKTOP_SESSION" = "gnome" ] || [ "$DESKTOP_SESSION" = "xubuntu" ] || [ "$DESKTOP_SESSION" = "budgie-desktop" ] || [ "$DESKTOP_SESSION" = "pantheon" ] || [ "$DESKTOP_SESSION" = "xfce" ] ; then
GTK_Apply
gsettings set org.gnome.desktop.interface icon-theme "Delta"
echo "installed"
exit 0
elif [ "$DESKTOP_SESSION" = "plasma" ]; then
QT_Apply
x=$(locate plasma-changeicons)
$x Delta
echo "installed"
exit 0
elif [ "$DESKTOP_SESSION" = "cinnamon" ]; then
read -p "Your Desktop Environment doesn't support a completely automatic install, you will have to select and apply the icon pack in your settings yourself, Proceed? y/N " proceed
if [ "$proceed" = "y" ]; then
QT_Apply

echo -e "Welcome to the$CORAL_PINK Delta$RESET installation script!\n"
case $Installation_Method in
GTK)
case $Installation_Method in
GTK)
echo -e "The current desktop ($PALE_GOLD${DESKTOP_SESSION^}$RESET) supports automatic installation.\n"
;;
QT)

echo -e "The current desktop ($RESET$DESKTOP_SESSION$RESET) supports Manual installation.
You will have to manually select the pack from your settings panel.\n"
;;
esac
echo -e "Do you wish to continue?$PALE_R_E_B Y${RESET}/n"
read -r -p "-> " proceed
case $proceed in
[Yy]* | "")
case $Installation_Method in
GTK)
Delta_Apply
case $DESKTOP_SESSION in
xfce)
xfconf-query -c xsettings -p /Net/IconThemeName -s "Delta"
;;
*)
gsettings set org.gnome.desktop.interface icon-theme "Delta"
;;
esac
;;
QT)
Delta_Apply
echo "Delta has been moved, You can now apply Delta from your settings panel."
echo "Coming soon to your local customisation store!"

;;
esac
rm -rf delta-linux.tar.gz
rm -rf delta-linux
;;
n)
exit 0
elif [ "$proceed" = "n" ]; then
exit 1
fi
else
echo "Your Desktop Environment isn't recognised or isn't supported, We can try a few things, or you can look online for other resources,"
read -p "Abort(0), Place in GTK non-root space(1), Place in Qt non-root space(2), Place in common space (requires root)(3)" whatdo
if [ "$whatdo" = "0" ]; then
exit 1
elif [ "$whatdo" = "1" ]; then
GTK_Apply
echo "You should now try and apply the icon pack"
;;
*)
echo "invalid input"
;;
esac
;;
*)
echo -e "Your Desktop Environment ($PALE_GOLD${DESKTOP_SESSION^}$RESET) isn't recognised or isn't supported yet.
Please open an issue on the Linux branch, you can also try and install
by looking up how your Desktop Environment handles Icon Packs. \n"

echo -e "${JASMINE}0 -$RESET Abort
${GRANNY_S_A}1 -$RESET Place in the GTK path (~/.icons)
${PALE_R_E_B}2 -$RESET Place in the QT path (~/.local/share/icons)
${BABY_BLUE_E}3 -$RESET Place in the$FUZZY_WUZZY ROOT$RESET path (/usr/share/icons)"

read -rp "-> " whatdo
case $whatdo in
0)
exit 0
elif [ "$whatdo" = "2" ]; then
QT_Apply
echo "You should now try and apply the icon pack"
exit 0
elif [ "$whatdo" = "3" ]; then
Common_Apply
echo "You should now try and apply the icon pack"
exit 0
fi
fi
;;
1)
Installation_Method=GTK
Installation_Path=~/.icons
;;
2)
Installation_Method=QT
Installation_Path=~/.local/share/icons
;;
3)
Installation_Method=Generic
Installation_Path=/usr/share/icons
;;
*)
echo "Invalid Input"
exit 1
esac

Delta_Apply
echo "You should now try and apply the icon pack."
;;
esac
exit 0

0 comments on commit 79dda12

Please sign in to comment.