This is just a way to make a simple script that runs our update commands. It serves no purpose, other than to look cool. It is tied to an alias that you can put in ~/.bashrc or ~/.bash_alias. Konsole is themed with OMDark.
As you can see, I call the script with the alias dsync
This is what the script looks like in Kate. To make it all line up correctly, Kate needs to use the same monospace font that Konsole uses. This is our default Liberation Mono. Kate is themed with OMDark.
The script is only several lines long, but the rest of the script is there for documentation of how it is done and color reference codes. These use the block of 16 colors that you see in neofetch or fastfetch. Here is the script in text form and as an attachment.
#!/usr/bin/bash
# File location /home/username/.local/bin/update.sh
# and can be called from the ~/.bash_aliases or ~/.bashrc file with this alias command
# alias dsync="~/.local/bin/update.sh" # dnf updates for OpenMandriva with log file
#
echo # This just adds blank line to separate these headers.
echo -e "\033[0;31mββββββββββββββββββββββββββββββββββ\033[0m" # Red for root.
echo -e "\033[0;31mβ**Updating all System packages**β\033[0m" # Red for root.
echo -e "\033[0;31mββββββββββββββββββββββββββββββββββ\033[0m" # Red for root.
echo
sudo dnf clean all ; dnf clean all ; sudo dnf distro-sync --refresh --allowerasing 2>&1| tee dsync2-log.txt
echo
echo -e "\033[0;33mββββββββββββββββββββββββββββββββββββ\033[0m" # Yellow for user
echo -e "\033[0;33mβ**Updating Flatpaks from FlatHub**β\033[0m" # Yellow for user
echo -e "\033[0;33mββββββββββββββββββββββββββββββββββββ\033[0m" # Yellow for user
echo
flatpak update # Notice that the flatpaks are not installed as root.
echo
echo -e "\033[0;32mβββββββββββββββββββββββ\033[0m" # Green for complete
echo -e "\033[0;32mβ**Script Completed!**β\033[0m" # Green for complete
echo -e "\033[0;32mβββββββββββββββββββββββ\033[0m" # Green for complete
echo
# There are some special characters used to make the boxes.
# β β β β β β
#
# Color References placed here for your convenience
# Reset
# \e[0;0m | NoColor
#
# Regular Colors
# Value | Color
# -------- | ------
# \e[0;30m | Black
# \e[0;31m | Red
# \e[0;32m | Green
# \e[0;33m | Yellow
# \e[0;34m | Blue
# \e[0;35m | Purple
# \e[0;36m | Cyan
# \e[0;37m | White
#
# Bold Text Colors
# Value | Color
# -------- | ------
# \e[1;30m | Bright Black
# \e[1;31m | Bright Red
# \e[1;32m | Bright Green
# \e[1;33m | Bright Yellow
# \e[1;34m | Bright Blue
# \e[1;35m | Bright Purple
# \e[1;36m | Bright Cyan
# Tip: Make sure your editor is using the same font as your terminal and it should be monospaced
# \e[1;37m | Bright White
update.sh.txt (2.3 KB)
When you download it, place it in ~/.local/bin/
and remove the .txt from the name. Make sure the file is executable.
Now, place this alias into your ~/.bashrc
or your ~/.bash_alias
file.
alias dsync="~/.local/bin/update.sh" # dnf updates for OpenMandriva
Or, you could call it with update
by changing the alias to
alias update="~/.local/bin/update.sh" # dnf updates for OpenMandriva
Hint, before you ask how I get the little color squares to show up beside the colors in Kate, go to Settings > Configure Kate > Plugins > Color Picker. It will then show up at the bottom of that list and you can set the options for it.