Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Vitals with TopHat #245

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Replace Vitals with TopHat #245

merged 1 commit into from
Aug 22, 2024

Conversation

Kasui92
Copy link
Contributor

@Kasui92 Kasui92 commented Aug 8, 2024

Since Vitals installation has been disabled for Intel processors, I think TopHat can be a great replacement as a monitoring extension.

I searched for TopHat issues to see if anyone reported any malfunctions with Intel processors, similar to the one highlighted, but found nothing.

I made TopHat as similar as possible to the default Vitals configuration.

@dhh
Copy link
Member

dhh commented Aug 12, 2024

I like that idea. Can you post a screenshot of what it looks like when it's just showing the default download speed?

@Kasui92
Copy link
Contributor Author

Kasui92 commented Aug 13, 2024

I like that idea. Can you post a screenshot of what it looks like when it's just showing the default download speed?

@dhh
Sure!

This is the freshly installed default version of the extension.
immagine

This is the version with only the network monitor, without icons and other resources monitor. Unfortunately it is not possible to show ONLY the download speed.
immagine
immagine

@Kasui92
Copy link
Contributor Author

Kasui92 commented Aug 13, 2024

now uses bits as a unit of measurement to improve readability

immagine

@italopenaforte
Copy link

I have installed using the script in my old laptop and is working flawless.

@LorenzoMugnai
Copy link

Hi, I love this idea to use TopHat.

In my own setup, I’ve already implemented something similar where the TopHat metrics colour adjusts dynamically based on the active Gnome theme.

Here’s how I’ve integrated it in theomakub/themes/set-gnome-theme.sh :

# Set TopHat color based on the current theme
color="#1dacd6" 
case $$OMAKUB_THEME_COLOR in
    "'purple'")
        color="#924d8b"
        ;;
    "'red'")
        color="#e92020"
        ;;
    "'blue'")
        color="#208fe9"
        ;;
    "'sage'"|"'bark'")
        color="#78ab50"
        ;;
    "'magenta'")
        color="#e920a3"
        ;;
    *)
        ;;
esac
gsettings set org.gnome.shell.extensions.tophat meter-fg-color "$color"

This is how it now looks like

Screenshot from 2024-08-14 14-30-45

@dhh
Copy link
Member

dhh commented Aug 14, 2024

Can you add a migration script so folks will get this installed and vitals removed on the next upgrade?

@italopenaforte
Copy link

Nice touch @LorenzoMugnai, was not aware that can be done.

@LorenzoMugnai
Copy link

Nice touch @LorenzoMugnai, was not aware that can be done.

Thank you! I'm glad you found it helpful. This project has been a great learning experience for me as well.

For my setup, I primarily use numeric mode, so I've disabled the charts using the following commands:

gsettings set org.gnome.shell.extensions.tophat cpu-display numeric
gsettings set org.gnome.shell.extensions.tophat mem-display numeric

However, it's good to know that if I decide to enable the charts, they integrate nicely with the system. Additionally, I've disabled the animations with:

gsettings set org.gnome.shell.extensions.tophat show-animations false

Now you have all my settings in case you'd like to integrate them into your setup.

I hope it helps!

@Kasui92
Copy link
Contributor Author

Kasui92 commented Aug 15, 2024

@LorenzoMugnai
Yours is a very interesting addition, especially to maintain coherence with the chosen theme.

I took this opportunity to also add extensions theming to Omakub, maybe in the future it will be useful to have it ready, and then I added TopHat metrics color management to this system.

Anyway, by default metrics are disabled.

@dhh
Obviously with your approval!

@Kasui92
Copy link
Contributor Author

Kasui92 commented Aug 16, 2024

@dhh

Can you add a migration script so folks will get this installed and vitals removed on the next upgrade?

Here it is!

# Uninstall Vitals
if [ -n "$(gnome-extensions list | grep [email protected])" ]; then
    gnome-extensions uninstall [email protected]
fi

# Install TopHat
gext install [email protected]

sudo cp ~/.local/share/gnome-shell/extensions/[email protected]/schemas/org.gnome.shell.extensions.tophat.gschema.xml /usr/share/glib-2.0/schemas/
sudo glib-compile-schemas /usr/share/glib-2.0/schemas/

# Configure TopHat
gsettings set org.gnome.shell.extensions.tophat show-icons false
gsettings set org.gnome.shell.extensions.tophat show-cpu false
gsettings set org.gnome.shell.extensions.tophat show-disk false
gsettings set org.gnome.shell.extensions.tophat show-mem false
gsettings set org.gnome.shell.extensions.tophat network-usage-unit bits

# Set TopHat metrics color to match the theme
THEME_NAMES=("Tokyo Night" "Catppuccin" "Nord" "Everforest" "Gruvbox" "Kanagawa" "Rose Pine")
THEME=$(gum choose "${THEME_NAMES[@]}" "Default" --header "Choose your theme" --height 10 | tr '[:upper:]' '[:lower:]' | sed 's/ /-/g')

if [ -n "$THEME" ] && [ "$THEME" != "default" ]; then
  source $OMAKUB_PATH/themes/$THEME/extensions.sh
fi

@gregmolnar
Copy link
Contributor

@Kasui92 Can you save that snippet into the migrations folder like the existing ones?

@Kasui92 Kasui92 force-pushed the tophat branch 3 times, most recently from ccc6bc2 to 0581eba Compare August 22, 2024 09:10
@Kasui92
Copy link
Contributor Author

Kasui92 commented Aug 22, 2024

@gregmolnar Done!

@dhh dhh merged commit eec9020 into basecamp:master Aug 22, 2024
@dhh
Copy link
Member

dhh commented Aug 22, 2024

We're missing a dependency. I just ran the migration and got this:

image

@Kasui92
Copy link
Contributor Author

Kasui92 commented Aug 22, 2024

@dhh
My bad!
I did not include these libraries installation in the migration file:

gir1.2-gtop-2.0 
gir1.2-clutter-1.0

I included them in the installation process, but I didn't pay attention to them during the migration.

This should be added before the TopHat installation process, in the file:

# Install Tophat libraries
sudo apt install -y gir1.2-gtop-2.0 gir1.2-clutter-1.0

I have the commit on this branch, but the PR is closed. Shall I open a new one?

@dhh
Copy link
Member

dhh commented Aug 22, 2024

Ah yes. Please do open another PR 👍

@dhh
Copy link
Member

dhh commented Aug 22, 2024

(Worked after installing the dependency 👍)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants