A GNOME Shell extension for monitoring and managing systemd services, cron jobs, docker and poman containers.
You can configure it to show only the information you are interested in (e.g. only systemd services and/or docker containers).
Published at: https://extensions.gnome.org/extension/1804/sermon/
The master
branch includes all stable features and currently supports GNOME Shell 3.34, 3.36, 3.38, 40, 41, 42 and 43.
Among others, these versions of GNOME Shell are used in the following Linux distributions:
- Debian 11 (Bullseye)
- Fedora 31, 32, 33, 34, 35, 36 and 37
- Mageia 8
- Manjaro 19.0, 20.0 to 20.2 and 21.0 to 21.3
- openSUSE Leap 15.2 and 15.4
- Red Hat Enterprise Linux 9 (Plow)
- SUSE Linux Enterprise Desktop 15 SP2 and SP3
- Ubuntu 19.10 (Eoan Ermine), 20.04 LTS (Focal Fossa), 20.10 (Groovy Gorilla), 21.04 (Hirsute Hippo), 21.10 (Impish Indri), 22.04 LTS (Jammy Jellyfish) and 22.10 (Kinetic Kudu)
The gnome-shell-3-32
branch is a discontinued backport to GNOME Shell 3.32.
Among others, this version of GNOME Shell is used in the following Linux distributions:
- Fedora 30
- Mageia 7 and 7.1
- Red Hat Enterprise Linux 8.1 to 8.6 (Ootpa)
- Ubuntu 19.04 (Disco Dingo)
The gnome-shell-3-28
branch is a discontinued backport to GNOME Shell 3.26, 3.28 and 3.30.
Among others, these versions of GNOME Shell are used in the following Linux distributions:
- Debian 10 (Buster)
- Fedora 27, 28 and 29
- openSUSE Leap 15.0 and 15.1
- Red Hat Enterprise Linux 7.5 to 7.9 (Maipo) and 8.0 (Ootpa)
- SUSE Linux Enterprise Desktop 15 and 15 SP1
- Ubuntu 18.04 LTS (Bionic Beaver) and 18.10 (Cosmic Cuttlefish)
To clone the repository execute:
$ git clone https://github.com/rovellipaolo/gnome-shell-extension-sermon
$ cd gnome-shell-extension-sermon
To build the extension execute:
$ make build
NOTE: This will create a zip archive named sermon@rovellipaolo-gmail.com.shell-extension.zip
.
To install the extension execute:
$ make install
NOTE: This will unzip the previously builded zip archive into ~/.local/share/gnome-shell/extensions/sermon@rovellipaolo-gmail.com
.
Afterwards, restart GNOME Shell: press Alt
+F2
, type r
and press enter.
Finally, if not already done, enable the extension at: https://extensions.gnome.org Or, alternatively, to enable the extension execute:
$ make enable
While to disable the extension execute:
$ make disable
See existing settings at: https://extensions.gnome.org/local/
To change the settings go to: org.gnome.shell.extensions.sermon.gschema.xml
And then execute:
$ make build-settings
To run the checkstyle execute:
$ make checkstyle
NOTE: This is using eslint
and prettier
under-the-hood.
You can also run the checkstyle automatically at every git commit by launching the following command:
$ make install-githooks
To run the tests execute:
$ make test
...
Container.isInstalled()
✔ when container engine is found, returns true
✔ when container engine is not found, returns false
Container.getContainers()
✔ when retrieving the containers, container engine ps command is executed
Container.parseContainers()
✔ when pasing command execution result with containers, returns a list of containers
✔ when pasing command execution result without containers, returns an empty list
Container.filterContainers()
✔ returns the list of containers ordered by status
✔ when no container is passed, returns an empty list
Container.startContainer()
✔ when starting a container, container engine start command is executed
Container.stopContainer()
✔ when stopping a Docker container, container engine stop command is executed
Container.restartContainer()
✔ when restarting a Docker container, container engine restart command is executed
Container.removeContainer()
✔ when removing a Docker container, container engine rm command is executed
...
MenuPresenter()
✔ when initialized, there is no event in the menu
✔ when initialized, there is no section in the menu
✔ when initialized, the active sections are retrieved
✔ when initialized, the icon in shown in the menu
MenuPresenter.onClick()
✔ when clicking on the menu and this is already open, no operation is performed
✔ when clicking on the menu and this opens, the active sections are refreshed
✔ when clicking on the menu and this opens, the menu is cleared and then shown again
MenuPresenter.setupEvents()
✔ when setting up the menu events, a click event is added to the menu
MenuPresenter.setupView()
✔ when setting up the menu, this is cleared and then shown
✔ when setting up the menu, the section container is shown in the menu
✔ when setting up the menu and Systemd is not enabled, its section is not shown
✔ when setting up the menu and Systemd is enabled, its section is shown in first position
✔ when setting up the menu and Cron is not enabled, its section is not shown
✔ when setting up the menu and both Systemd and Cron are enabled, Cron section is shown in the menu in second position
✔ when setting up the menu and only Cron is enabled, Cron section is shown in the menu in first position
✔ when setting up the menu and Docker is not enabled, its section is not shown
✔ when setting up the menu and all sections are enabled, Docker section is shown in the menu in third position
✔ when setting up the menu and both Systemd and Docker are enabled, Docker section is shown in the menu in second position
✔ when setting up the menu and only Docker is enabled, Docker section is shown in the menu in first position
MenuPresenter.onDestroy()
✔ when destroyed and without events, no operation is performed
✔ when destroyed and with events, all events are removed from the menu
✔ when destroyed and without views, no operation is performed
✔ when destroyed and with views, all views are removed from the menu
...
✔ 668 completed
NOTE: This is using gjsunit
under-the-hood.
To show GNOME Shell logs execute:
$ make show-logs
[SerMon] DEBUG (MenuPresenter) On click menu
[SerMon] DEBUG (MenuPresenter) Refreshing menu...
[SerMon] DEBUG (MenuPresenter) Rendering menu...
[SerMon] DEBUG (CommandLine) Executing: "systemctl list-units --type=service --all"
[SerMon] DEBUG (CommandLine) Output: ...
[SerMon] INFO (SectionContainerPresenter) Add section: "Systemd"
[SerMon] DEBUG (CommandLine) Executing: "crontab -l"
[SerMon] DEBUG (CommandLine) Output: ...
[SerMon] INFO (SectionContainerPresenter) Add section: "Cron"
[SerMon] DEBUG (CommandLine) Executing: "docker ps -a --format '{{.ID}} | {{.Status}} | {{.Names}}'"
[SerMon] DEBUG (CommandLine) Output: ...
[SerMon] INFO (SectionContainerPresenter) Add section: "Docker"
[SerMon] DEBUG (CommandLine) Executing: "docker ps -a --format '{{.ID}} | {{.Image}} | {{.Status}} | {{.Names}}'"
[SerMon] DEBUG (CommandLine) Output: ...
[SerMon] INFO (SectionPresenter) Add item: "cron"
[SerMon] INFO (SectionPresenter) Add item: "docker"
[SerMon] INFO (SectionPresenter) Add item: "memcached"
[SerMon] INFO (SectionPresenter) Add item: "mysql"
[SerMon] INFO (SectionPresenter) Add item: "..."
[SerMon] INFO (SectionPresenter) Add item: "0 * * * * /usr/local/bin/my_cron_script"
[SerMon] INFO (SectionPresenter) Add item: "0 12 * * * (cd \"/opt/my_cron_repo\"; HOME= git pull)"
[SerMon] INFO (SectionPresenter) Add item: "my_docker (123456789abc)"
[SerMon] DEBUG (ClickableSectionItemPresenter) On mouse over: "my_docker (123456789abc)"
[SerMon] DEBUG (ClickableSectionItemPresenter) On click: "my_docker (123456789abc)"
[SerMon] DEBUG (CommandLine) Executing: "docker stop 123456789abc"
[SerMon] INFO (DockerRepository) Docker container "123456789abc" stopped correctly!
[SerMon] DEBUG (MenuPresenter) Rendering menu...