Skip to content

Commit

Permalink
Merge branch 'paradoxxxzero:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
mnemonic-powerplay committed Oct 7, 2022
2 parents db8f445 + b359d88 commit 820efd5
Show file tree
Hide file tree
Showing 79 changed files with 5,048 additions and 2,230 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
_build
archlinux
dist
*.out
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build Docker
runs-on: ubuntu-20.04
steps:
- name: Checking out our code
uses: actions/checkout@master
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Run Docker
run: |
ls -lah /run
ls -lah /run/lock
ls -lah /tmp
docker --version
./docker/build-docker.sh
./docker/run-docker.sh || true
./docker/run_and_kill.py || true
./check_tests.sh
69 changes: 30 additions & 39 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,23 @@
# https://docs.travis-ci.com/user/ci-environment/#Virtualization-environments
dist: xenial
sudo: required
language: python
python: 2.7
language: node_js
node_js: node

env:
- MAX_CPU_PERCENT=20 MAX_MEM_PERCENT=5
#env:
#- MAX_CPU_PERCENT=20 MAX_MEM_PERCENT=5

before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get -qq update
- sudo apt-get -qq -y -o Dpkg::Options::="--force-confnew" install docker-ce

install:
- sudo apt-key update
- sudo apt-get -yq update
- sudo apt -yq install xvfb gnome-shell

# Install NodeJS from upstream, since the version that comes with Ubuntu 14 is ancient.
# https://askubuntu.com/a/548776/13217
- sudo apt-get -yq install curl
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- sudo apt-get install -yq nodejs

# Necessary on some versions of Ubuntu 14, which has a malformed npm/nodejs package.
- sudo bash -c "[ ! -f /usr/bin/node ] && ln -s /usr/bin/nodejs /usr/bin/node || true"
- which nodejs
- which node

# Install NPM from upstream.
- git clone git://github.com/npm/cli.git
- cd cli/scripts
- chmod +x install.sh
- sudo ./install.sh
- cd ../..

- sudo npm install -g eslint
- npm install -g eslint

before_script:
- "export DISPLAY=:99.0"
Expand All @@ -43,30 +30,34 @@ before_script:
script:

# Clear initial gnome-shell errors we don't care about.
- sudo journalctl /usr/bin/gnome-shell
- sudo journalctl --rotate
- sudo journalctl --vacuum-time=1s
#- sudo journalctl /usr/bin/gnome-shell
#- sudo journalctl --rotate
#- sudo journalctl --vacuum-time=1s

# Show pre-extension gnome-shell performance.
- ps -C gnome-shell -o %cpu,%mem,cmd
#- ps -C gnome-shell -o %cpu,%mem,cmd

# Run JSlint check.
- cd $TRAVIS_BUILD_DIR
- ./checkjs.sh

# Install and enable extension.
- sudo make install
- gnome-shell-extension-tool --enable-extension=system-monitor@paradoxxx.zero.gmail.com
#- sudo make install
#- gnome-shell-extension-tool --enable-extension=system-monitor@paradoxxx.zero.gmail.com

# Give extension time to run.
- sleep 10
#- sleep 10

# Show post-extension gnome-shell performance.
- ps -C gnome-shell -o %cpu,%mem,cmd
# Check CPU. On localhost with 2.80GHz x 4 takes ~3%, on Travis ~15%.
- bash -c '[[ $(bc <<< "$(ps -C gnome-shell -o %cpu|tail -1) < $MAX_CPU_PERCENT") -eq 1 ]]'
# Check memory. On localhost with 32GB of memory, ~0.6%, on Travis ~3%.
- bash -c '[[ $(bc <<< "$(ps -C gnome-shell -o %mem|tail -1) < $MAX_MEM_PERCENT") -eq 1 ]]'
# Confirm extension hasn't thrown any errors.
- sudo journalctl /usr/bin/gnome-shell
- sudo journalctl /usr/bin/gnome-shell|grep "\-\- No entries \-\-"
#- ps -C gnome-shell -o %cpu,%mem,cmd
## Check CPU. On localhost with 2.80GHz x 4 takes ~3%, on Travis ~15%.
#- bash -c '[[ $(bc <<< "$(ps -C gnome-shell -o %cpu|tail -1) < $MAX_CPU_PERCENT") -eq 1 ]]'
## Check memory. On localhost with 32GB of memory, ~0.6%, on Travis ~3%.
#- bash -c '[[ $(bc <<< "$(ps -C gnome-shell -o %mem|tail -1) < $MAX_MEM_PERCENT") -eq 1 ]]'
## Confirm extension hasn't thrown any errors.
#- sudo journalctl /usr/bin/gnome-shell
#- sudo journalctl /usr/bin/gnome-shell|grep "\-\- No entries \-\-"

# Run Docker GUI tests.
- docker --version
- ./test.sh
78 changes: 55 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Gnome shell system monitor extension
## GNOME Shell system monitor extension

[![Build Status](https://img.shields.io/travis/paradoxxxzero/gnome-shell-system-monitor-applet.svg?branch=master)](https://travis-ci.org/paradoxxxzero/gnome-shell-system-monitor-applet)
[![Build Status](https://travis-ci.com/paradoxxxzero/gnome-shell-system-monitor-applet.svg?branch=master)](https://travis-ci.com/paradoxxxzero/gnome-shell-system-monitor-applet)

![screenshot-small](http://i.imgur.com/ka9OA.png)

Expand All @@ -13,27 +13,39 @@
#### Prerequisites

This extension [requires GNOME Shell v3.26 or later](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/blob/master/system-monitor%40paradoxxx.zero.gmail.com/metadata.json#L2).
Please see the alternate branches [gnome-3.0](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/tree/gnome-3.0) and [gnome-3.2](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/tree/gnome-3.2) if you are using an older version of GNOME Shell (check with `gnome-shell --version`).

Before installing this extension, ensure you have the necessary system packages installed:

* On Ubuntu:

$ sudo apt install gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0
sudo apt install gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0 gnome-system-monitor

* On Debian:

$ sudo apt install gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0
sudo apt install gir1.2-gtop-2.0 gir1.2-nm-1.0 gir1.2-clutter-1.0 gnome-system-monitor

* On Fedora:

$ sudo yum install --assumeyes libgtop2-devel NetworkManager-glib-devel

sudo dnf install libgtop2-devel NetworkManager-libnm-devel gnome-system-monitor

* On Arch Linux:

sudo pacman -S libgtop networkmanager gnome-system-monitor clutter

* On openSUSE (Leap 42.1):

$ sudo zypper install gnome-shell-devel libgtop-devel libgtop-2_0-10
sudo zypper install gnome-shell-devel libgtop-devel libgtop-2_0-10 gnome-system-monitor

* On Mageia 64-bit (just remove "64" on i586):

sudo urpmi lib64gtop-gir2.0 lib64nm-gir1.0 lib64clutter-gir1.0 gnome-system-monitor

or

sudo dnf install lib64gtop-gir2.0 lib64nm-gir1.0 lib64clutter-gir1.0 gnome-system-monitor


Additionally, if you have an Nvidia graphics card, and want to monitor its memory usage, you'll need to install `nvidia-smi`.
Additionally, if you have an NVIDIA graphics card, and want to monitor its memory usage, you'll need to install `nvidia-smi`.

For the browser installation (recommended), you will need the GNOME Shell integration browser extension for
[Chrome](https://chrome.google.com/webstore/detail/gnome-shell-integration/gphhapmejobijbbhgpjhcjognlahblep),
Expand All @@ -53,13 +65,13 @@ preferably in Firefox, and install by clicking the toggle button next to the ext
If the install was successful, the toggle button should now show "ON".
If it failed, ensure that you installed all the [necessary dependencies](#prerequisites),
and that you granted the browser permission to install extensions when prompted.
Additionally, rebooting gnome-shell may help (type `Alt + F2` and input `r` in the prompt).
Additionally, rebooting gnome-shell may help (type `Alt + F2` and input `r` in the prompt), but it won't work with Wayland.

#### Repository installation

* Extension is in Fedora 25, 26, 27 and Rawhide repositories, you can install it for all users with the following command:
* Extension is in Fedora onwards (up to Fedora 33, last update) and Rawhide repositories, you can install it for all users with the following command:

$ sudo dnf install gnome-shell-extension-system-monitor-applet
sudo dnf install gnome-shell-extension-system-monitor-applet

* Enable it with `gnome-tweak-tool` or `gnome-shell-extension-tool --enable-extension=system-monitor@paradoxxx.zero.gmail.com`

Expand All @@ -70,10 +82,10 @@ extract the archive, open a shell into its directory, and run:

make install

Alternately, if you plan on doing development on the extension, or testing modifications, it's advised you checkout the Git repository and install a symlink. First, install git if you don't have it: (sudo apt-get install git-core, sudo pacman -S git, etc), then run:
Alternately, if you plan on doing development on the extension, or testing modifications, it's advised you checkout the Git repository and install a symlink. First, install git if you don't have it: (`sudo apt-get install git-core`, `sudo pacman -S git`, etc.), then run:

GIT_PROJECTS=~/git_projects
PROJECT_NAME=system-monitor@paradoxxx.zero.gmail.com
PROJECT_NAME=gnome-shell-system-monitor-applet
mkdir $GIT_PROJECTS
cd $GIT_PROJECTS
git clone git://github.com/paradoxxxzero/gnome-shell-system-monitor-applet.git $PROJECT_NAME
Expand All @@ -82,37 +94,57 @@ Alternately, if you plan on doing development on the extension, or testing modif
{ [ -d "./$PROJECT_NAME" ] || [ -L "./$PROJECT_NAME" ]; } && rm -Rf "./$PROJECT_NAME"
ln -s $GIT_PROJECTS/gnome-shell-system-monitor-applet/$PROJECT_NAME
gnome-shell-extension-tool --enable-extension=$PROJECT_NAME
gnome-extensions enable system-monitor@paradoxxx.zero.gmail.com

And restart gnome-shell (`Alt + F2`, then `r`) or reboot the machine.
And reload GNOME Shell (`Alt + F2`, then `r`) or restart your GNOME session if you are using Wayland.

On openSUSE you need to install a devel package that provides the `gnome-shell-extension-tool` command:

$ sudo zypper install gnome-shell-devel
sudo zypper install gnome-shell-devel

### Development

#### Translation

If we do not have the translation of your language and you want to translate by yourself, please make a fork, add your po/YOUR_LANG/system-monitor-applet.po file, and make a pull request.
If we do not have the translation for your language and you want to translate it by yourself, please make a fork, add your `po/<YOUR_LANG>/system-monitor-applet.po` file, and make a pull request.

#### Testing

Testing can be done on your native Linux environment using the install instructions above, or through Docker.

To build and run a Docker image:

./build-docker.sh
./run-docker.sh

To connect to the container's desktop through VNC:

./open-docker.sh

Once logged in, you'll still need to manually enable the extension by open the Gnome Tweaks tool.

Afterwards, when you're done testing, you can destroy the container with:

./close-docker.sh

#### Deployment

1. To create a zip file with the specified version number, ready to upload to [Gnome Shell Extensions](https://extensions.gnome.org/) or similar repository, run:
1. To create a ZIP file with the specified version number, ready to upload to [GNOME Shell Extensions](https://extensions.gnome.org/) or similar repository, run:

make zip-file VERSION=<version>

To determine the version number to use, check the extensions site and increment from the largest published version.

The specified version number is just for documentation and isn't strictly necessary in the uploaded file, since the extensions website will dynamically set this and override whatever we enter.

2. Once uploaded, [create a Github release](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/releases) with the same version number.
2. Once uploaded, [create a GitHub release](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/releases) with the same version number.

### Authors

[paradoxxxzero](https://github.com/paradoxxxzero)
[yuyichao](https://github.com/yuyichao)
[darkxst](https://github.com/darkxst)
And [many contributors](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/contributors)
and [many contributors](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet/contributors)

### License

Expand All @@ -125,8 +157,8 @@ the Free Software Foundation, either version 3 of the License, or

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <http://www.gnu.org/licenses/>.
2 changes: 1 addition & 1 deletion archlinux/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ makedepends=('git')
provides=("system-monitor-applet")
#install=gschemas.install

_gitroot="git://github.com/paradoxxxzero/gnome-shell-system-monitor-applet.git"
_gitroot="https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet.git"
_gitname="gnome-shell-system-monitor-applet"

build() {
Expand Down
1 change: 1 addition & 0 deletions checkjs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
# Install eslint with:
# sudo apt-get install npm && sudo npm install -g eslint
set -e
eslint system-monitor@paradoxxx.zero.gmail.com
Loading

0 comments on commit 820efd5

Please sign in to comment.