My Manjaro cheatsheet in a menu form

Since we advise beginner users to keep a list of commands on file, and it even has such article in the wiki i decided to share with you my list of frequently used command. However, i decided i want it a bit more fancy and interactive, so i made it in form of a dialog menu. Here it is, my menu.sh

ver. 12.02.2026
#!/bin/bash
# Creator: Todor Uzunov a.k.a. Teo
# License: GNU - free like free speech and free beer for everybody!
# https://forum.manjaro.org/t/my-manjaro-cheatsheet-in-a-menu-form/145943
# For the referenced external scripts check my other topics in the manjaro forum.
VERSION=10.02.2026
# Changelog from last version: restructuring the script to remove numeric tags; fixed cleaning of alpm download folders; rearranged the order of some commands; added theme variable

# Check if dependencies are present and ask for installation if not
if ! [[ "$(which dialog)" =~ (dialog) ]] &>/dev/null; then
	echo "dialog dependency is not found, please install: sudo pacman -S dialog"
	exit 1
fi

# Set custom theme if there is one
export DIALOGRC=/home/$USER/.dialogrctheme

OPTIONS=(
"pacman-mirrors" "Mirror Sync status and branch"
"sudo pacman-mirrors -f" "Refresh the mirror list" # sudo pacman-mirrors --country Germany --api --protocol https
"sudo pacman -Syu" "Update all without AUR"
"sudo pacman -Syuw" "Download all updates for offline install later"
"pamac update --aur --force-refresh" "Force refresh and fix AUR database in pamac"
"DIFFPROG=meld pacdiff -s" "Run pacdiff with Meld to compare changed configs" # pamac install meld
"pacman -Qm" "List foreign (AUR) packages"
"pacman -Qdt" "List orphaned packages"
"yay -Qua" "Check for updates of AUR with YAY, do not update" # pamac install yay
"yay -Sua" "Update only AUR packages with YAY" # pamac install yay
"pamac update --aur" "Pamac update AUR packages"
"sudo pacman -Rsu \$(pacman -Qtdq)" "Remove orphaned packages"
"yay -Scc" "Clean YAY, Pacman and Pamac cache" # pamac install yay
"sudo rm /var/cache/pacman/pkg/download*/*; sudo rmdir /var/cache/pacman/pkg/download*" "Remove the temporary download cache folders from ALPM" # if yay -Scc errors out on download folders
"flatpak update" "Check for flatpak updates and update"
"flatpak uninstall --unused" "Remove orphaned (unused) flatpak runtimes"
"rm -rfv /var/tmp/flatpak-cache-*" "Clean flatpak cache"
"journalctl -b -p3 --no-pager" "Show journal errors from current boot"
"journalctl -b -1 -p3 --no-pager" "Show journal errors from previous boot"
"journalctl -b -t systemd" "Show systemd bootlog only"
"journalctl -k" "Show kernel log"
"coredumpctl" "Check for coredumps"
"sudo rm -f /var/lib/systemd/coredump/*" "Clear coredumps on disk" #normally runs biweekly automatically
"sudo /root/verifier.sh -update" "Regenerate hashes for the boot files after update" # requires the extra script, see https://forum.manjaro.org/t/utility-script-my-take-on-a-verified-boot/164729
"sudo updatedb" "Update database for locate" #normally run weekly automatically
"sudo fstrim -v /" "Trim the root of the SSD" #normally run weekly automatically
"sudo smartctl --all /dev/nvme0" "S.M.A.R.T. status of the disk and write cycles" # smartctl --scan
"inxi -zv8" "Gather system info with inxi (filtered)"
"wavemon" "Run wavemonitor to check Wifi channel and strength" # pamac install wavemon
"nmcli dev wifi" "List wifi networks around with strength and channel"
"bash <(curl -s https://gitlab.com/cscs/mapare/-/raw/main/mapare) -IP" "Use MAPARE to check if missing default packages"
"sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' " "Check for missing files from packages"
"read fileowner; pacman -Qo \$fileowner" "Which package owns an existing file (paste filepath)"
"read whogotit; sudo pacman -Fyx \$whogotit" "Which (installed or not) package contains a file (paste filename, online check)"
"read whogotit; pacman -Qo \$whogotit" "Which (installed) package contains a file or directory (paste filename or path, offline check)"
"\$HOME/Applications/appimageupdater5.sh" "Check Appimage and Github Apps for updates" # requires the extra script, see https://forum.manjaro.org/t/automate-update-checks-for-externally-downloaded-software-in-tar-gz-or-appimage/161008
"rm -f ~/.bash_history-*.tmp" "Clean tmp bash history files"
"rm -f ~/.cache/totem/stream-buffer/*" "Clean Totem stream cache"
"du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*" "Show hidden spaceeaters above 100M in HOME"
"journalctl --disk-usage" "Show journal size"
"sudo journalctl --vacuum-time=2weeks" "Cut journal to 2 weeks" # that probably also sets it fixed on 2 weeks
"sudo nethogs" "Display the apps making most network traffic. Exit with q" # pamac install nethogs
"sudo netscanner" "Netscanner. Exit with q" # pamac install netscanner
"read nethog; ss -tuap | grep \$nethog" "Show all network connections of an app (paste name or pid)" 
"read ipaddress; whois \$ipaddress" "Whois (paste ip address)"
"sudo netstat -tulpn" "List all processes, listening on a network port"
"time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null" "A 10-20 sec. cpu benchmark using bc to calculate PI" # pamac install bc
"watch -e -n 1 sensors" "Read sensors every second, press CTRL-C to exit"
"stress -c 16" "Stress the CPU, useful for thermal or throttling tests, CTRL-C to exit"
"vnstat -d --style 0 --limit 5 | grep -v estimated && vnstat -m --style 0 --limit 3 | grep -v estimated" "Traffic statistic for the last days and current month (vnstat)" # install vnstat and start daemon
"sudo sysz" "Fuzzy search in systemd services. Exit with esc" # pamac build sysz
"systemctl start --user spotlight.service" "Spotlight background refresh" # requires the extra script, see https://forum.manjaro.org/t/spotlight-wallpaper-changer-for-xfce/181665
"xfce4-terminal --hold -e \"journalctl -t spotlight --no-pager\"" "Spotlight background info" # requires the extra script, see above or https://github.com/teou1/spotlight-xfce/
"sudo conservation_mode.sh 0" "Temporary disable Ideapad battery conservation mode" # pamac build conservation_mode
)

while true; do
CHOICE=$(dialog --clear \
		--no-shadow \
		--keep-tite \
		--scrollbar \
		--ok-label "Press Enter to run command" \
		--cancel-label "Press ESC to exit" \
		--cursor-off-label \
                --backtitle "" \
                --title "A Manjaro cheatsheet by Teo, version $VERSION" \
		--menu "Press Enter to run a command from the list; hit Esc or close the window to exit:" \
                79 185 0 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
[[ $CHOICE ]] || break
echo "$CHOICE"
echo ""
eval "$CHOICE"
echo ""
read -n 1 -s -r -p "Press any key to return to menu or q to exit." REPLY;
echo ""
echo ""
echo "================================================="
echo ""
if [[ $REPLY == "q" ]]; then break; fi
done


P.s. for the beginner users: save it as a file menu.sh in the ~/.local/bin hidden Folder (create if needed) then right click and in the permissions tab in properties select allow to execute as a program.
Then you can start in the terminal with menu.sh. You can even make a launcher on the panel, just don’t forget to set it to run in terminal and append -launcher at the end of the command. And if some subcommand does not work, check if you have the dependency in the comment on the corresponding line. Like this in a XFCE panel:

The most recent version you can find here or at github

If for some reason, the default colours are not to your liking, one can easily theme dialog. Here is an example black-red theme. Just put the file as .dialogrctheme in your home.

.dialogrctheme - red-black theme
#
# Run-time configuration file for dialog
#
# Automatically generated by "dialog --create-rc <file>"
#
#
# Types of values:
#
# Number     -  <number>
# String     -  "string"
# Boolean    -  <ON|OFF>
# Attribute  -  (foreground,background,highlight?,underline?,reverse?)

# Set aspect-ratio.
aspect = 0

# Set separator (for multiple widgets output).
separate_widget = ""

# Set tab-length (for textbox tab-conversion).
tab_len = 0

# Make tab-traversal for checklist, etc., include the list.
visit_items = OFF

# Show scrollbar in dialog boxes?
use_scrollbar = OFF

# Shadow dialog boxes? This also turns on color.
use_shadow = ON

# Turn color support ON or OFF
use_colors = ON

# Screen color
screen_color = (black,black,Off)

# Shadow color
shadow_color = (BLACK,BLACK,Off)

# Dialog box color
dialog_color = (white,black,off)

# Dialog box title color
title_color = (red,black,Off)

# Dialog box border color
border_color = (WHITE,black,Off)

# Active button color
button_active_color = (white,red,Off)

# Inactive button color
button_inactive_color = dialog_color

# Active button key color
button_key_active_color = button_active_color

# Inactive button key color
button_key_inactive_color = (RED,black,OFF)

# Active button label color
button_label_active_color = (white,red,Off)

# Inactive button label color
button_label_inactive_color = (BLACK,WHITE,ON)

# Input box color
inputbox_color = dialog_color

# Input box border color
inputbox_border_color = dialog_color

# Search box color
searchbox_color = dialog_color

# Search box title color
searchbox_title_color = title_color

# Search box border color
searchbox_border_color = border_color

# File position indicator color
position_indicator_color = title_color

# Menu box color
menubox_color = dialog_color

# Menu box border color
menubox_border_color = border_color

# Item color
item_color = dialog_color

# Selected item color
item_selected_color = button_active_color

# Tag color
tag_color = title_color

# Selected tag color
tag_selected_color = button_label_active_color

# Tag key color
tag_key_color = button_key_inactive_color

# Selected tag key color
tag_key_selected_color = (white,red,Off)

# Check box color
check_color = dialog_color

# Selected check box color
check_selected_color = button_active_color

# Up arrow color
uarrow_color = (white,WHITE,ON)

# Down arrow color
darrow_color = uarrow_color

# Item help-text color
itemhelp_color = (WHITE,BLACK,OFF)

# Active form text color
form_active_text_color = button_active_color

# Form text color
form_text_color = (WHITE,black,ON)

# Readonly form item color
form_item_readonly_color = (CYAN,black,ON)

# Dialog box gauge color
gauge_color = title_color

# Dialog box border2 color
border2_color = dialog_color

# Input box border2 color
inputbox_border2_color = dialog_color

# Search box border2 color
searchbox_border2_color = dialog_color

# Menu box border2 color
menubox_border2_color = dialog_color

By the way, if you use xfce, you can make your desktop shortcut on the panel a bit fancier, for example the terminal can be automatically maximized, etc.:

xfce4-terminal --maximize --title=Cheatsheet --hide-menubar --hide-toolbar -e "/home/teo/.local/bin/cheatsheet4.sh"

And another, more manjaro like theme:

.dialogrctheme-lightgreen
#
# Run-time configuration file for dialog
#
# Automatically generated by "dialog --create-rc <file>"
#
#
# Types of values:
#
# Number     -  <number>
# String     -  "string"
# Boolean    -  <ON|OFF>
# Attribute  -  (foreground,background,highlight?,underline?,reverse?)

# Set aspect-ratio.
aspect = 0

# Set separator (for multiple widgets output).
separate_widget = ""

# Set tab-length (for textbox tab-conversion).
tab_len = 0

# Make tab-traversal for checklist, etc., include the list.
visit_items = OFF

# Show scrollbar in dialog boxes?
use_scrollbar = OFF

# Shadow dialog boxes? This also turns on color.
use_shadow = ON

# Turn color support ON or OFF
use_colors = ON

# Screen color
screen_color = (black,black,Off)

# Shadow color
shadow_color = (BLACK,BLACK,Off)

# Dialog box color
dialog_color = (white,black,on)

# Dialog box title color
title_color = (green,black,On)

# Dialog box border color
border_color = (WHITE,black,On)

# Active button color
button_active_color = (white,green,On)

# Inactive button color
button_inactive_color = dialog_color

# Active button key color
button_key_active_color = button_active_color

# Inactive button key color
button_key_inactive_color = (green,black,On)

# Active button label color
button_label_active_color = (white,green,On)

# Inactive button label color
button_label_inactive_color = (BLACK,WHITE,ON)

# Input box color
inputbox_color = dialog_color

# Input box border color
inputbox_border_color = dialog_color

# Search box color
searchbox_color = dialog_color

# Search box title color
searchbox_title_color = title_color

# Search box border color
searchbox_border_color = border_color

# File position indicator color
position_indicator_color = title_color

# Menu box color
menubox_color = dialog_color

# Menu box border color
menubox_border_color = border_color

# Item color
item_color = dialog_color

# Selected item color
item_selected_color = button_active_color

# Tag color
tag_color = title_color

# Selected tag color
tag_selected_color = button_label_active_color

# Tag key color
tag_key_color = button_key_inactive_color

# Selected tag key color
tag_key_selected_color = (white,green,On)

# Check box color
check_color = dialog_color

# Selected check box color
check_selected_color = button_active_color

# Up arrow color
uarrow_color = (white,WHITE,ON)

# Down arrow color
darrow_color = uarrow_color

# Item help-text color
itemhelp_color = (WHITE,BLACK,On)

# Active form text color
form_active_text_color = button_active_color

# Form text color
form_text_color = (WHITE,black,ON)

# Readonly form item color
form_item_readonly_color = (CYAN,black,ON)

# Dialog box gauge color
gauge_color = title_color

# Dialog box border2 color
border2_color = dialog_color

# Input box border2 color
inputbox_border2_color = dialog_color

# Search box border2 color
searchbox_border2_color = dialog_color

# Menu box border2 color
menubox_border2_color = dialog_color

19 Likes

Very nice. the installacion of “/core/dialog” may be helpfull…
Remove orphaned packages tells “Argument missing”. (If none?)

Why not enable the fstrim.timer instead? See Solid state drive - ArchWiki

5 Likes

@GaVenga No idea. I have to test when i have some orphans. For now i just read the man page.
@Yochanan it is enabled, once a week by default. It is just in case i want to do it manually, for example after a massive timeshift clean of hundreds of GB or something like that.

1 Like

Reminds me of https://cheat.sh/ or on Github https://github.com/chubin/cheat.sh.

Fixed orphans. It wanted an argument indeed

sudo pacman -Rsu $(pacman -Qtdq)
1 Like

I was little irritated because dialog cannot scroll with the mouse, so here is a remake with Xdialog:

#!/bin/bash
# Creator: Todor Uzunov 
# License: GNU - free like free speech and free beer for everybody!
# Release: 17 Aug 2023

# check if dependency Xdialog and gtk-engine-murrine are present 
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	exit 1
fi
OPTIONS=(
	1 "Mirror Sync status and branch || pacman-mirrors"
	2 "Refresh the mirror list || sudo pacman-mirrors -f5" # sudo pacman-mirrors --country Germany --api --protocol https
	3 "Update all without AUR || sudo pacman -Syu"
	4 "Download all updates for offline install later || sudo pacman -Syuw"
	5 "Force refresh database and update || sudo pacman -Syyu"
	6 "Refresh files database || sudo pacman -Fy"
	7 "Run pacdiff with Meld to compare changed configs || DIFFPROG=meld pacdiff -s" # pamac install meld
	8 "List foreign (AUR) packages || pacman -Qm"
	9 "List orphaned packages || pacman -Qdt"
	10 "Check for updates of AUR with YAY, do not update || yay -Qua" # pamac install yay
	11 "Update only AUR packages with YAY || yay -Sua" # pamac install yay
	12 "Pamac update AUR packages || pamac update --aur"
	13 "Remove orphaned packages || sudo pacman -Rsu ..."
	14 "Clean Pacman cache || sudo pacman -Scc"
	15 "Trim the root of the SSD || sudo fstrim -v /"
	16 "S.M.A.R.T. status of the disk and write cycles || sudo smartctl --all /dev/nvme0" # smartctl --scan
	17 "Show journal errors from current boot || journalctl -b -p3 --no-pager"
	18 "Show journal errors from previous boot || journalctl -b -1 -p3 --no-pager"
	19 "Dmesg || sudo dmesg"
	20 "Check for coredumps || coredumpctl"
	21 "Run Wavemonitor to check Wifi channel and strength || wavemon" # pamac install wavemon
	22 "Read sensors || sensors"
	23 "Gather system info || inxi -v7azy"
	24 "Update database for locate || sudo updatedb"
	25 "Temporary disable Ideapad battery conservation mode || sudo conservation_mode.sh 0" # pamac build conservation_mode
	26 "Show hidden spaceeaters above 100M in HOME || du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	27 "Show journal size || journalctl --disk-usage"
	28 "Cut journal to one week || sudo journalctl --vacuum-time=1week"
	29 "List coredumps on disk and used space || du -sh /var/lib/systemd/coredump/"
	30 "Clear coredumps on disk || sudo rm -f /var/lib/systemd/coredump/*"
)
CHOICE=$(Xdialog --clear \
		--no-shadow \
		--scrollbar \
		--column-separator "||" \
		--separator "||" \
		--separate-output \
                --backtitle "I love Manjaro" \
                --title "A Manjaro cheatsheet by Teo" \
                --menubox "Choose an option (to see the full commands maximize window ->> ):" \
                70 180 70 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
#clear
case $CHOICE in
	1) echo "pacman-mirrors"; pacman-mirrors ;;
	2) echo "sudo pacman-mirrors -f5"; sudo pacman-mirrors -f5 ;;
	3) echo "sudo pacman -Syu"; sudo pacman -Syu ;;
	4) echo "sudo pacman -Syuw"; sudo pacman -Syuw ;;
	5) echo "sudo pacman -Syyu"; sudo pacman -Syyu ;;
	6) echo "sudo pacman -Fy"; sudo pacman -Fy ;;
	7) echo "DIFFPROG=meld pacdiff -s"; DIFFPROG=meld pacdiff -s ;;
	8) echo "pacman -Qm"; pacman -Qm ;;
	9) echo "pacman -Qdt"; pacman -Qdt ;;
	10) echo "yay -Qua"; yay -Qua ;;
	11) echo "yay -Sua"; yay -Sua ;;
	12) echo "pamac update --aur"; pamac update --aur ;;
	13) echo "sudo pacman -Rsu $(pacman -Qtdq)"; sudo pacman -Rsu $(pacman -Qtdq) ;;
	14) echo "sudo pacman -Scc"; sudo pacman -Scc ;;
	15) echo "sudo fstrim -v /"; sudo fstrim -v / ;;
	16) echo "sudo smartctl --all /dev/nvme0"; sudo smartctl --all /dev/nvme0 ;;
	17) echo "journalctl -b -p3 --no-pager"; journalctl -b -p3 --no-pager ;;
	18) echo "journalctl -b -1 -p3 --no-pager"; journalctl -b -1 -p3 --no-pager ;;
	19) echo "sudo dmesg"; sudo dmesg ;;
	20) echo "coredumpctl"; coredumpctl ;;
	21) echo "wavemon"; wavemon ;;
	22) echo "sensors"; sensors ;;
	23) echo "inxi -v7azy"; inxi -v7azy ;;
	24) echo "sudo updatedb"; sudo updatedb ;;
	25) echo "sudo conservation_mode.sh 0"; sudo conservation_mode.sh 0 ;;
	26) echo "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"; du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/* ;;
	27) echo "journalctl --disk-usage"; journalctl --disk-usage ;;
	28) echo "sudo journalctl --vacuum-time=1week"; sudo journalctl --vacuum-time=1week ;;
	29) echo "du -sh /var/lib/systemd/coredump/"; du -sh /var/lib/systemd/coredump/ ;;
	30) echo "sudo rm -f /var/lib/systemd/coredump/*"; sudo rm -f /var/lib/systemd/coredump/* ;;
esac
# if we use a launcher shortcut with -launcher, pause before exit
if [ "$1" == "-launcher" ]; then
	read -n 1 -s -r -p "Press any key to close the window.";
fi

1 Like

@Teo

you named it Xdialog but the package is named xdialog (lower-case x). this might confuse noobs if they will search for it to install it.

Thanks i fixed it.

1 Like

The newest version with 5 more useful (for me :slight_smile: ) commands:

new version source
#!/bin/bash
# Creator: Todor Uzunov 
# License: GNU - free like free speech and free beer for everybody!
# Release: 29 Feb 2024

# check if dependency Xdialog and gtk-engine-murrine are present 
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	exit 1
fi
OPTIONS=(
	1 "Mirror Sync status and branch || pacman-mirrors"
	2 "Refresh the mirror list || sudo pacman-mirrors -f5" # sudo pacman-mirrors --country Germany --api --protocol https
	3 "Update all without AUR || sudo pacman -Syu"
	4 "Download all updates for offline install later || sudo pacman -Syuw"
	5 "Force refresh database and update || sudo pacman -Syyu"
	6 "Refresh files database || sudo pacman -Fy"
	7 "Run pacdiff with Meld to compare changed configs || DIFFPROG=meld pacdiff -s" # pamac install meld
	8 "List foreign (AUR) packages || pacman -Qm"
	9 "List orphaned packages || pacman -Qdt"
	10 "Check for updates of AUR with YAY, do not update || yay -Qua" # pamac install yay
	11 "Update only AUR packages with YAY || yay -Sua" # pamac install yay
	12 "Pamac update AUR packages || pamac update --aur"
	13 "Remove orphaned packages || sudo pacman -Rsu ..."
	14 "Clean Pacman cache || sudo pacman -Scc"
	15 "Trim the root of the SSD || sudo fstrim -v /"
	16 "S.M.A.R.T. status of the disk and write cycles || sudo smartctl --all /dev/nvme0" # smartctl --scan
	17 "Show journal errors from current boot || journalctl -b -p3 --no-pager"
	18 "Show journal errors from previous boot || journalctl -b -1 -p3 --no-pager"
	19 "Dmesg || sudo dmesg"
	20 "Check for coredumps || coredumpctl"
	21 "Run Wavemonitor to check Wifi channel and strength || wavemon" # pamac install wavemon
	22 "Read sensors || sensors"
	23 "Gather system info || inxi -v7azy"
	24 "Update database for locate || sudo updatedb"
	25 "Temporary disable Ideapad battery conservation mode || sudo conservation_mode.sh 0" # pamac build conservation_mode
	26 "Show hidden spaceeaters above 100M in HOME || du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	27 "Show journal size || journalctl --disk-usage"
	28 "Cut journal to one week || sudo journalctl --vacuum-time=1week"
	29 "List coredumps on disk and used space || du -sh /var/lib/systemd/coredump/"
	30 "Clear coredumps on disk || sudo rm -f /var/lib/systemd/coredump/*"
	31 "Show systemd bootlog only || journalctl -b -t systemd"
	32 "Check for missing files from packages  || sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "
	33 "Which package owns an existing file (paste filepath) || read fileowner; pacman -Qo \$fileowner"
	34 "Which (installed or not) package contains a file (paste filename) || read whogotit; sudo pacman -Fyx \$whogotit"
	35 "Check for flatpak updates and update || flatpak update"
	36 "Clean tmp bash history files || rm -f ~/.bash_history-*.tmp"
)
CHOICE=$(Xdialog --clear \
		--no-shadow \
		--scrollbar \
		--column-separator "||" \
		--separator "||" \
		--separate-output \
                --backtitle "I love Manjaro" \
                --title "A Manjaro cheatsheet by Teo" \
                --menubox "Choose an option (to see the full commands maximize window ->> ):" \
                77 185 77 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
#clear
case $CHOICE in
	1) echo "pacman-mirrors"; pacman-mirrors ;;
	2) echo "sudo pacman-mirrors -f5"; sudo pacman-mirrors -f5 ;;
	3) echo "sudo pacman -Syu"; sudo pacman -Syu ;;
	4) echo "sudo pacman -Syuw"; sudo pacman -Syuw ;;
	5) echo "sudo pacman -Syyu"; sudo pacman -Syyu ;;
	6) echo "sudo pacman -Fy"; sudo pacman -Fy ;;
	7) echo "DIFFPROG=meld pacdiff -s"; DIFFPROG=meld pacdiff -s ;;
	8) echo "pacman -Qm"; pacman -Qm ;;
	9) echo "pacman -Qdt"; pacman -Qdt ;;
	10) echo "yay -Qua"; yay -Qua ;;
	11) echo "yay -Sua"; yay -Sua ;;
	12) echo "pamac update --aur"; pamac update --aur ;;
	13) echo "sudo pacman -Rsu $(pacman -Qtdq)"; sudo pacman -Rsu $(pacman -Qtdq) ;;
	14) echo "sudo pacman -Scc"; sudo pacman -Scc ;;
	15) echo "sudo fstrim -v /"; sudo fstrim -v / ;;
	16) echo "sudo smartctl --all /dev/nvme0"; sudo smartctl --all /dev/nvme0 ;;
	17) echo "journalctl -b -p3 --no-pager"; journalctl -b -p3 --no-pager ;;
	18) echo "journalctl -b -1 -p3 --no-pager"; journalctl -b -1 -p3 --no-pager ;;
	19) echo "sudo dmesg"; sudo dmesg ;;
	20) echo "coredumpctl"; coredumpctl ;;
	21) echo "wavemon"; wavemon ;;
	22) echo "sensors"; sensors ;;
	23) echo "inxi -v7azy"; inxi -v7azy ;;
	24) echo "sudo updatedb"; sudo updatedb ;;
	25) echo "sudo conservation_mode.sh 0"; sudo conservation_mode.sh 0 ;;
	26) echo "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"; du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/* ;;
	27) echo "journalctl --disk-usage"; journalctl --disk-usage ;;
	28) echo "sudo journalctl --vacuum-time=1week"; sudo journalctl --vacuum-time=1week ;;
	29) echo "du -sh /var/lib/systemd/coredump/"; du -sh /var/lib/systemd/coredump/ ;;
	30) echo "sudo rm -f /var/lib/systemd/coredump/*"; sudo rm -f /var/lib/systemd/coredump/* ;;
	31) echo "journalctl -b -t systemd"; journalctl -b -t systemd ;;
	32) echo "sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "; sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' ;;
	33) echo "read fileowner; pacman -Qo \$fileowner"; read fileowner; pacman -Qo $fileowner ;;
	34) echo "read whogotit; sudo pacman -Fyx \$whogotit"; read whogotit; sudo pacman -Fyx $whogotit ;;
	35) echo "flatpak update"; flatpak update ;;
	36) echo "rm -f ~/.bash_history-*.tmp"; rm -f ~/.bash_history-*.tmp ;;
esac
# if we use a launcher shortcut with -launcher, pause before exit
if [ "$1" == "-launcher" ]; then
	read -n 1 -s -r -p "Press any key to close the window.";
fi


3 Likes

Given you are already targeting orphans and using the -s flag … the -u here is likely redundant.
But you may wish to include -n to remove ‘savefiles’ as well.
(I usually remove packages this way … omitting it means .pacsave files may be retained)
ex: sudo pacman -Rns $(pacman -Qdtq)
Though it may be arguably more safe to use without n. Dealers choice I suppose.

And an even newer version, with some flatpak commands.

new version
#!/bin/bash
# Creator: Todor Uzunov 
# License: GNU - free like free speech and free beer for everybody!
# Version: 18 Mar 2024

# check if dependency Xdialog and gtk-engine-murrine are present 
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	exit 1
fi
OPTIONS=(
	1 "Mirror Sync status and branch || pacman-mirrors"
	2 "Refresh the mirror list || sudo pacman-mirrors -f5" # sudo pacman-mirrors --country Germany --api --protocol https
	3 "Update all without AUR || sudo pacman -Syu"
	4 "Download all updates for offline install later || sudo pacman -Syuw"
	5 "Force refresh database and update || sudo pacman -Syyu"
	6 "Refresh files database || sudo pacman -Fy"
	7 "Run pacdiff with Meld to compare changed configs || DIFFPROG=meld pacdiff -s" # pamac install meld
	8 "List foreign (AUR) packages || pacman -Qm"
	9 "List orphaned packages || pacman -Qdt"
	10 "Check for updates of AUR with YAY, do not update || yay -Qua" # pamac install yay
	11 "Update only AUR packages with YAY || yay -Sua" # pamac install yay
	12 "Pamac update AUR packages || pamac update --aur"
	13 "Remove orphaned packages || sudo pacman -Rsu ..."
	14 "Clean Pacman cache || sudo pacman -Scc"
	15 "Trim the root of the SSD || sudo fstrim -v /"
	16 "S.M.A.R.T. status of the disk and write cycles || sudo smartctl --all /dev/nvme0" # smartctl --scan
	17 "Show journal errors from current boot || journalctl -b -p3 --no-pager"
	18 "Show journal errors from previous boot || journalctl -b -1 -p3 --no-pager"
	19 "Dmesg || sudo dmesg"
	20 "Check for coredumps || coredumpctl"
	21 "Run Wavemonitor to check Wifi channel and strength with wavemon || wavemon" # pamac install wavemon
	22 "Read sensors || sensors"
	23 "Gather system info || inxi -v7azy"
	24 "Update database for locate || sudo updatedb"
	25 "Temporary disable Ideapad battery conservation mode || sudo conservation_mode.sh 0" # pamac build conservation_mode
	26 "Show hidden spaceeaters above 100M in HOME || du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	27 "Show journal size || journalctl --disk-usage"
	28 "Cut journal to one week || sudo journalctl --vacuum-time=1week"
	29 "List coredumps on disk and used space || du -sh /var/lib/systemd/coredump/"
	30 "Clear coredumps on disk || sudo rm -f /var/lib/systemd/coredump/*"
	31 "Show systemd bootlog only || journalctl -b -t systemd"
	32 "Check for missing files from packages  || sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "
	33 "Which package owns an existing file (paste filepath) || read fileowner; pacman -Qo \$fileowner"
	34 "Which (installed or not) package contains a file (paste filename) || read whogotit; sudo pacman -Fyx \$whogotit"
	35 "Check for flatpak updates and update || flatpak update"
	36 "Remove orphaned (unused) flatpak runtimes || flatpak uninstall --unused"
	37 "Clean flatpak cache || sudo rm -rfv /var/tmp/flatpak-cache-*"
	38 "Clean tmp bash history files || rm -f ~/.bash_history-*.tmp"
	39 "A 10-20 sec. cpu benchmark using bc to calculate PI || time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null" # pamac install bc
)
CHOICE=$(Xdialog --clear \
		--no-shadow \
		--scrollbar \
		--column-separator "||" \
		--separator "||" \
		--separate-output \
                --title "A Manjaro cheatsheet by Teo" \
		--menubox "" \
                79 185 79 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
#clear
case $CHOICE in
	1) echo "pacman-mirrors"; pacman-mirrors ;;
	2) echo "sudo pacman-mirrors -f5"; sudo pacman-mirrors -f5 ;;
	3) echo "sudo pacman -Syu"; sudo pacman -Syu ;;
	4) echo "sudo pacman -Syuw"; sudo pacman -Syuw ;;
	5) echo "sudo pacman -Syyu"; sudo pacman -Syyu ;;
	6) echo "sudo pacman -Fy"; sudo pacman -Fy ;;
	7) echo "DIFFPROG=meld pacdiff -s"; DIFFPROG=meld pacdiff -s ;;
	8) echo "pacman -Qm"; pacman -Qm ;;
	9) echo "pacman -Qdt"; pacman -Qdt ;;
	10) echo "yay -Qua"; yay -Qua ;;
	11) echo "yay -Sua"; yay -Sua ;;
	12) echo "pamac update --aur"; pamac update --aur ;;
	13) echo "sudo pacman -Rsu $(pacman -Qtdq)"; sudo pacman -Rsu $(pacman -Qtdq) ;;
	14) echo "sudo pacman -Scc"; sudo pacman -Scc ;;
	15) echo "sudo fstrim -v /"; sudo fstrim -v / ;;
	16) echo "sudo smartctl --all /dev/nvme0"; sudo smartctl --all /dev/nvme0 ;;
	17) echo "journalctl -b -p3 --no-pager"; journalctl -b -p3 --no-pager ;;
	18) echo "journalctl -b -1 -p3 --no-pager"; journalctl -b -1 -p3 --no-pager ;;
	19) echo "sudo dmesg"; sudo dmesg ;;
	20) echo "coredumpctl"; coredumpctl ;;
	21) echo "wavemon"; wavemon ;;
	22) echo "sensors"; sensors ;;
	23) echo "inxi -v7azy"; inxi -v7azy ;;
	24) echo "sudo updatedb"; sudo updatedb ;;
	25) echo "sudo conservation_mode.sh 0"; sudo conservation_mode.sh 0 ;;
	26) echo "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"; du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/* ;;
	27) echo "journalctl --disk-usage"; journalctl --disk-usage ;;
	28) echo "sudo journalctl --vacuum-time=1week"; sudo journalctl --vacuum-time=1week ;;
	29) echo "du -sh /var/lib/systemd/coredump/"; du -sh /var/lib/systemd/coredump/ ;;
	30) echo "sudo rm -f /var/lib/systemd/coredump/*"; sudo rm -f /var/lib/systemd/coredump/* ;;
	31) echo "journalctl -b -t systemd"; journalctl -b -t systemd ;;
	32) echo "sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "; sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' ;;
	33) echo "read fileowner; pacman -Qo \$fileowner"; read fileowner; pacman -Qo $fileowner ;;
	34) echo "read whogotit; sudo pacman -Fyx \$whogotit"; read whogotit; sudo pacman -Fyx $whogotit ;;
	35) echo "flatpak update"; flatpak update ;;
	36) echo "flatpak uninstall --unused"; flatpak uninstall --unused ;;
	37) echo "sudo rm -rfv /var/tmp/flatpak-cache-*"; sudo rm -rfv /var/tmp/flatpak-cache-* ;;
	38) echo "rm -f ~/.bash_history-*.tmp"; rm -f ~/.bash_history-*.tmp ;;
	39) echo "time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null"; time echo "scale=5000; 4*a(1)" | bc -l > /dev/null ;;
esac
# if we use a launcher shortcut with -launcher, pause before exit
if [ "$1" == "-launcher" ]; then
	read -n 1 -s -r -p "Press any key to close the window.";
fi


1 Like

Is a simple .pdf file now considered too oldschool? :man_shrugging:

Teo, Since you posted this real helpfull cheatsheet, I’ve been coming over once and a while, hoping there would be updates.
Now that PLASMA6 is rolled out and kernel 6.8 is fresh to use, I thought I’d come and ask if you would be so kindly as to post you lastest cheatsheet for the lazy ones amongst us :pleading_face:

The latest is above from yesterday when i added a simple single core benchmark to compare the performance after, for example, switching kernels.
I do not have anything plasma specific because i am using xfce.

Another small update - check which dependencies of a wanted package are already installed.
The initial idea was to check sizes too (how much more disk space would i need), that came to be unexpectedly hard to calculate - firstly because the dependencies have dependencies too, so it will be loops in the tree to problematic for a oneliner, and secondly it turns out every time a package “provides” something with a different name, the new name comes in the loop and the size of smth nonexisting errors out (like noto-fonts provides ttf-fonts and the script tries to check the size of ttf-fonts). So i left that idea for a while.

new version 11.04.24

#!/bin/bash
# Creator: Todor Uzunov 
# License: GNU - free like free speech and free beer for everybody!
# Version: 11.04.2024
# Added check which dependencies are installed; removed now useless -Fy; added Totem clean

# check if dependency Xdialog and gtk-engine-murrine are present 
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	exit 1
fi
OPTIONS=(
	1 "Mirror Sync status and branch || pacman-mirrors"
	2 "Refresh the mirror list || sudo pacman-mirrors -f5" # sudo pacman-mirrors --country Germany --api --protocol https
	3 "Update all without AUR || sudo pacman -Syu"
	4 "Download all updates for offline install later || sudo pacman -Syuw"
	5 "Force refresh database and update || sudo pacman -Syyu"
	6 "Check which dependencies are already installed (paste packagename) || for i in \$(expac -S '%D' \$pkg); do pacman -Q \$i"
	7 "Run pacdiff with Meld to compare changed configs || DIFFPROG=meld pacdiff -s" # pamac install meld
	8 "List foreign (AUR) packages || pacman -Qm"
	9 "List orphaned packages || pacman -Qdt"
	10 "Check for updates of AUR with YAY, do not update || yay -Qua" # pamac install yay
	11 "Update only AUR packages with YAY || yay -Sua" # pamac install yay
	12 "Pamac update AUR packages || pamac update --aur"
	13 "Remove orphaned packages || sudo pacman -Rsu ..."
	14 "Clean Pacman cache || sudo pacman -Scc"
	15 "Trim the root of the SSD || sudo fstrim -v /"
	16 "S.M.A.R.T. status of the disk and write cycles || sudo smartctl --all /dev/nvme0" # smartctl --scan
	17 "Show journal errors from current boot || journalctl -b -p3 --no-pager"
	18 "Show journal errors from previous boot || journalctl -b -1 -p3 --no-pager"
	19 "Dmesg || sudo dmesg"
	20 "Check for coredumps || coredumpctl"
	21 "Run Wavemonitor to check Wifi channel and strength with wavemon || wavemon" # pamac install wavemon
	22 "Read sensors || sensors"
	23 "Gather system info || inxi -zv8"
	24 "Update database for locate || sudo updatedb"
	25 "Temporary disable Ideapad battery conservation mode || sudo conservation_mode.sh 0" # pamac build conservation_mode
	26 "Show hidden spaceeaters above 100M in HOME || du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	27 "Show journal size || journalctl --disk-usage"
	28 "Cut journal to 2 weeks || sudo journalctl --vacuum-time=2weeks"
	29 "List coredumps on disk and used space || du -sh /var/lib/systemd/coredump/"
	30 "Clear coredumps on disk || sudo rm -f /var/lib/systemd/coredump/*"
	31 "Show systemd bootlog only || journalctl -b -t systemd"
	32 "Check for missing files from packages  || sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "
	33 "Which package owns an existing file (paste filepath) || read fileowner; pacman -Qo \$fileowner"
	34 "Which (installed or not) package contains a file (paste filename) || read whogotit; sudo pacman -Fyx \$whogotit"
	35 "Check for flatpak updates and update || flatpak update"
	36 "Remove orphaned (unused) flatpak runtimes || flatpak uninstall --unused"
	37 "Clean flatpak cache || sudo rm -rfv /var/tmp/flatpak-cache-*"
	38 "Clean tmp bash history files and Totem stream cache || rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"
	39 "A 10-20 sec. cpu benchmark using bc to calculate PI || time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null" # pamac install bc
)
CHOICE=$(Xdialog --clear \
		--no-shadow \
		--scrollbar \
		--column-separator "||" \
		--separator "||" \
		--separate-output \
                --title "A Manjaro cheatsheet by Teo" \
		--menubox "" \
                79 185 79 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
#clear
case $CHOICE in
	1) echo "pacman-mirrors"; pacman-mirrors ;;
	2) echo "sudo pacman-mirrors -f5"; sudo pacman-mirrors -f5 ;;
	3) echo "sudo pacman -Syu"; sudo pacman -Syu ;;
	4) echo "sudo pacman -Syuw"; sudo pacman -Syuw ;;
	5) echo "sudo pacman -Syyu"; sudo pacman -Syyu ;;
	6) echo "read wantedpackage; for i in \$(expac -S '%D' \$wantedpackage); do pacman -Q \$i;  done"; read wantedpackage; for i in $(expac -S '%D' $wantedpackage); do pacman -Q $i;  done ;;
	7) echo "DIFFPROG=meld pacdiff -s"; DIFFPROG=meld pacdiff -s ;;
	8) echo "pacman -Qm"; pacman -Qm ;;
	9) echo "pacman -Qdt"; pacman -Qdt ;;
	10) echo "yay -Qua"; yay -Qua ;;
	11) echo "yay -Sua"; yay -Sua ;;
	12) echo "pamac update --aur"; pamac update --aur ;;
	13) echo "sudo pacman -Rsu $(pacman -Qtdq)"; sudo pacman -Rsu $(pacman -Qtdq) ;;
	14) echo "sudo pacman -Scc"; sudo pacman -Scc ;;
	15) echo "sudo fstrim -v /"; sudo fstrim -v / ;;
	16) echo "sudo smartctl --all /dev/nvme0"; sudo smartctl --all /dev/nvme0 ;;
	17) echo "journalctl -b -p3 --no-pager"; journalctl -b -p3 --no-pager ;;
	18) echo "journalctl -b -1 -p3 --no-pager"; journalctl -b -1 -p3 --no-pager ;;
	19) echo "sudo dmesg"; sudo dmesg ;;
	20) echo "coredumpctl"; coredumpctl ;;
	21) echo "wavemon"; wavemon ;;
	22) echo "sensors"; sensors ;;
	23) echo "inxi -zv8"; inxi -zv8 ;;
	24) echo "sudo updatedb"; sudo updatedb ;;
	25) echo "sudo conservation_mode.sh 0"; sudo conservation_mode.sh 0 ;;
	26) echo "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"; du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/* ;;
	27) echo "journalctl --disk-usage"; journalctl --disk-usage ;;
	28) echo "sudo journalctl --vacuum-time=2weeks"; sudo journalctl --vacuum-time=2weeks ;;
	29) echo "du -sh /var/lib/systemd/coredump/"; du -sh /var/lib/systemd/coredump/ ;;
	30) echo "sudo rm -f /var/lib/systemd/coredump/*"; sudo rm -f /var/lib/systemd/coredump/* ;;
	31) echo "journalctl -b -t systemd"; journalctl -b -t systemd ;;
	32) echo "sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "; sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' ;;
	33) echo "read fileowner; pacman -Qo \$fileowner"; read fileowner; pacman -Qo $fileowner ;;
	34) echo "read whogotit; sudo pacman -Fyx \$whogotit"; read whogotit; sudo pacman -Fyx $whogotit ;;
	35) echo "flatpak update"; flatpak update ;;
	36) echo "flatpak uninstall --unused"; flatpak uninstall --unused ;;
	37) echo "sudo rm -rfv /var/tmp/flatpak-cache-*"; sudo rm -rfv /var/tmp/flatpak-cache-* ;;
	38) echo "rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"; rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/* ;;
	39) echo "time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null"; time echo "scale=5000; 4*a(1)" | bc -l > /dev/null ;;
esac
# if we use a launcher shortcut with -launcher, pause before exit
if [ "$1" == "-launcher" ]; then
	read -n 1 -s -r -p "Press any key to close the window.";
fi


I must be missing something.
Ever since the Xdialog version came out none of the entries are working.
It just returns me to the command line not running the command.

Well, the dependencies for the menu are only xdialog, gtk2 and gtk-engine-murrine. And i have worked with bash for the commands, so there might be some difference if using zsh for example, i do not know.
edit: no, it is not zsh, i just tried 1-2 commands in it.

not using zsh.
Reinstalled the dependencies. Same result.
I am on unstable if that makes a difference.

New version:Attempt to fix some compatibility problems in the gui version. Try as is and report, if you replace Xdialog with dialog in line 58 it should also work in tui mode if you have dialog installed

fix
#!/bin/bash
# Creator: Todor Uzunov 
# License: GNU - free like free speech and free beer for everybody!
# Version: 11.04.2024
# Added check which dependencies are installed; removed now useless -Fy; added Totem clean; compatibility fixes

# check if dependency Xdialog and gtk-engine-murrine are present 
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	exit 1
fi
OPTIONS=(
	1 "Mirror Sync status and branch || pacman-mirrors"
	2 "Refresh the mirror list || sudo pacman-mirrors -f5" # sudo pacman-mirrors --country Germany --api --protocol https
	3 "Update all without AUR || sudo pacman -Syu"
	4 "Download all updates for offline install later || sudo pacman -Syuw"
	5 "Force refresh database and update || sudo pacman -Syyu"
	6 "Check which dependencies are already installed (paste packagename) || for i in \$(expac -S '%D' \$pkg); do pacman -Q \$i"
	7 "Run pacdiff with Meld to compare changed configs || DIFFPROG=meld pacdiff -s" # pamac install meld
	8 "List foreign (AUR) packages || pacman -Qm"
	9 "List orphaned packages || pacman -Qdt"
	10 "Check for updates of AUR with YAY, do not update || yay -Qua" # pamac install yay
	11 "Update only AUR packages with YAY || yay -Sua" # pamac install yay
	12 "Pamac update AUR packages || pamac update --aur"
	13 "Remove orphaned packages || sudo pacman -Rsu ..."
	14 "Clean Pacman cache || sudo pacman -Scc"
	15 "Trim the root of the SSD || sudo fstrim -v /"
	16 "S.M.A.R.T. status of the disk and write cycles || sudo smartctl --all /dev/nvme0" # smartctl --scan
	17 "Show journal errors from current boot || journalctl -b -p3 --no-pager"
	18 "Show journal errors from previous boot || journalctl -b -1 -p3 --no-pager"
	19 "Dmesg || sudo dmesg"
	20 "Check for coredumps || coredumpctl"
	21 "Run Wavemonitor to check Wifi channel and strength with wavemon || wavemon" # pamac install wavemon
	22 "Read sensors || sensors"
	23 "Gather system info || inxi -zv8"
	24 "Update database for locate || sudo updatedb"
	25 "Temporary disable Ideapad battery conservation mode || sudo conservation_mode.sh 0" # pamac build conservation_mode
	26 "Show hidden spaceeaters above 100M in HOME || du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	27 "Show journal size || journalctl --disk-usage"
	28 "Cut journal to 2 weeks || sudo journalctl --vacuum-time=2weeks"
	29 "List coredumps on disk and used space || du -sh /var/lib/systemd/coredump/"
	30 "Clear coredumps on disk || sudo rm -f /var/lib/systemd/coredump/*"
	31 "Show systemd bootlog only || journalctl -b -t systemd"
	32 "Check for missing files from packages  || sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "
	33 "Which package owns an existing file (paste filepath) || read fileowner; pacman -Qo \$fileowner"
	34 "Which (installed or not) package contains a file (paste filename) || read whogotit; sudo pacman -Fyx \$whogotit"
	35 "Check for flatpak updates and update || flatpak update"
	36 "Remove orphaned (unused) flatpak runtimes || flatpak uninstall --unused"
	37 "Clean flatpak cache || sudo rm -rfv /var/tmp/flatpak-cache-*"
	38 "Clean tmp bash history files and Totem stream cache || rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"
	39 "A 10-20 sec. cpu benchmark using bc to calculate PI || time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null" # pamac install bc
)
#if you prefer TUI or have compatibility issues just replace Xdialog with dialog in the line below
CHOICE=$(Xdialog --clear \
		--no-shadow \
		--scrollbar \
		--column-separator "||" \
		--separator "||" \
                --backtitle "" \
                --title "A Manjaro cheatsheet by Teo" \
		--menu "" \
                79 185 79 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
#clear
case $CHOICE in
	1) echo "pacman-mirrors"; pacman-mirrors ;;
	2) echo "sudo pacman-mirrors -f5"; sudo pacman-mirrors -f5 ;;
	3) echo "sudo pacman -Syu"; sudo pacman -Syu ;;
	4) echo "sudo pacman -Syuw"; sudo pacman -Syuw ;;
	5) echo "sudo pacman -Syyu"; sudo pacman -Syyu ;;
	6) echo "read wantedpackage; for i in \$(expac -S '%D' \$wantedpackage); do pacman -Q \$i;  done"; read wantedpackage; for i in $(expac -S '%D' $wantedpackage); do pacman -Q $i;  done ;;
	7) echo "DIFFPROG=meld pacdiff -s"; DIFFPROG=meld pacdiff -s ;;
	8) echo "pacman -Qm"; pacman -Qm ;;
	9) echo "pacman -Qdt"; pacman -Qdt ;;
	10) echo "yay -Qua"; yay -Qua ;;
	11) echo "yay -Sua"; yay -Sua ;;
	12) echo "pamac update --aur"; pamac update --aur ;;
	13) echo "sudo pacman -Rsu $(pacman -Qtdq)"; sudo pacman -Rsu $(pacman -Qtdq) ;;
	14) echo "sudo pacman -Scc"; sudo pacman -Scc ;;
	15) echo "sudo fstrim -v /"; sudo fstrim -v / ;;
	16) echo "sudo smartctl --all /dev/nvme0"; sudo smartctl --all /dev/nvme0 ;;
	17) echo "journalctl -b -p3 --no-pager"; journalctl -b -p3 --no-pager ;;
	18) echo "journalctl -b -1 -p3 --no-pager"; journalctl -b -1 -p3 --no-pager ;;
	19) echo "sudo dmesg"; sudo dmesg ;;
	20) echo "coredumpctl"; coredumpctl ;;
	21) echo "wavemon"; wavemon ;;
	22) echo "sensors"; sensors ;;
	23) echo "inxi -zv8"; inxi -zv8 ;;
	24) echo "sudo updatedb"; sudo updatedb ;;
	25) echo "sudo conservation_mode.sh 0"; sudo conservation_mode.sh 0 ;;
	26) echo "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"; du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/* ;;
	27) echo "journalctl --disk-usage"; journalctl --disk-usage ;;
	28) echo "sudo journalctl --vacuum-time=2weeks"; sudo journalctl --vacuum-time=2weeks ;;
	29) echo "du -sh /var/lib/systemd/coredump/"; du -sh /var/lib/systemd/coredump/ ;;
	30) echo "sudo rm -f /var/lib/systemd/coredump/*"; sudo rm -f /var/lib/systemd/coredump/* ;;
	31) echo "journalctl -b -t systemd"; journalctl -b -t systemd ;;
	32) echo "sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "; sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' ;;
	33) echo "read fileowner; pacman -Qo \$fileowner"; read fileowner; pacman -Qo $fileowner ;;
	34) echo "read whogotit; sudo pacman -Fyx \$whogotit"; read whogotit; sudo pacman -Fyx $whogotit ;;
	35) echo "flatpak update"; flatpak update ;;
	36) echo "flatpak uninstall --unused"; flatpak uninstall --unused ;;
	37) echo "sudo rm -rfv /var/tmp/flatpak-cache-*"; sudo rm -rfv /var/tmp/flatpak-cache-* ;;
	38) echo "rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"; rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/* ;;
	39) echo "time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null"; time echo "scale=5000; 4*a(1)" | bc -l > /dev/null ;;
esac
# if we use a launcher shortcut with -launcher, pause before exit
if [ "$1" == "-launcher" ]; then
	read -n 1 -s -r -p "Press any key to close the window.";
fi


p.s. and another iteration, checking for dependencies and falling back to dialog automatically (will not help Maybl8 because there is something strange/wrong with his Xdialog, but for everybody else in the future. Maybl8 can just replace the 2 instances of “which Xdialog” with “which XXXXX” for example)

new iteration

#!/bin/bash
# Creator: Todor Uzunov 
# License: GNU - free like free speech and free beer for everybody!
# Version: 11.04.2024-2
# Changelog: try to find dependencies and compatibility mode

MODE=Xdialog
# check if dependencies are present and fall back to dialog
if ! [[ "$(which dialog)" =~ (dialog) ]] &>/dev/null; then
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]] &>/dev/null; then
	echo "Xdialog dependency is not found, please install with: sudo pacman -S xdialog"
	echo "Alternatively for TUI version install dialog: sudo pacman -S xdialog"
	exit 1
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]] &>/dev/null; then
	echo "Libmurrine dependency is not found, please install with: sudo pacman -S gtk-engine-murrine"
	echo "Alternatively for TUI version install dialog: sudo pacman -S xdialog"
	exit 1
fi
else
if ! [[ "$(which Xdialog)" =~ (Xdialog) ]]; then
	MODE=dialog
	if [[ "$(which notify-send)" =~ (notify-send) ]]; then notify-send "Xdialog dependency is not found, please install with"  "sudo pacman -S xdialog"; fi
fi
if ! [[ "$(which /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so)" =~ (/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so) ]]; then
	MODE=dialog
	if [[ "$(which notify-send)" =~ (notify-send) ]]; then notify-send "libmurrine dependency is not found, please install with"  "sudo pacman -S gtk-engine-murrine"; fi
fi
fi
OPTIONS=(
	1 "Mirror Sync status and branch || pacman-mirrors"
	2 "Refresh the mirror list || sudo pacman-mirrors -f5" # sudo pacman-mirrors --country Germany --api --protocol https
	3 "Update all without AUR || sudo pacman -Syu"
	4 "Download all updates for offline install later || sudo pacman -Syuw"
	5 "Force refresh database and update || sudo pacman -Syyu"
	6 "Check which dependencies are already installed (paste packagename) || for i in \$(expac -S '%D' \$pkg); do pacman -Q \$i"
	7 "Run pacdiff with Meld to compare changed configs || DIFFPROG=meld pacdiff -s" # pamac install meld
	8 "List foreign (AUR) packages || pacman -Qm"
	9 "List orphaned packages || pacman -Qdt"
	10 "Check for updates of AUR with YAY, do not update || yay -Qua" # pamac install yay
	11 "Update only AUR packages with YAY || yay -Sua" # pamac install yay
	12 "Pamac update AUR packages || pamac update --aur"
	13 "Remove orphaned packages || sudo pacman -Rsu ..."
	14 "Clean Pacman cache || sudo pacman -Scc"
	15 "Trim the root of the SSD || sudo fstrim -v /"
	16 "S.M.A.R.T. status of the disk and write cycles || sudo smartctl --all /dev/nvme0" # smartctl --scan
	17 "Show journal errors from current boot || journalctl -b -p3 --no-pager"
	18 "Show journal errors from previous boot || journalctl -b -1 -p3 --no-pager"
	19 "Dmesg || sudo dmesg"
	20 "Check for coredumps || coredumpctl"
	21 "Run Wavemonitor to check Wifi channel and strength with wavemon || wavemon" # pamac install wavemon
	22 "Read sensors || sensors"
	23 "Gather system info || inxi -zv8"
	24 "Update database for locate || sudo updatedb"
	25 "Temporary disable Ideapad battery conservation mode || sudo conservation_mode.sh 0" # pamac build conservation_mode
	26 "Show hidden spaceeaters above 100M in HOME || du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"
	27 "Show journal size || journalctl --disk-usage"
	28 "Cut journal to 2 weeks || sudo journalctl --vacuum-time=2weeks"
	29 "List coredumps on disk and used space || du -sh /var/lib/systemd/coredump/"
	30 "Clear coredumps on disk || sudo rm -f /var/lib/systemd/coredump/*"
	31 "Show systemd bootlog only || journalctl -b -t systemd"
	32 "Check for missing files from packages  || sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "
	33 "Which package owns an existing file (paste filepath) || read fileowner; pacman -Qo \$fileowner"
	34 "Which (installed or not) package contains a file (paste filename) || read whogotit; sudo pacman -Fyx \$whogotit"
	35 "Check for flatpak updates and update || flatpak update"
	36 "Remove orphaned (unused) flatpak runtimes || flatpak uninstall --unused"
	37 "Clean flatpak cache || sudo rm -rfv /var/tmp/flatpak-cache-*"
	38 "Clean tmp bash history files and Totem stream cache || rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"
	39 "A 10-20 sec. cpu benchmark using bc to calculate PI || time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null" # pamac install bc
)
#if you prefer TUI or have compatibility issues just replace Xdialog with dialog in the line below
CHOICE=$($MODE --clear \
		--no-shadow \
		--scrollbar \
		--column-separator "||" \
		--separator "||" \
                --backtitle "" \
                --title "A Manjaro cheatsheet by Teo" \
		--menu "" \
                79 185 79 \
                "${OPTIONS[@]}" \
                2>&1 >/dev/tty)
#clear
case $CHOICE in
	1) echo "pacman-mirrors"; pacman-mirrors ;;
	2) echo "sudo pacman-mirrors -f5"; sudo pacman-mirrors -f5 ;;
	3) echo "sudo pacman -Syu"; sudo pacman -Syu ;;
	4) echo "sudo pacman -Syuw"; sudo pacman -Syuw ;;
	5) echo "sudo pacman -Syyu"; sudo pacman -Syyu ;;
	6) echo "read wantedpackage; for i in \$(expac -S '%D' \$wantedpackage); do pacman -Q \$i;  done"; read wantedpackage; for i in $(expac -S '%D' $wantedpackage); do pacman -Q $i;  done ;;
	7) echo "DIFFPROG=meld pacdiff -s"; DIFFPROG=meld pacdiff -s ;;
	8) echo "pacman -Qm"; pacman -Qm ;;
	9) echo "pacman -Qdt"; pacman -Qdt ;;
	10) echo "yay -Qua"; yay -Qua ;;
	11) echo "yay -Sua"; yay -Sua ;;
	12) echo "pamac update --aur"; pamac update --aur ;;
	13) echo "sudo pacman -Rsu $(pacman -Qtdq)"; sudo pacman -Rsu $(pacman -Qtdq) ;;
	14) echo "sudo pacman -Scc"; sudo pacman -Scc ;;
	15) echo "sudo fstrim -v /"; sudo fstrim -v / ;;
	16) echo "sudo smartctl --all /dev/nvme0"; sudo smartctl --all /dev/nvme0 ;;
	17) echo "journalctl -b -p3 --no-pager"; journalctl -b -p3 --no-pager ;;
	18) echo "journalctl -b -1 -p3 --no-pager"; journalctl -b -1 -p3 --no-pager ;;
	19) echo "sudo dmesg"; sudo dmesg ;;
	20) echo "coredumpctl"; coredumpctl ;;
	21) echo "wavemon"; wavemon ;;
	22) echo "sensors"; sensors ;;
	23) echo "inxi -zv8"; inxi -zv8 ;;
	24) echo "sudo updatedb"; sudo updatedb ;;
	25) echo "sudo conservation_mode.sh 0"; sudo conservation_mode.sh 0 ;;
	26) echo "du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/*"; du -sh -t +100M ~/.cache/* ~/.config/* ~/.local/share/* ;;
	27) echo "journalctl --disk-usage"; journalctl --disk-usage ;;
	28) echo "sudo journalctl --vacuum-time=2weeks"; sudo journalctl --vacuum-time=2weeks ;;
	29) echo "du -sh /var/lib/systemd/coredump/"; du -sh /var/lib/systemd/coredump/ ;;
	30) echo "sudo rm -f /var/lib/systemd/coredump/*"; sudo rm -f /var/lib/systemd/coredump/* ;;
	31) echo "journalctl -b -t systemd"; journalctl -b -t systemd ;;
	32) echo "sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' "; sudo pacman -Qk 2>/dev/null | grep -v ' 0 missing files' ;;
	33) echo "read fileowner; pacman -Qo \$fileowner"; read fileowner; pacman -Qo $fileowner ;;
	34) echo "read whogotit; sudo pacman -Fyx \$whogotit"; read whogotit; sudo pacman -Fyx $whogotit ;;
	35) echo "flatpak update"; flatpak update ;;
	36) echo "flatpak uninstall --unused"; flatpak uninstall --unused ;;
	37) echo "sudo rm -rfv /var/tmp/flatpak-cache-*"; sudo rm -rfv /var/tmp/flatpak-cache-* ;;
	38) echo "rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/*"; rm -f ~/.bash_history-*.tmp && rm -f ~/.cache/totem/stream-buffer/* ;;
	39) echo "time echo \"scale=5000; 4*a(1)\" | bc -l > /dev/null"; time echo "scale=5000; 4*a(1)" | bc -l > /dev/null ;;
esac
# if we use a launcher shortcut with -launcher, pause before exit
if [ "$1" == "-launcher" ]; then
	read -n 1 -s -r -p "Press any key to close the window.";
fi


2 Likes