feat: move to using /etc/issue

main
Echo 2022-10-13 16:51:29 +11:00
parent 6c7130e1c5
commit e196c53c2d
12 changed files with 166 additions and 119 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
dist

View File

@ -34,11 +34,13 @@
</details> </details>
## Usage ## Usage
### Read before installing
Installing multiple times will result in the first theme you installed overriding the others. To uninstall or install a new theme simply remove the first line of `/etc/issue`
1. Clone this repo. 1. Clone this repo.
2. Choose your flavour. 2. Run `./build.sh`
3. Source *flavour*.sh in your `.bashrc`, `.zshrc` or whatever file your shell uses. 3. Run `./install.sh <theme>` (eg `./install mocha`)
4. Log out and log back in. 4. Restart your computer!
## 💝 Thanks to ## 💝 Thanks to

11
build.sh Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
ScriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
mkdir "$ScriptDir/dist" &>/dev/null
rm -f "$ScriptDir/dist/*"
"$ScriptDir/src/frappe.sh" >> "$ScriptDir/dist/frappe"
"$ScriptDir/src/latte.sh" >> "$ScriptDir/dist/latte"
"$ScriptDir/src/macchiato.sh" >> "$ScriptDir/dist/macchiato"
"$ScriptDir/src/mocha.sh" >> "$ScriptDir/dist/mocha"

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
if [ "$TERM" = "linux" ]; then
printf %b '\e]P0303446' # set background color to "Base"
printf %b '\e]P8626880' # set bright black to "Surface2"
printf %b '\e]P7C6D0F5' # set text color to "Text"
printf %b '\e]PFA5ADCE' # set bright white to "Subtext0"
printf %b '\e]P1E78284' # set red to "Red"
printf %b '\e]P9E78284' # set bright red to "Red"
printf %b '\e]P2A6D189' # set green to "Green"
printf %b '\e]PAA6D189' # set bright green to "Green"
printf %b '\e]P3E5C890' # set yellow to "Yellow"
printf %b '\e]PBE5C890' # set bright yellow to "Yellow"
printf %b '\e]P48CAAEE' # set blue to "Blue"
printf %b '\e]PC8CAAEE' # set bright blue to "Blue"
printf %b '\e]P5F4B8E4' # set magenta to "Pink"
printf %b '\e]PDF4B8E4' # set bright magenta to "Pink"
printf %b '\e]P681C8BE' # set cyan to "Teal"
printf %b '\e]PE81C8BE' # set bright cyan to "Teal"
clear
fi

40
install.sh Executable file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env bash
ProgName="$(basename -- "$0")"
ScriptDir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
sub_help() {
echo "Usage: $ProgName <theme>"
}
sub_mocha() {
sudo sed -i "1s/^/$(cat "$ScriptDir/dist/mocha")\n/" /etc/issue
}
sub_macchiato() {
sudo sed -i "1s/^/$(cat "$ScriptDir/dist/macchiato")\n/" /etc/issue
}
sub_latte() {
sudo sed -i "1s/^/$(cat "$ScriptDir/dist/latte")\n/" /etc/issue
}
sub_frappe() {
sudo sed -i "1s/^/$(cat "$ScriptDir/dist/frappe")\n/" /etc/issue
}
subcommand=$1
case $subcommand in
"" | "-h" | "--help")
sub_help
;;
*)
shift
sub_"${subcommand}" "$@"
if [ $? = 127 ]; then
echo "Error: '$subcommand' is not a known subcommand." >&2
echo " Run '$ProgName --help' for a list of known subcommands." >&2
exit 1
fi
;;
esac

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
if [ "$TERM" = "linux" ]; then
printf %b '\e]P0EFF1F5' # set background color to "Base"
printf %b '\e]P86C6F85' # set bright black to "Subtext0"
printf %b '\e]P74C4F69' # set text color to "Text"
printf %b '\e]PFBCC0CC' # set bright white to "Surface1"
printf %b '\e]P1D20F39' # set red to "Red"
printf %b '\e]P9D20F39' # set bright red to "Red"
printf %b '\e]P240A02B' # set green to "Green"
printf %b '\e]PA40A02B' # set bright green to "Green"
printf %b '\e]P3DF8E1D' # set yellow to "Yellow"
printf %b '\e]PBDF8E1D' # set bright yellow to "Yellow"
printf %b '\e]P41E66F5' # set blue to "Blue"
printf %b '\e]PC1E66F5' # set bright blue to "Blue"
printf %b '\e]P5EA76CB' # set magenta to "Pink"
printf %b '\e]PDEA76CB' # set bright magenta to "Pink"
printf %b '\e]P6179299' # set cyan to "Teal"
printf %b '\e]PE179299' # set bright cyan to "Teal"
clear
fi

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
if [ "$TERM" = "linux" ]; then
printf %b '\e]P024273A' # set background color to "Base"
printf %b '\e]P85B6078' # set bright black to "Surface2"
printf %b '\e]P7CAD3F5' # set text color to "Text"
printf %b '\e]PFA5ADCB' # set bright white to "Subtext0"
printf %b '\e]P1ED8796' # set red to "Red"
printf %b '\e]P9ED8796' # set bright red to "Red"
printf %b '\e]P2A6DA95' # set green to "Green"
printf %b '\e]PAA6DA95' # set bright green to "Green"
printf %b '\e]P3EED49f' # set yellow to "Yellow"
printf %b '\e]PBEED49f' # set bright yellow to "Yellow"
printf %b '\e]P48AADF4' # set blue to "Blue"
printf %b '\e]PC8AADF4' # set bright blue to "Blue"
printf %b '\e]P5F5BDE6' # set magenta to "Pink"
printf %b '\e]PDF5BDE6' # set bright magenta to "Pink"
printf %b '\e]P68BD5CA' # set cyan to "Teal"
printf %b '\e]PE8BD5CA' # set bright cyan to "Teal"
clear
fi

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
if [ "$TERM" = "linux" ]; then
printf %b '\e]P01E1E2E' # set background color to "Base"
printf %b '\e]P8585B70' # set bright black to "Surface2"
printf %b '\e]P7BAC2DE' # set text color to "Text"
printf %b '\e]PFA6ADC8' # set bright white to "Subtext0"
printf %b '\e]P1F38BA8' # set red to "Red"
printf %b '\e]P9F38BA8' # set bright red to "Red"
printf %b '\e]P2A6E3A1' # set green to "Green"
printf %b '\e]PAA6E3A1' # set bright green to "Green"
printf %b '\e]P3F9E2AF' # set yellow to "Yellow"
printf %b '\e]PBF9E2AF' # set bright yellow to "Yellow"
printf %b '\e]P489B4FA' # set blue to "Blue"
printf %b '\e]PC89B4FA' # set bright blue to "Blue"
printf %b '\e]P5F5C2E7' # set magenta to "Pink"
printf %b '\e]PDF5C2E7' # set bright magenta to "Pink"
printf %b '\e]P694E2D5' # set cyan to "Teal"
printf %b '\e]PE94E2D5' # set bright cyan to "Teal"
clear
fi

28
src/frappe.sh Executable file
View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
printf %b '\e]P0303446' # set background color to "Base"
printf %b '\e]P8626880' # set bright black to "Surface2"
printf %b '\e]P7C6D0F5' # set text color to "Text"
printf %b '\e]PFA5ADCE' # set bright white to "Subtext0"
printf %b '\e]P1E78284' # set red to "Red"
printf %b '\e]P9E78284' # set bright red to "Red"
printf %b '\e]P2A6D189' # set green to "Green"
printf %b '\e]PAA6D189' # set bright green to "Green"
printf %b '\e]P3E5C890' # set yellow to "Yellow"
printf %b '\e]PBE5C890' # set bright yellow to "Yellow"
printf %b '\e]P48CAAEE' # set blue to "Blue"
printf %b '\e]PC8CAAEE' # set bright blue to "Blue"
printf %b '\e]P5F4B8E4' # set magenta to "Pink"
printf %b '\e]PDF4B8E4' # set bright magenta to "Pink"
printf %b '\e]P681C8BE' # set cyan to "Teal"
printf %b '\e]PE81C8BE' # set bright cyan to "Teal"
clear

27
src/latte.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
printf %b '\e]P0EFF1F5' # set background color to "Base"
printf %b '\e]P86C6F85' # set bright black to "Subtext0"
printf %b '\e]P74C4F69' # set text color to "Text"
printf %b '\e]PFBCC0CC' # set bright white to "Surface1"
printf %b '\e]P1D20F39' # set red to "Red"
printf %b '\e]P9D20F39' # set bright red to "Red"
printf %b '\e]P240A02B' # set green to "Green"
printf %b '\e]PA40A02B' # set bright green to "Green"
printf %b '\e]P3DF8E1D' # set yellow to "Yellow"
printf %b '\e]PBDF8E1D' # set bright yellow to "Yellow"
printf %b '\e]P41E66F5' # set blue to "Blue"
printf %b '\e]PC1E66F5' # set bright blue to "Blue"
printf %b '\e]P5EA76CB' # set magenta to "Pink"
printf %b '\e]PDEA76CB' # set bright magenta to "Pink"
printf %b '\e]P6179299' # set cyan to "Teal"
printf %b '\e]PE179299' # set bright cyan to "Teal"
clear

27
src/macchiato.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
printf %b '\e]P024273A' # set background color to "Base"
printf %b '\e]P85B6078' # set bright black to "Surface2"
printf %b '\e]P7CAD3F5' # set text color to "Text"
printf %b '\e]PFA5ADCB' # set bright white to "Subtext0"
printf %b '\e]P1ED8796' # set red to "Red"
printf %b '\e]P9ED8796' # set bright red to "Red"
printf %b '\e]P2A6DA95' # set green to "Green"
printf %b '\e]PAA6DA95' # set bright green to "Green"
printf %b '\e]P3EED49f' # set yellow to "Yellow"
printf %b '\e]PBEED49f' # set bright yellow to "Yellow"
printf %b '\e]P48AADF4' # set blue to "Blue"
printf %b '\e]PC8AADF4' # set bright blue to "Blue"
printf %b '\e]P5F5BDE6' # set magenta to "Pink"
printf %b '\e]PDF5BDE6' # set bright magenta to "Pink"
printf %b '\e]P68BD5CA' # set cyan to "Teal"
printf %b '\e]PE8BD5CA' # set bright cyan to "Teal"
clear

27
src/mocha.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
printf %b '\e]P01E1E2E' # set background color to "Base"
printf %b '\e]P8585B70' # set bright black to "Surface2"
printf %b '\e]P7BAC2DE' # set text color to "Text"
printf %b '\e]PFA6ADC8' # set bright white to "Subtext0"
printf %b '\e]P1F38BA8' # set red to "Red"
printf %b '\e]P9F38BA8' # set bright red to "Red"
printf %b '\e]P2A6E3A1' # set green to "Green"
printf %b '\e]PAA6E3A1' # set bright green to "Green"
printf %b '\e]P3F9E2AF' # set yellow to "Yellow"
printf %b '\e]PBF9E2AF' # set bright yellow to "Yellow"
printf %b '\e]P489B4FA' # set blue to "Blue"
printf %b '\e]PC89B4FA' # set bright blue to "Blue"
printf %b '\e]P5F5C2E7' # set magenta to "Pink"
printf %b '\e]PDF5C2E7' # set bright magenta to "Pink"
printf %b '\e]P694E2D5' # set cyan to "Teal"
printf %b '\e]PE94E2D5' # set bright cyan to "Teal"
clear