Skip to content

Commit

Permalink
Merge pull request #14 from MoAlyousef/main
Browse files Browse the repository at this point in the history
0.1.11
  • Loading branch information
MoAlyousef committed May 20, 2022
2 parents a561636 + 3c2d5dc commit ef3f2e6
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 3 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: bundle

on:
push:
branches: [ release ]
pull_request:
branches: [ release ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo install cargo-bundle && cargo bundle --release --features=fltk/fltk-bundled
- name: Upload a Build Artifact
uses: actions/upload-artifact@v2
with:
name: sysinfo-gui-bundle
path: target/release/bundle/osx/sysinfo-gui.app
12 changes: 11 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sysinfo-gui"
version = "0.1.10"
version = "0.1.11"
edition = "2021"
repository = "https://github.com/MoAlyousef/sysinfo-gui"
keywords = ["cross-platform", "monitoring", "gui"]
Expand All @@ -9,6 +9,11 @@ categories = ["visualization"]
description = "A cross-platform system-monitoring gui application based on sysinfo and fltk"
documentation = "https://docs.rs/sysinfo-gui"
readme = "README.md"
build = "build.rs"

[package.metadata.bundle]
identifier = "io.github.moalyousef"
icon = ["assets/icon.png"]

[dependencies]
sysinfo = { version = "0.23.10", default-features = false }
Expand All @@ -17,6 +22,9 @@ fltk-grid = "0.1"
parking_lot = "0.12"
dark-light = { version = "0.2.2", optional = true }

[target.'cfg(target_os = "windows")'.build-dependencies]
winres = "0.1"

[profile.release]
opt-level = 3
strip = true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Sysinfo-gui

![alt_test](https://github.com/MoAlyousef/sysinfo-gui/raw/main/assets/icon.png)

A lightweight cross-platform system-monitoring [fltk](https://github.com/fltk-rs/fltk-rs) gui application based on [sysinfo](https://github.com/GuillaumeGomez/sysinfo).

The UI design is inspired by [stacer](https://github.com/oguzhaninan/Stacer).
Expand Down
File renamed without changes.
Binary file added assets/icon.ico
Binary file not shown.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions assets/sysinfo-gui.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Desktop Entry]
Type=Application
Name=sysinfo-gui
Comment=A cross-platform system-monitoring gui application based on sysinfo and fltk
Exec=sysinfo-gui
Icon=icon
Terminal=false
Categories=System;
10 changes: 10 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#[cfg(target_os = "windows")]
fn main() {
let mut res = winres::WindowsResource::new();
res.set_icon("assets/icon.ico");
res.compile().unwrap();
}

#[cfg(not(target_os = "windows"))]
fn main() {
}
5 changes: 4 additions & 1 deletion src/gui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use super::widgets::*;
use super::{message::Message, View};
use fltk::{enums::*, prelude::*, *};

const ICON: &[u8] = include_bytes!("../../assets/icon.png");

pub struct App {
a: app::App,
r: app::Receiver<Message>,
Expand Down Expand Up @@ -37,7 +39,7 @@ impl App {
app::set_font_size(18);
let temp = std::env::temp_dir().join("Roboto-Medium.ttf");
if !temp.exists() {
let bytes = include_bytes!("../../Roboto-Medium.ttf");
let bytes = include_bytes!("../../assets/Roboto-Medium.ttf");
std::fs::write(&temp, bytes).ok();
}
if let Ok(f) = Font::load_font(temp) {
Expand All @@ -48,6 +50,7 @@ impl App {
.with_size(800, 600)
.with_label("sysinfo-gui");
win.set_xclass("sysinfo");
win.set_icon(Some(image::PngImage::from_data(ICON).unwrap()));
let mut grp = group::Group::default().with_size(60, 600);
grp.set_frame(FrameType::FlatBox);
grp.set_color(BLUE);
Expand Down

0 comments on commit ef3f2e6

Please sign in to comment.