This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
forked from blue-build/legacy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from C0dePlayer/dev
✨ feat(*): introduce new `image-cleaner` module and improve scripts
- Loading branch information
Showing
13 changed files
with
73 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type: image-cleaner | ||
entries: | ||
- nvtop | ||
- htop | ||
repos: | ||
- _copr:copr.fedorainfracloud.org:phracek:PyCharm | ||
- google-chrome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ remove: | |
- gnome-tour | ||
- gnome-terminal | ||
- gnome-terminal-nautilus | ||
- gnome-classic-session |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
type: script | ||
scripts: | ||
- cleanup.sh | ||
- signing.sh |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -oue pipefail | ||
FILES_ROOT="/tmp/config/files" | ||
|
||
wget -O $FILES_ROOT/99-razer.rules 'https://raw.githubusercontent.com/ublue-os/openrazer/master/install_files/udev/99-razer.rules' | ||
wget -O $FILES_ROOT/razer_mount 'https://raw.githubusercontent.com/ublue-os/openrazer/master/install_files/udev/razer_mount' | ||
|
||
install -m 0644 "$FILES_ROOT/99-razer.rules" "/usr/lib/udev/rules.d/99-razer.rules" | ||
install -m 0755 "$FILES_ROOT/razer_mount" "/usr/lib/udev/razer_mount" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# `image-cleaner` Module for Startingpoint | ||
|
||
The `image-cleaner` module is a tool designed to enhance your desktop experience by efficiently managing and decluttering unnecessary shortcuts or repositories that may accumulate during image building. | ||
|
||
To make the most of the `image-cleaner` module, you can easily specify the desktop entries you want to remove in your configuration file using the `entries:` section. If you need to remove repositories, you can do so by utilizing the `repos:` section. | ||
|
||
## Example configuration | ||
```yaml | ||
type: desktop-cleaner | ||
entries: | ||
- nvtop | ||
- htop | ||
repos: | ||
- _copr:copr.fedorainfracloud.org:phracek:PyCharm.repo | ||
- google-chrome.repo | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
set -oue pipefail | ||
|
||
get_yaml_array ENTRIES '.entries[]' "$1" | ||
|
||
if [[ ${#ENTRIES[@]} -gt 0 ]]; then | ||
echo "Removing desktop entries..." | ||
for entry in "${ENTRIES[@]}"; do | ||
entry="$(echo "$entry" | tr -d '\n')" | ||
desktop_file="/usr/share/applications/${entry}.desktop" | ||
|
||
if [[ -f "$desktop_file" ]]; then | ||
rm -f "$desktop_file" | ||
echo "Removed: $entry" | ||
else | ||
echo "Not found: $entry" | ||
fi | ||
done | ||
fi | ||
|
||
get_yaml_array REPOS '.repos[]' "$1" | ||
|
||
if [[ ${#REPOS[@]} -gt 0 ]]; then | ||
echo "Removing repositories..." | ||
for repo in "${REPOS[@]}"; do | ||
repo="$(echo "$repo" | tr -d '\n')" | ||
repo_file="/etc/yum.repos.d/${repo}.repo" | ||
|
||
if [[ -f "$repo_file" ]]; then | ||
rm -f "$repo_file" | ||
echo "Removed: $repo_file" | ||
else | ||
echo "Not found: $repo_file" | ||
fi | ||
done | ||
fi |