Compare commits

..

No commits in common. "main" and "1.2.0" have entirely different histories.
main ... 1.2.0

43 changed files with 628 additions and 3118 deletions

View file

@ -1 +0,0 @@
flake-profile-4-link

View file

@ -1 +0,0 @@
/nix/store/30prmd5nyydss0bcs7d578grjav6i7x3-nix-shell-env

2
.envrc
View file

@ -1,2 +1,2 @@
#!/usr/bin/env bash #!/usr/bin/env bash
use flake use nix

View file

@ -18,4 +18,4 @@ jobs:
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: | files: |
ReSet-${{github.ref_name}}-0-x86_64.pkg.tar.zst reset-${{github.ref_name}}-0-x86_64.pkg.tar.zst

View file

@ -1,6 +1,7 @@
on: on:
release: release:
types: [created] types: [ created ]
jobs: jobs:
release: release:
runs-on: [self-hosted, ubuntu] runs-on: [self-hosted, ubuntu]
@ -12,26 +13,23 @@ jobs:
profile: minimal profile: minimal
toolchain: nightly toolchain: nightly
- name: Build rust package - name: Build rust package
run: | run: cargo build --release --verbose
cargo build --release --verbose
- name: Build Flatpak - name: Build Flatpak
run: "cd flatpak\npython3 flatpak-generator.py ../Cargo.lock -o cargo-sources.json \nflatpak-builder build org.Xetibo.ReSet.json --force-clean \nflatpak build-export export build\nflatpak build-bundle export reset.flatpak org.Xetibo.ReSet\n" run: |
cd flatpak
python3 flatpak-generator.py ../Cargo.lock -o cargo-sources.json
flatpak-builder build org.Xetibo.ReSet.json --force-clean
flatpak build-export export build
flatpak build-bundle export reset.flatpak org.Xetibo.ReSet
- name: Build Ubuntu package - name: Build Ubuntu package
run: | run: |
mkdir -p ./debian/usr cp ./target/release/reset ./debian/.
mkdir -p ./debian/usr/bin
mkdir -p ./debian/usr/share
mkdir -p ./debian/usr/share/applications
mkdir -p ./debian/usr/share/pixmaps
cp ./target/release/ReSet ./debian/usr/bin/ReSet
cp ./ReSet.desktop ./debian/usr/share/applications/.
cp ./src/resources/icons/ReSet.svg ./debian/usr/share/pixmaps/.
dpkg-deb --build debian dpkg-deb --build debian
mv debian.deb ReSet.deb mv debian.deb reset.deb
- name: Release - name: Release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
with: with:
files: | files: |
target/release/ReSet target/release/reset
flatpak/reset.flatpak flatpak/reset.flatpak
ReSet.deb reset.deb

View file

@ -1,33 +1,25 @@
# inspired by https://github.com/danth/stylix/blob/master/.github/workflows/docs.yml name: Rust
name: Rust-build
on: on:
push: push:
branches: ["main"] branches: [ "main" ]
pull_request: pull_request:
branches: ["main"] branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs: jobs:
build: build:
name: Build runs-on: [self-hosted, ubuntu]
permissions:
contents: read
runs-on: ubuntu-latest
steps: steps:
- name: Install Nix - uses: actions/checkout@v3
uses: DeterminateSystems/nix-installer-action@main - name: nightly-rust
uses: actions-rs/toolchain@v1
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} profile: minimal
extra-conf: | toolchain: nightly
extra-experimental-features = nix-command flakes
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: action
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: cache
uses: cachix/cachix-action@v14
with:
name: reset
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Build - name: Build
run: nix -L build github:${{ github.repository }}/${{ github.sha }} --no-write-lock-file run: cargo build --verbose
- name: Run clippy
run: cargo clippy --fix

71
Cargo.lock generated
View file

@ -204,6 +204,27 @@ dependencies = [
"tokio", "tokio",
] ]
[[package]]
name = "directories-next"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc"
dependencies = [
"cfg-if",
"dirs-sys-next",
]
[[package]]
name = "dirs-sys-next"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
dependencies = [
"libc",
"redox_users",
"winapi",
]
[[package]] [[package]]
name = "equivalent" name = "equivalent"
version = "1.0.1" version = "1.0.1"
@ -375,6 +396,17 @@ dependencies = [
"system-deps", "system-deps",
] ]
[[package]]
name = "getrandom"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c"
dependencies = [
"cfg-if",
"libc",
"wasi",
]
[[package]] [[package]]
name = "gimli" name = "gimli"
version = "0.28.1" version = "0.28.1"
@ -712,6 +744,16 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "libredox"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
dependencies = [
"bitflags 2.5.0",
"libc",
]
[[package]] [[package]]
name = "lock_api" name = "lock_api"
version = "0.4.11" version = "0.4.11"
@ -926,19 +968,19 @@ dependencies = [
[[package]] [[package]]
name = "re_set-lib" name = "re_set-lib"
version = "5.2.5" version = "3.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69ec9fc4d9e919feb030e5382de1aa49447404a57ecc19361bf7710f1cf9063e" checksum = "d25cf78a85f7e39ca17fd755a370044d828b1d99998f41a6778d4d707e278c74"
dependencies = [ dependencies = [
"dbus", "dbus",
"dbus-crossroads", "dbus-crossroads",
"directories-next",
"gtk4", "gtk4",
"libloading", "libloading",
"libpulse-binding", "libpulse-binding",
"once_cell", "once_cell",
"serial_test", "serial_test",
"toml", "toml",
"xdg",
] ]
[[package]] [[package]]
@ -950,9 +992,20 @@ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
] ]
[[package]]
name = "redox_users"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891"
dependencies = [
"getrandom",
"libredox",
"thiserror",
]
[[package]] [[package]]
name = "reset" name = "reset"
version = "2.0.0" version = "1.2.0"
dependencies = [ dependencies = [
"dbus", "dbus",
"fork", "fork",
@ -968,9 +1021,9 @@ dependencies = [
[[package]] [[package]]
name = "reset_daemon" name = "reset_daemon"
version = "2.2.0" version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f72dd51da41c2fc3ac37ae55fbdeb2670d32cad39cc85cc95a9ea25fc02b6086" checksum = "130fefb02b41748af697f67ff201fffe5e73864331a177442e7cd9910b538fb1"
dependencies = [ dependencies = [
"crossbeam", "crossbeam",
"dbus", "dbus",
@ -1426,9 +1479,3 @@ checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "xdg"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546"

View file

@ -1,18 +1,14 @@
[package] [package]
name = "reset" name = "reset"
version = "2.0.0" version = "1.2.0"
edition = "2021" edition = "2021"
description = "A wip universal Linux settings application." description = "A wip universal Linux settings application."
repository = "https://github.com/Xetibo/ReSet" repository = "https://github.com/Xetibo/ReSet"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
[[bin]]
name = "ReSet"
path = "src/main.rs"
[dependencies] [dependencies]
reset_daemon = "2.2.0" reset_daemon = "1.3.1"
re_set-lib = "5.2.5" re_set-lib = "3.4.1"
adw = { version = "0.6.0", package = "libadwaita", features = ["v1_4"] } adw = { version = "0.6.0", package = "libadwaita", features = ["v1_4"] }
dbus = "0.9.7" dbus = "0.9.7"
gtk = { version = "0.8.1", package = "gtk4", features = ["v4_12"] } gtk = { version = "0.8.1", package = "gtk4", features = ["v4_12"] }

View file

@ -1,15 +1,12 @@
# Maintainer: Fabio Lenherr <dashie@dashie.org> # Maintainer: Fabio Lenherr <dashie@dashie.org>
pkgname=ReSet pkgname=reset
pkgver=2.0.0 pkgver=1.0.0
pkgrel=0 pkgrel=0
arch=('x86_64') arch=('x86_64')
pkgdir="/usr/bin/${pkgname}" pkgdir="/usr/bin/${pkgname}"
pkgdesc="A wip universal Linux settings application." pkgdesc="A wip universal Linux settings application."
depends=('gtk4' 'dbus' 'libadwaita') depends=('rust' 'gtk4' 'dbus')
optdepends=('pipewire-pulse' 'networkmanager' 'bluez')
makedepends=('rust')
build() { build() {
cargo build --release cargo build --release
@ -19,5 +16,5 @@ package() {
cd .. cd ..
install -Dm755 target/release/"$pkgname" "$pkgdir"/usr/bin/"$pkgname" install -Dm755 target/release/"$pkgname" "$pkgdir"/usr/bin/"$pkgname"
install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop" install -Dm644 "$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
install -Dm644 "src/resources/icons/$pkgname.svg" "$pkgdir/usr/share/pixmaps/$pkgname.svg" install -Dm644 "src/resources/icons/ReSet.svg" "$pkgdir/usr/share/pixmaps/ReSet.svg"
} }

View file

@ -5,11 +5,11 @@
![Logo of ReSet](./assets/ReSet.png) ![Logo of ReSet](./assets/ReSet.png)
A window manager/compositor agnostic settings application for Linux written in rust and gtk4. A window manager/compositor agnostic settings application for Linux written in rust and gtk4.
</div> </div>
## Features
## Features
- Bluetooth via bluez - Bluetooth via bluez
- Audio via PulseAudio - Audio via PulseAudio
- Wi-Fi via NetworkManager - Wi-Fi via NetworkManager
@ -23,58 +23,31 @@ A window manager/compositor agnostic settings application for Linux written in r
<img alt="Audio Screenshot of ReSet" src="./assets/reset_audio.png" width="80%"> <img alt="Audio Screenshot of ReSet" src="./assets/reset_audio.png" width="80%">
### Wi-Fi ### Wi-Fi
<img alt="Wi-Fi Screenshot of ReSet" src="./assets/reset_wifi.png" width="80%"> <img alt="Wi-Fi Screenshot of ReSet" src="./assets/reset_wifi.png" width="80%">
### Bluetooth ### Bluetooth
<img alt="Bluetooth Screenshot of ReSet" src="./assets/reset_bluetooth.png" width="80%"> <img alt="Bluetooth Screenshot of ReSet" src="./assets/reset_bluetooth.png" width="80%">
</div> </div>
## Plugins
ReSet features a plugin system by loading dynamic libraries for both the daemon and the ReSet graphical user interface.
A list of official plugins, installation guides and their documentation can be found at [ReSet-Plugins](https://github.com/Xetibo/ReSet-Plugins).
### Installation
Plugins are loaded either from `/usr/lib/reset` or `~/.config/reset/plugins`. In order to install the plugin, either install a distribution specific package that places the library into the specified system folder, or place the library in the plugins folder in your config directory.
Note, after installation, please move to confirmation.
### Confirmation
In order for your plugins to load, you have to define them in `.config/reset/ReSet.toml`.
This is done to avoid loading of arbitrary plugins that might be placed within this folder by accident.
```toml
plugins = ["libreset_monitors.so", "libreset_keyboard_plugin.so"]
```
## Packaging ## Packaging
ReSet is available with the following packaging solutions: ReSet is available with the following packaging solutions:
### Flatpak ### Flatpak
We are currently not published on flatpak due to issues with permissions. We are currently not published on flatpak due to issues with permissions.
This is being worked on... This is being worked on...
Installation: installation:
Download the flatpak package (reset.flatpak) from the release and install with the terminal. Download the flatpak package from the release and install with the terminal.
``` ```
flatpak install --user reset.flatpak flatpak install --user reset.flatpak
``` ```
### Arch Package ### Arch Package
<!-- AUR: --> <!-- AUR: -->
<!-- ```paru -S ReSet``` --> <!-- ```paru -S ReSet``` -->
Manually: Manually:
Download the package (ReSet-version-x86_64.pkg.tar.zst) from the releases tab and install it with pacman. Download the package from the releases tab and install it with pacman.
``` ```
sudo pacman -U /path/to/reset sudo pacman -U /path/to/reset
@ -82,60 +55,31 @@ sudo pacman -U /path/to/reset
### Debian Package(Ubuntu 23.04 dependencies) ### Debian Package(Ubuntu 23.04 dependencies)
Download the package (ReSet.deb) from the releases tab and install it with apt. Download the package from the releases tab and install it with apt.
``` ```
sudo apt install ./path/to/reset sudo apt install ./path/to/reset
``` ```
### NixOS/Home-manager
ReSet offers a flake with a home-manager module which you can use to declaratively install ReSet and plugins.
Here is an example configuration:
```nix
#inputs
reset.url = "github:Xetibo/ReSet";
reset-plugins.url = "github:Xetibo/ReSet-Plugins";
#installation and configuration
programs.ReSet.enable = true;
programs.ReSet.config.plugins = [
inputs.reset-plugins.packages."x86_64-linux".monitor
inputs.reset-plugins.packages."x86_64-linux".keyboard
];
programs.ReSet.config.plugin_config = {
#custom toml config
Keyboard = {
path = "/home/user/.config/reset/keyboard.conf";
};
};
```
### crates ### crates
``` ```
cargo install reset cargo install reset
``` ```
### Compiled Binary ### Compiled Binary
The compiled binary is provided in the releases. The compiled binary is provided in the releases.
## Usage ## Usage
Besides starting the application itself, a standalone daemon version ([ReSet-Daemon](https://github.com/Xetibo/ReSet-Daemon)) also exists, which is what provides the functionality for ReSet.\ Besides starting the application itself, a standalone daemon version ([ReSet-Daemon](https://github.com/Xetibo/ReSet-Daemon)) also exists, which is what provides the functionality for ReSet.\
It is therefore possible to use a different application as well for interacting with the daemon. It is therefore possible to use a different application as well for interacting with the daemon.
By default, the daemon is integrated into ReSet and is started automatically if no other daemon is found. By default, the daemon is integrated into ReSet and is started automatically if no other daemon is found.
## Roadmap
## Roadmap and Notes This application was developed as a semester project for the Eastern Switzerland University of Applied Sciences.
With potential advancements as a next project, due to this, no major development will happen until February 2024.
However, there is still a roadmap for this application.
- Plugin System
- Accessibility Features - Accessibility Features
- Better Error handling - Better Error handling
- Customizable shortcuts - Customizable shortcuts
- and more - and more
### notes
This application was developed as a semester project/bachelor thesis for the Eastern Switzerland University of Applied Sciences.

View file

@ -1,9 +1,5 @@
Package: ReSet Package: ReSet
Version: 2.0.0 Version: 0.1
Maintainer: DashieTM Maintainer: DashieTM
Architecture: all Architecture: all
Description: A wip universal Linux settings application. Description: A wip universal Linux settings application.
Homepage: https://github.com/Xetibo/ReSet
Build-Depends: rust
Depends: libadwaita-1-0, libgtk-4-1, dbus
Recommends: pipewire-pulse, network-manager, bluez

View file

@ -1,83 +0,0 @@
{
"nodes": {
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1738453229,
"narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1739446958,
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1736320768,
"narHash": "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4bc9c909d9ac828a039f288cf872d16d38185db8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1739586408,
"narHash": "sha256-UN9hRKRE1eLU8C0cioTZubaCZQTA8NDc8/4vCpS5pS0=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "3dbc0ce1c0690b83cfb9a9a51fbe90c3bc8f9916",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,62 +0,0 @@
{
description = "A wip universal Linux settings application.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = inputs @ { self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
perSystem =
{ config
, self'
, inputs'
, pkgs
, system
, ...
}:
{
_module.args.pkgs = import self.inputs.nixpkgs {
inherit system;
overlays = [
(import
inputs.rust-overlay
)
];
};
devShells.default = pkgs.mkShell {
inputsFrom = builtins.attrValues self'.packages;
packages = with pkgs; [
# (rust-bin.selectLatestNightlyWith
# (toolchain: toolchain.default))
rust-bin.nightly."2024-05-10".default
rust-analyzer
clippy
];
};
packages =
let
lockFile = ./Cargo.lock;
in
rec {
ReSet = pkgs.callPackage ./nix/default.nix { inherit inputs lockFile; };
default = ReSet;
};
};
flake = _: rec {
nixosModules.home-manager = homeManagerModules.default;
homeManagerModules = rec {
ReSet = import ./nix/hm.nix inputs.self;
default = ReSet;
};
};
};
}

View file

@ -1,3 +1,4 @@
#! /bin/bash
python3 flatpak-generator.py ../Cargo.lock -o cargo-sources.json python3 flatpak-generator.py ../Cargo.lock -o cargo-sources.json
flatpak-builder build org.Xetibo.ReSet.json --force-clean flatpak-builder build org.Xetibo.ReSet.json --force-clean
flatpak build-export export build flatpak build-export export build

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2,7 +2,7 @@
Name=ReSet Name=ReSet
GenericName=SettingsApplication GenericName=SettingsApplication
GenericName[de]=SettingsApplikation GenericName[de]=SettingsApplikation
Exec=ReSet Exec=reset
Terminal=false Terminal=false
Type=Application Type=Application
Keywords=settings;gtk; Keywords=settings;gtk;

View file

@ -1,12 +1,12 @@
{ {
"app-id": "org.Xetibo.ReSet", "app-id": "org.Xetibo.ReSet",
"runtime": "org.gnome.Platform", "runtime": "org.gnome.Platform",
"runtime-version": "46", "runtime-version": "45",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"sdk-extensions": [ "sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-nightly" "org.freedesktop.Sdk.Extension.rust-stable"
], ],
"command": "ReSet", "command": "reset",
"finish-args": [ "finish-args": [
"--socket=pulseaudio", "--socket=pulseaudio",
"--share=network", "--share=network",
@ -17,11 +17,10 @@
"--device=all", "--device=all",
"--allow=bluetooth", "--allow=bluetooth",
"--socket=system-bus", "--socket=system-bus",
"--socket=session-bus", "--socket=session-bus"
"--persist=~/.config/reset:create"
], ],
"build-options": { "build-options": {
"append-path": "/usr/lib/sdk/rust-nightly/bin" "append-path": "/usr/lib/sdk/rust-stable/bin"
}, },
"modules": [ "modules": [
{ {
@ -35,7 +34,7 @@
"build-commands": [ "build-commands": [
"cargo --offline fetch --manifest-path Cargo.toml --verbose", "cargo --offline fetch --manifest-path Cargo.toml --verbose",
"cargo --offline build --release --verbose", "cargo --offline build --release --verbose",
"install -Dm755 ./target/release/ReSet -t /app/bin/", "install -Dm755 ./target/release/reset -t /app/bin/",
"install -Dm644 ./src/resources/icons/ReSet.svg /app/share/icons/hicolor/scalable/apps/org.Xetibo.ReSet.svg", "install -Dm644 ./src/resources/icons/ReSet.svg /app/share/icons/hicolor/scalable/apps/org.Xetibo.ReSet.svg",
"install -Dm644 ./flatpak/org.Xetibo.ReSet.desktop /app/share/applications/org.Xetibo.ReSet.desktop" "install -Dm644 ./flatpak/org.Xetibo.ReSet.desktop /app/share/applications/org.Xetibo.ReSet.desktop"
], ],

View file

@ -1,13 +1,15 @@
{ {
"app-id": "org.Xetibo.ReSet", "app-id": "org.Xetibo.ReSet",
"runtime": "org.gnome.Platform", "runtime": "org.gnome.Platform",
"runtime-version": "46", "runtime-version": "45",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
"sdk-extensions": [ "sdk-extensions": [
"org.freedesktop.Sdk.Extension.rust-nightly" "org.freedesktop.Sdk.Extension.rust-stable"
], ],
"command": "ReSet", "command": "reset",
"finish-args": [ "finish-args": [
"--system-talk-name=org.freedesktop.NetworkManager",
"--system-talk-name=org.bluez",
"--socket=pulseaudio", "--socket=pulseaudio",
"--share=network", "--share=network",
"--share=ipc", "--share=ipc",
@ -15,12 +17,10 @@
"--socket=wayland", "--socket=wayland",
"--device=dri", "--device=dri",
"--device=all", "--device=all",
"--allow=bluetooth", "--allow=bluetooth"
"--socket=system-bus",
"--socket=session-bus"
], ],
"build-options": { "build-options": {
"append-path": "/usr/lib/sdk/rust-nightly/bin" "append-path": "/usr/lib/sdk/rust-stable/bin"
}, },
"modules": [ "modules": [
{ {
@ -33,8 +33,8 @@
}, },
"build-commands": [ "build-commands": [
"cargo --offline fetch --manifest-path Cargo.toml --verbose", "cargo --offline fetch --manifest-path Cargo.toml --verbose",
"cargo --offline build --verbose", "cargo --offline build --release --verbose",
"install -Dm755 ./target/debug/ReSet -t /app/bin/", "install -Dm755 ./target/release/reset -t /app/bin/",
"install -Dm644 ./src/resources/icons/ReSet.svg /app/share/icons/hicolor/scalable/apps/org.Xetibo.ReSet.svg", "install -Dm644 ./src/resources/icons/ReSet.svg /app/share/icons/hicolor/scalable/apps/org.Xetibo.ReSet.svg",
"install -Dm644 ./flatpak/org.Xetibo.ReSet.desktop /app/share/applications/org.Xetibo.ReSet.desktop" "install -Dm644 ./flatpak/org.Xetibo.ReSet.desktop /app/share/applications/org.Xetibo.ReSet.desktop"
], ],

View file

@ -1,69 +0,0 @@
{
rustPlatform,
rust-bin,
pulseaudio,
dbus,
gdk-pixbuf,
adwaita-icon-theme,
pkg-config,
wrapGAppsHook4,
gtk4,
libadwaita,
python312Packages,
flatpak,
flatpak-builder,
lib,
lockFile,
...
}: let
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml);
in
rustPlatform.buildRustPackage rec {
pname = "ReSet";
version = cargoToml.package.version;
src = ../.;
buildInputs = [
gtk4
libadwaita
pulseaudio
dbus
gdk-pixbuf
adwaita-icon-theme
python312Packages.aiohttp
python312Packages.toml
flatpak
flatpak-builder
];
cargoLock = {
inherit lockFile;
};
nativeBuildInputs = [
pkg-config
wrapGAppsHook4
rust-bin.nightly."2024-05-10".default
];
copyLibs = true;
postInstall = ''
install -D --mode=444 $src/${pname}.desktop $out/share/applications/${pname}.desktop
install -D --mode=444 $src/src/resources/icons/${pname}.svg $out/share/pixmaps/${pname}.svg
'';
# test is broken in nix for some reason
doInstallCheck = false;
doCheck = false;
meta = with lib; {
description = "A wip universal Linux settings application.";
homepage = "https://github.com/Xetibo/ReSet";
changelog = "https://github.com/Xetibo/ReSet/releases/tag/${version}";
license = licenses.gpl3;
maintainers = with maintainers; [DashieTM];
mainProgram = "ReSet";
};
}

View file

@ -1,80 +0,0 @@
self: { config
, pkgs
, lib
, hm
, ...
}:
let
cfg = config.programs.ReSet;
defaultPackage = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
in
{
meta.maintainers = with lib.maintainers; [ DashieTM ];
options.programs.ReSet = with lib; {
enable = mkEnableOption "ReSet";
package = mkOption {
type = with types; nullOr package;
default = defaultPackage;
defaultText = lib.literalExpression ''
ReSet.packages.''${pkgs.stdenv.hostPlatform.system}.default
'';
description = mdDoc ''
Package to run
'';
};
config = {
plugins = mkOption {
type = with types; listOf package;
default = null;
description = mdDoc ''
List of plugins to use, represented as a list of packages.
'';
};
plugin_config = mkOption {
type = with types; attrs;
default = { };
description = mdDoc ''
Toml values passed to the configuration for plugins to use.
'';
};
};
};
config =
let
fetchedPlugins =
if cfg.config.plugins == [ ]
then [ ]
else
builtins.map
(entry:
if lib.types.package.check entry
then "lib${lib.replaceStrings ["-"] ["_"] entry.pname}.so"
else "")
cfg.config.plugins;
in
lib.mkIf
cfg.enable
{
home.packages = lib.optional (cfg.package != null) cfg.package ++ cfg.config.plugins;
home.file = builtins.listToAttrs (builtins.map
(pkg: {
name = ".config/reset/plugins/lib${lib.replaceStrings ["-"] ["_"] pkg.pname}.so";
value = {
source = "${pkg}/lib/lib${lib.replaceStrings ["-"] ["_"] pkg.pname}.so";
};
})
cfg.config.plugins);
xdg.configFile."reset/ReSet.toml".source = (pkgs.formats.toml { }).generate "reset"
(lib.recursiveUpdate
{
plugins = fetchedPlugins;
}
cfg.config.plugin_config);
};
}

View file

@ -2,7 +2,7 @@
Name=ReSet Name=ReSet
GenericName=SettingsApplication GenericName=SettingsApplication
GenericName[de]=SettingsApplikation GenericName[de]=SettingsApplikation
Exec=ReSet Exec=reset
Terminal=false Terminal=false
Type=Application Type=Application
Keywords=settings;gtk; Keywords=settings;gtk;

19
shell.nix Normal file
View file

@ -0,0 +1,19 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell {
nativeBuildInputs = [
pkg-config
wrapGAppsHook4
];
buildInputs = [
dbus
pulseaudio
gnome.adwaita-icon-theme
gtk4
libadwaita
gdk-pixbuf
];
}

View file

@ -334,7 +334,7 @@ pub fn start_audio_box_listener<
get_default_name_function: &'static DBusFunction, get_default_name_function: &'static DBusFunction,
dummy_name: &'static str, dummy_name: &'static str,
) -> Connection { ) -> Connection {
// FUTURE TODO: make the failed logs generically sound -> deynamic output for both // TODO: make the failed logs generically sound -> deynamic output for both
let object_added = let object_added =
ObjectAdded::match_rule(Some(&BASE.into()), Some(&Path::from(DBUS_PATH))).static_clone(); ObjectAdded::match_rule(Some(&BASE.into()), Some(&Path::from(DBUS_PATH))).static_clone();
let object_changed = let object_changed =

View file

@ -117,7 +117,7 @@ pub fn new_entry<
reset_box: Arc<AudioBox>, reset_box: Arc<AudioBox>,
) -> Arc<AudioEntry> { ) -> Arc<AudioEntry> {
let obj: Arc<AudioEntry> = Arc::new(Object::builder().build()); let obj: Arc<AudioEntry> = Arc::new(Object::builder().build());
// FUTURE TODO: use event callback for progress bar -> this is the "im speaking" indicator // TODO use event callback for progress bar -> this is the "im speaking" indicator
{ {
let imp = obj.entry_imp(); let imp = obj.entry_imp();
let slider_obj_ref = obj.clone(); let slider_obj_ref = obj.clone();

View file

@ -91,7 +91,7 @@ pub fn new_stream_entry<
stream: StreamObject, stream: StreamObject,
) -> Arc<AudioStream> { ) -> Arc<AudioStream> {
let obj: Arc<AudioStream> = Arc::new(Object::builder().build()); let obj: Arc<AudioStream> = Arc::new(Object::builder().build());
// FUTURE TODO: use event callback for progress bar -> this is the "im speaking" indicator // TODO use event callback for progress bar -> this is the "im speaking" indicator
let output_box_mute_ref = audio_box.clone(); let output_box_mute_ref = audio_box.clone();
let output_box_volume_ref = audio_box.clone(); let output_box_volume_ref = audio_box.clone();
let output_box_sink_ref = audio_box.clone(); let output_box_sink_ref = audio_box.clone();

View file

@ -54,7 +54,7 @@ pub fn show_error<T: ReSetErrorImpl + Send + Sync + 'static>(
parent: Arc<T>, parent: Arc<T>,
message: &'static str, message: &'static str,
) { ) {
// FUTURE TODO: Add error to log // TODO: Add error to log
glib::spawn_future(async move { glib::spawn_future(async move {
glib::idle_add_once(move || { glib::idle_add_once(move || {
let error = parent.error(); let error = parent.error();

View file

@ -57,7 +57,7 @@ impl BluetoothBox {
} }
} }
// FUTURE TODO: // TODO
// handle bonded -> this means saved but not connected // handle bonded -> this means saved but not connected
// handle rssi below x -> don't show device // handle rssi below x -> don't show device
@ -185,6 +185,7 @@ pub fn populate_connected_bluetooth_devices(
listeners: Arc<Listeners>, listeners: Arc<Listeners>,
bluetooth_box: Arc<BluetoothBox>, bluetooth_box: Arc<BluetoothBox>,
) { ) {
// TODO handle saved devices -> they also exist
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let ref_box = bluetooth_box.clone(); let ref_box = bluetooth_box.clone();
let adapters = get_bluetooth_adapters(ref_box.clone()); let adapters = get_bluetooth_adapters(ref_box.clone());

View file

@ -70,7 +70,7 @@ impl BluetoothEntry {
}); });
let gesture = GestureClick::new(); let gesture = GestureClick::new();
// paired is not what we think // paired is not what we think
// FUTURE TODO: implement paired // TODO implement paired
gesture.connect_released(move |_, _, _, _| { gesture.connect_released(move |_, _, _, _| {
let imp = entry_ref.imp(); let imp = entry_ref.imp();
let borrow = imp.bluetooth_device.borrow(); let borrow = imp.bluetooth_device.borrow();

View file

@ -69,7 +69,7 @@ pub fn device_removed_handler(
if list_entry.imp().bluetooth_device.borrow().connected { if list_entry.imp().bluetooth_device.borrow().connected {
imp.reset_bluetooth_connected_devices.remove(&*list_entry); imp.reset_bluetooth_connected_devices.remove(&*list_entry);
} else { } else {
// FUTURE TODO: is there a better way for this? // TODO: is there a better way for this?
imp.reset_bluetooth_available_devices.remove(&*list_entry); imp.reset_bluetooth_available_devices.remove(&*list_entry);
imp.reset_bluetooth_saved_devices.remove(&*list_entry); imp.reset_bluetooth_saved_devices.remove(&*list_entry);
} }

View file

@ -10,9 +10,6 @@ use glib::prelude::Cast;
use glib::Object; use glib::Object;
use gtk::prelude::{GObjectPropertyExpressionExt, ListBoxRowExt, ListItemExt, WidgetExt}; use gtk::prelude::{GObjectPropertyExpressionExt, ListBoxRowExt, ListItemExt, WidgetExt};
use gtk::{Align, SignalListItemFactory, StringObject}; use gtk::{Align, SignalListItemFactory, StringObject};
use re_set_lib::ERROR;
#[cfg(debug_assertions)]
use re_set_lib::{utils::macros::ErrorLevel, write_log_to_file};
pub const DBUS_PATH: &str = "/org/Xetibo/ReSet/Daemon"; pub const DBUS_PATH: &str = "/org/Xetibo/ReSet/Daemon";
pub const WIRELESS: &str = "org.Xetibo.ReSet.Network"; pub const WIRELESS: &str = "org.Xetibo.ReSet.Network";
@ -94,14 +91,7 @@ pub fn set_action_row_ellipsis(element: ActionRow) {
pub fn get_capabilities() -> Vec<String> { pub fn get_capabilities() -> Vec<String> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(BASE, DBUS_PATH, Duration::from_millis(10000)); let proxy = conn.with_proxy(BASE, DBUS_PATH, Duration::from_millis(1000));
let res: Result<(Vec<String>,), Error> = proxy.method_call(BASE, "GetCapabilities", ()); let res: Result<(Vec<String>,), Error> = proxy.method_call(BASE, "GetCapabilities", ());
if res.is_err() {
ERROR!(
"Could not call capabilities from daemon",
ErrorLevel::Critical
);
return Vec::new();
}
res.unwrap().0 res.unwrap().0
} }

View file

@ -55,7 +55,7 @@ impl SavedWifiEntry {
let entry_ref = entry.clone(); let entry_ref = entry.clone();
delete_button.connect_clicked(clone!(@weak wifi_box => move |_| { delete_button.connect_clicked(clone!(@weak wifi_box => move |_| {
delete_connection(entry_ref.imp().reset_connection_path.take()); delete_connection(entry_ref.imp().reset_connection_path.take());
// FUTURE TODO: handle error // TODO handle error
wifi_box.reset_stored_wifi_list.remove(&*entry_ref); wifi_box.reset_stored_wifi_list.remove(&*entry_ref);
})); }));

View file

@ -209,7 +209,7 @@ pub fn show_stored_connections(wifi_box: Arc<WifiBox>) {
glib::idle_add_once(move || { glib::idle_add_once(move || {
let self_imp = wifibox_ref.imp(); let self_imp = wifibox_ref.imp();
for connection in connections { for connection in connections {
// FUTURE TODO: include button for settings // TODO include button for settings
let name = let name =
&String::from_utf8(connection.1).unwrap_or_else(|_| String::from("")); &String::from_utf8(connection.1).unwrap_or_else(|_| String::from(""));
let entry = SavedWifiEntry::new(name, connection.0, self_imp); let entry = SavedWifiEntry::new(name, connection.0, self_imp);

View file

@ -48,7 +48,7 @@ impl WifiEntry {
.build(), .build(),
); );
// FUTURE TODO: handle encryption // TODO handle encryption thing
let wifi_strength = Image::builder() let wifi_strength = Image::builder()
.icon_name(match strength { .icon_name(match strength {
WifiStrength::Excellent => "network-wireless-signal-excellent-symbolic", WifiStrength::Excellent => "network-wireless-signal-excellent-symbolic",
@ -177,7 +177,7 @@ pub fn click_stored_network(entry: Arc<WifiEntry>) {
}); });
}); });
}); });
// FUTURE TODO: crate spinner animation and block UI // TODO crate spinner animation and block UI
} }
pub fn click_new_network(entry: Arc<WifiEntry>) { pub fn click_new_network(entry: Arc<WifiEntry>) {
@ -228,7 +228,7 @@ pub fn click_new_network(entry: Arc<WifiEntry>) {
}); });
}); });
}); });
// FUTURE TODO: crate spinner animation and block UI // TODO crate spinner animation and block UI
}; };
let entry_imp = entry.imp(); let entry_imp = entry.imp();

View file

@ -72,7 +72,7 @@ pub fn access_point_changed_handler(wifi_box: Arc<WifiBox>, ir: AccessPointChang
let name = name_opt.as_str(); let name = name_opt.as_str();
entry_imp.wifi_strength.set(strength); entry_imp.wifi_strength.set(strength);
entry.set_title(name); entry.set_title(name);
// FUTURE TODO: handle encryption thing // TODO handle encryption thing
entry_imp entry_imp
.reset_wifi_strength .reset_wifi_strength
.borrow() .borrow()

View file

@ -21,7 +21,6 @@ use crate::components::utils::get_capabilities;
use crate::components::window::handle_sidebar_click::*; use crate::components::window::handle_sidebar_click::*;
use crate::components::window::reset_window_impl; use crate::components::window::reset_window_impl;
use crate::components::window::sidebar_entry::SidebarEntry; use crate::components::window::sidebar_entry::SidebarEntry;
use crate::VERSION;
use super::consts::{ use super::consts::{
AUDIO_SIDEBAR, BLUETOOTH_SIDEBAR, CONNECTIVITY_SIDEBAR, SINK_SIDEBAR, SOURCE_SIDEBAR, AUDIO_SIDEBAR, BLUETOOTH_SIDEBAR, CONNECTIVITY_SIDEBAR, SINK_SIDEBAR, SOURCE_SIDEBAR,
@ -207,6 +206,7 @@ impl ReSetWindow {
.connect_row_activated(clone!(@ weak self_imp => move |_, _| { .connect_row_activated(clone!(@ weak self_imp => move |_, _| {
self_imp.reset_search_entry.set_text(""); self_imp.reset_search_entry.set_text("");
})); }));
// TODO: refactor this
let mut i = 0; let mut i = 0;
for info in sidebar_list { for info in sidebar_list {
if info.parent.is_none() && i != 0 { if info.parent.is_none() && i != 0 {
@ -316,7 +316,7 @@ impl ReSetWindow {
.license_type(gtk::License::Gpl30) .license_type(gtk::License::Gpl30)
.website("https://github.com/Xetibo/ReSet") .website("https://github.com/Xetibo/ReSet")
.issue_url("https://github.com/Xetibo/ReSet/issues") .issue_url("https://github.com/Xetibo/ReSet/issues")
.version(VERSION) .version("1.0.0")
.transient_for(window) .transient_for(window)
.modal(true) .modal(true)
.copyright("© 2022-2023 Xetibo") .copyright("© 2022-2023 Xetibo")

View file

@ -11,7 +11,7 @@ use crate::components::window::sidebar_entry;
#[derive(Default)] #[derive(Default)]
pub enum Categories { pub enum Categories {
// FUTURE TODO: are these ever used ? // TODO: are these ever used ?
// Connectivity, // Connectivity,
// Audio, // Audio,
// Peripherals, // Peripherals,

View file

@ -1,6 +1,3 @@
use std::hint::{self};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
@ -14,21 +11,12 @@ use gtk::{gio, Application, CssProvider};
use reset_daemon::run_daemon; use reset_daemon::run_daemon;
mod components; mod components;
mod tests;
const APP_ID: &str = "org.Xetibo.ReSet"; const APP_ID: &str = "org.Xetibo.ReSet";
/// Version of the current package.
/// Use this to avoid version mismatch conflicts.
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
let ready = Arc::new(AtomicBool::new(false)); tokio::task::spawn(daemon_check());
tokio::task::spawn(daemon_check(ready.clone()));
while !ready.load(std::sync::atomic::Ordering::SeqCst) {
hint::spin_loop();
}
gio::resources_register_include!("src.templates.gresource") gio::resources_register_include!("src.templates.gresource")
.expect("Failed to register resources."); .expect("Failed to register resources.");
gio::resources_register_include!("src.icons.gresource").expect("Failed to register resources."); gio::resources_register_include!("src.icons.gresource").expect("Failed to register resources.");
@ -71,8 +59,8 @@ fn shutdown(_: &Application) {
}); });
} }
async fn daemon_check(ready: Arc<AtomicBool>) { async fn daemon_check() {
let handle = thread::spawn(move || { let handle = thread::spawn(|| {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(BASE, DBUS_PATH, Duration::from_millis(100)); let proxy = conn.with_proxy(BASE, DBUS_PATH, Duration::from_millis(100));
let res: Result<(), Error> = proxy.method_call(BASE, "RegisterClient", ("ReSet",)); let res: Result<(), Error> = proxy.method_call(BASE, "RegisterClient", ("ReSet",));
@ -80,8 +68,6 @@ async fn daemon_check(ready: Arc<AtomicBool>) {
}); });
let res = handle.join(); let res = handle.join();
if res.unwrap().is_err() { if res.unwrap().is_err() {
run_daemon(Some(ready)).await; run_daemon().await;
} else {
ready.store(true, Ordering::SeqCst);
} }
} }

View file

@ -39,7 +39,6 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="hexpand-set">True</property> <property name="hexpand-set">True</property>
<property name="icon-name">open-menu-symbolic</property> <property name="icon-name">open-menu-symbolic</property>
<property name="menu-model">main_menu</property>
<property name="valign">end</property> <property name="valign">end</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
</object> </object>

View file

@ -347,7 +347,7 @@
(3,33,"GtkMenuButton","can-shrink","True",None,None,None,None,None,None,None,None,None), (3,33,"GtkMenuButton","can-shrink","True",None,None,None,None,None,None,None,None,None),
(3,33,"GtkMenuButton","has-frame","False",None,None,None,None,None,None,None,None,None), (3,33,"GtkMenuButton","has-frame","False",None,None,None,None,None,None,None,None,None),
(3,33,"GtkMenuButton","icon-name","open-menu-symbolic",None,None,None,None,None,None,None,None,None), (3,33,"GtkMenuButton","icon-name","open-menu-symbolic",None,None,None,None,None,None,None,None,None),
(3,33,"GtkMenuButton","menu-model","54",None,None,None,None,None,None,None,None,None), (3,33,"GtkMenuButton","menu-model",None,None,None,None,None,None,None,None,None,None),
(3,33,"GtkWidget","halign","end",None,None,None,None,None,None,None,None,None), (3,33,"GtkWidget","halign","end",None,None,None,None,None,None,None,None,None),
(3,33,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None), (3,33,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(3,33,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None), (3,33,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),

View file

@ -32,11 +32,3 @@ notebook > stack > box, notebook > stack {
banner { banner {
border-radius: 5px; border-radius: 5px;
} }
row.selectedLanguage {
background-color: @dialog_bg_color;
}
row.activeLanguage {
background-color: @blue_2;
}

View file

@ -1,24 +0,0 @@
#[tokio::test]
#[cfg(test)]
async fn test_plugins() {
use crate::daemon_check;
use re_set_lib::utils::plugin::plugin_tests;
use re_set_lib::utils::plugin_setup::FRONTEND_PLUGINS;
use std::hint;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
let ready = Arc::new(AtomicBool::new(false));
let rc = tokio::runtime::Runtime::new().expect("Failed to create runtime");
rc.spawn(daemon_check(ready.clone()));
while !ready.load(std::sync::atomic::Ordering::SeqCst) {
hint::spin_loop();
}
unsafe {
for plugin in FRONTEND_PLUGINS.iter() {
let name = (plugin.frontend_name)();
let tests = (plugin.frontend_tests)();
plugin_tests(name, tests);
}
}
rc.shutdown_background();
}

View file

@ -8,7 +8,7 @@ use gtk::prelude::{BoxExt, ButtonExt};
use re_set_lib::utils::plugin::{PluginCapabilities, PluginImplementation, PluginTestFunc, SidebarInfo}; use re_set_lib::utils::plugin::{PluginCapabilities, PluginImplementation, PluginTestFunc, SidebarInfo};
pub const BASE: &str = "org.Xetibo.ReSet.Daemon"; pub const BASE: &str = "org.Xetibo.ReSet.Daemon";
pub const DBUS_PATH: &str = "/org/Xetibo/ReSet/Plugins/test"; pub const DBUS_PATH: &str = "/org/Xebito/ReSet/Plugins/test";
pub const INTERFACE: &str = "org.Xetibo.ReSet.TestPlugin"; pub const INTERFACE: &str = "org.Xetibo.ReSet.TestPlugin";
#[no_mangle] #[no_mangle]