Skip to content

Commit

Permalink
Release 0.11.0 (#259)
Browse files Browse the repository at this point in the history
* trigger release workflows on github release publish

* Better storage info (#258)

* created card dummy for drive representation

* create drive cards dynamically

* display drive size in drive card

* usagebar represents actual filling of a drive

* display label if drive is nor mounted

* bring back license headers

* brings back update method on chart

* cleanup

* fix lint

* bump version, update changelogs
  • Loading branch information
stsdc authored Oct 24, 2021
1 parent 3c6fbf4 commit 13720fb
Show file tree
Hide file tree
Showing 17 changed files with 511 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: |
apt update
apt install -y libgala-dev libgee-0.8-dev libglib2.0-dev libgranite-dev libgtk-3-dev libhandy-1-dev
apt install -y libdbus-glib-1-dev libwnck-3-dev libgtop2-dev libwingpanel-3.0-dev
apt install -y libdbus-glib-1-dev libwnck-3-dev libgtop2-dev libwingpanel-3.0-dev libudisks2-dev
apt install -y meson valac sassc git
- name: Build
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: RPM build in Fedora Copr
name: Release on Copr

on:
push:
tags:
- '*'
release:
types: [published]

jobs:
build:
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/release-launchpad.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Launchpad release
name: Release on Launchpad

on:
push:
tags:
- '*'
release:
types: [published]
# on: [push, pull_request]

jobs:
Expand All @@ -26,9 +25,9 @@ jobs:
gpg_private_key: ${{ secrets.GPG_SIGNING_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Check changelog for bumped version
run: |
grep -q ${{ github.event.release.tag_name }} debian/changelog || { echo "Version not bumped!" && exit 1; }
# - name: Check changelog for bumped version
# run: |
# grep -q ${{ github.event.release.tag_name }} debian/changelog || { echo "Version not bumped!" && exit 1; }

- name: Install build dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* libgtop2-dev
* libwingpanel-3.0-dev
* libhandy-1-dev
* libudisks2-dev
* meson
* sassc

Expand Down
3 changes: 2 additions & 1 deletion com.github.stsdc.monitor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%global appname com.github.stsdc.monitor

Name: com.github.stsdc.monitor
Version: 0.10.1
Version: 0.11.0
Release: %autorelease
Summary: Manage processes and monitor system resources
License: GPLv3
Expand All @@ -27,6 +27,7 @@ BuildRequires: pkgconfig(libwnck-3.0)
BuildRequires: pkgconfig(wingpanel)
BuildRequires: pkgconfig(gdk-x11-3.0)
BuildRequires: pkgconfig(libhandy-1)
BuildRequires: pkgconfig(libudisks2-1)

%description

Expand Down
5 changes: 5 additions & 0 deletions data/com.github.stsdc.monitor.appdata.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<url type="help">https://github.com/stsdc/monitor/issues</url>

<releases>
<release version="0.11.0" date="2021-10-24">
​ <description>
​ <p>Add info about drives (based on Dirli's code)</p>
​ </description>
​</release>
<release version="0.10.0" date="2021-09-23">
​ <description>
​ <p>Adds dark theme 🌚</p>
Expand Down
Binary file modified data/screenshots/monitor-system.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
com.github.stsdc.monitor (0.11.0) focal; urgency=low

* Add info about drives (based on Dirli's code)

-- Stanisław Dac <[email protected]> Sun, 24 Oct 2021 21:38:26 +0200

com.github.stsdc.monitor (0.10.1) focal; urgency=low

* Add support for vdx (vm) and nvme disks
Expand Down
1 change: 1 addition & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Build-Depends: meson,
libgtop2-dev,
libwingpanel-3.0-dev,
libhandy-1-dev,
libudisks2-dev,
sassc
Standards-Version: 4.1.1

Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.10.1')
project('com.github.stsdc.monitor', 'vala', 'c', version: '0.11.0')

# these are Meson modules
gnome = import('gnome')
Expand Down Expand Up @@ -28,6 +28,7 @@ gtop = dependency('libgtop-2.0')
wnck = dependency('libwnck-3.0')
wingpanel = dependency('wingpanel', version: '>=2.1.0')
gdk_x11 = dependency('gdk-x11-3.0')
udisks2 = dependency ('udisks2')
handy = dependency('libhandy-1', version: '>=0.90.0')

config_data = configuration_data()
Expand Down Expand Up @@ -150,6 +151,7 @@ executable(
'src/Resources/TemperatureSensor.vala',
'src/Resources/Network.vala',
'src/Resources/Storage.vala',
'src/Resources/Drive.vala',
c_args: c_args,
dependencies: [
glib,
Expand All @@ -161,6 +163,7 @@ executable(
gtop,
wnck,
gdk_x11,
udisks2,
handy,
livechart_dep,
meson.get_compiler('c').find_library('m', required : false),
Expand Down
2 changes: 2 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class Monitor.MainWindow : Hdy.ApplicationWindow {

setup_window_state ();

title = _("Monitor");

get_style_context ().add_class ("rounded");

resources = new Resources ();
Expand Down
31 changes: 0 additions & 31 deletions src/Monitor.vala
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,6 @@ namespace Monitor {
return;
}

var granite_settings = Granite.Settings.get_default ();
var gtk_settings = Gtk.Settings.get_default ();

bool is_dark = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
gtk_settings.gtk_application_prefer_dark_theme = is_dark;


var provider = new Gtk.CssProvider ();

if (is_dark) {
provider.load_from_resource ("/com/github/stsdc/monitor/dark.css");
} else {
provider.load_from_resource ("/com/github/stsdc/monitor/light.css");
}

Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (), provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);

// We listen to changes in Granite.Settings and update our app if the user changes their preference
granite_settings.notify["prefers-color-scheme"].connect (() => {
is_dark = granite_settings.prefers_color_scheme == Granite.Settings.ColorScheme.DARK;
gtk_settings.gtk_application_prefer_dark_theme = is_dark;

if (is_dark) {
provider.load_from_resource ("/com/github/stsdc/monitor/dark.css");
} else {
provider.load_from_resource ("/com/github/stsdc/monitor/light.css");
}
});



window = new MainWindow (this);

// start in background with indicator
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/CPU.vala
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class Monitor.CPU : Object {
}

// Temperature sensor shouldn't be created here since it
// will provides not only cpu temperature
// will provide not only a cpu temperature
temperature_sensor = new TemperatureSensor ();
}

Expand Down
106 changes: 106 additions & 0 deletions src/Resources/Drive.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/*
* Copyright (c) 2020 Dirli <[email protected]>
* Copyright (c) 2021 stsdc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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
* 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/>.
*
*/

public struct Monitor.DriveSmart {
public bool enabled;
public uint64 updated;
public bool failing;
public uint64 power_seconds;
public uint64 power_counts;
public string selftest_status;
public uint life_left;
}

public struct Monitor.DriveVolume {
public string device;
public string label;
public string type;
public string uuid;
public string mount_point;
public uint64 size;
public uint64 free;
public uint64 offset;
}

public class Monitor.DiskDrive : GLib.Object {
public string model;
public uint64 size;
public uint64 free;
public string revision;
public string id;
public string device;
public string partition;
public GLib.Icon drive_icon;



private Gee.ArrayList<DriveVolume?> volumes;

private DriveSmart? smart = null;
public bool has_smart {
get {
return smart != null;
}
}

public DiskDrive () {
free = 0;
volumes = new Gee.ArrayList <DriveVolume?> ();
}

public DriveSmart? get_smart () {
return smart;
}

public void add_smart (DriveSmart _smart) {
smart = _smart;
}

public void add_volume (DriveVolume vol) {
volumes.add (vol);
free = free + vol.free;
}

public Gee.ArrayList<DriveVolume?> get_volumes () {
var volumes_arr = new Gee.ArrayList<DriveVolume?> ();

volumes.foreach ((vol) => {

volumes_arr.add (vol);

return true;
});

volumes_arr.sort (compare_volumes);

return volumes_arr;
}

private int compare_volumes (DriveVolume? vol1, DriveVolume? vol2) {
if (vol1 == null) {
return (vol2 == null) ? 0 : -1;
}

if (vol2 == null) {
return 1;
}

return GLib.strcmp (vol1.device, vol2.device);
}
}
Loading

0 comments on commit 13720fb

Please sign in to comment.