Make UI default, and remove CLI version (#83)

This commit is contained in:
Philip Kristoffersen
2022-04-15 13:54:01 +02:00
committed by GitHub
parent fcc3a4abc3
commit aa05de9865
7 changed files with 40 additions and 100 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ jobs:
- name: dependencies - name: dependencies
run: | run: |
sudo apt-get update sudo apt-get update
sudo apt-get install -y libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libpango1.0-dev libpng-dev libgl1-mesa-dev libglu1-mesa-dev sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
- name: Test - name: Test
run: | run: |
cargo test cargo test
+10 -45
View File
@@ -3,7 +3,7 @@ name: Create Release Builds
on: on:
push: push:
tags: tags:
- "v*" # matches v1.0.1, v1.2, v2, etc - "v.*.*.*" # matches v.1.0.1 etc
jobs: jobs:
once: once:
@@ -35,73 +35,38 @@ jobs:
asset_name: linux_BoilR asset_name: linux_BoilR
args: --best --lzma args: --best --lzma
strip: true strip: true
ui: false
- os: ubuntu-latest
file: target/release/boilr
asset_name: linux_ui_BoilR
args: --best --lzma
strip: true
ui: true
- os: windows-latest - os: windows-latest
file: target/release/boilr.exe file: target/release/boilr.exe
asset_name: windows_BoilR.exe asset_name: windows_BoilR.exe
args: -9 args: -9
strip: false strip: false
ui: false
- os: windows-latest
file: target/release/boilr.exe
asset_name: windows_ui_BoilR.exe
args: -9
strip: false
ui: true
- os: macos-latest - os: macos-latest
file: target/release/boilr file: target/release/boilr
asset_name: macos_x86_64_BoilR asset_name: macos_x86_64_BoilR
args: -9 args: -9
strip: false strip: false
ui: false
- os: macos-latest - os: macos-latest
file: target/aarch64-apple-darwin/release/boilr file: target/aarch64-apple-darwin/release/boilr
asset_name: macos_darwin_BoilR asset_name: macos_darwin_BoilR
args: -9 args: -9
strip: false strip: false
ui: false
target: aarch64-apple-darwin
- os: macos-latest
file: target/release/boilr
asset_name: macos_x86_64_ui_BoilR
args: -9
strip: false
ui: true
- os: macos-latest
file: target/aarch64-apple-darwin/release/boilr
asset_name: macos_darwin_ui_BoilR
args: -9
strip: false
ui: true
target: aarch64-apple-darwin target: aarch64-apple-darwin
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: Install dependencies
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
sudo apt-get update
sudo apt-get install -y libclang-dev libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
- name: Rust Cache - name: Rust Cache
id: rust_cache id: rust_cache
uses: Swatinem/rust-cache@v1.3.0 uses: Swatinem/rust-cache@v1.3.0
- name: Install dependencies - name: Build Release Version
if: ${{ matrix.os == 'ubuntu-latest' && matrix.ui}} if: ${{ matrix.target != 'aarch64-apple-darwin' }}
run: |
sudo apt-get update
sudo apt-get install -y libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-dev libssl-dev
- name: Build Release Version UI
if: ${{ matrix.target != 'aarch64-apple-darwin' && matrix.ui == true}}
run: cargo build --release --features ui
- name: Build Release Version CLI
if: ${{ matrix.target != 'aarch64-apple-darwin' && matrix.ui == false}}
run: cargo build --release run: cargo build --release
- name: Build aarch64 Release Version CLI - name: Build aarch64 Release Version
if: ${{matrix.target == 'aarch64-apple-darwin' && matrix.ui == false}} if: ${{matrix.target == 'aarch64-apple-darwin' }}
run: rustup target add aarch64-apple-darwin && cargo build --release --target aarch64-apple-darwin run: rustup target add aarch64-apple-darwin && cargo build --release --target aarch64-apple-darwin
- name: Build aarch64 Release Version UI
if: ${{matrix.target == 'aarch64-apple-darwin' && matrix.ui == true}}
run: rustup target add aarch64-apple-darwin && cargo build --release --target aarch64-apple-darwin --features ui
- name: Compress binaries - name: Compress binaries
uses: svenstaro/upx-action@v2 uses: svenstaro/upx-action@v2
with: with:
+4 -9
View File
@@ -20,16 +20,11 @@ dashmap = { version = "^5.2.0", features = ["serde"] }
is_executable = "^1.0.1" is_executable = "^1.0.1"
rusty-leveldb = "^0.3.6" rusty-leveldb = "^0.3.6"
base64 = "^0.13.0" base64 = "^0.13.0"
eframe = { version = "0.17.0", optional = true } eframe = { version = "0.17.0" }
egui = { version = "0.17.0", optional = true } egui = { version = "0.17.0" }
image = { version = "0.24.1", optional = true, features = ["png"] } image = { version = "0.24.1", features = ["png"] }
toml = { version = "^0.5.8", optional = true } toml = { version = "^0.5.8" }
sysinfo = "0.23.10" sysinfo = "0.23.10"
[features]
#default = ["ui"]
ui = ["eframe", "egui","toml","image"]
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
winreg = "0.10.1" winreg = "0.10.1"
+21 -4
View File
@@ -39,7 +39,7 @@ Optionally you can set BoilR up to automatically download artwork from [SteamGri
- Download the latest release from the [releases page](https://github.com/PhilipK/BoilR/releases). - Download the latest release from the [releases page](https://github.com/PhilipK/BoilR/releases).
- Run the executable. - Run the executable.
- Click Synchronize. - Click Import Games.
- Restart Steam to see your new shortcuts. - Restart Steam to see your new shortcuts.
@@ -50,21 +50,29 @@ Optionally you can set BoilR up to automatically download artwork from [SteamGri
- Click Syncrhonize - Click Syncrhonize
## Tips for steam deck ## Tips
### Tips for steam deck
I currently don't have a steam deck, which slows down development for it a bit. I currently don't have a steam deck, which slows down development for it a bit.
There might still be problems specific to the deck, so if you run into one please check the issues. There might still be problems specific to the deck, so if you run into one please check the issues.
If you have a problem that a game wont launch, try to manually set a proton version for it. If you have a problem that a game wont launch, try to manually set a proton version for it.
## Tips for linux ### Tips for linux
If you are running linux (this includes Steam Dekc) and are running into problems check [tips for linux seciton](tips_for_linux.md) If you are running linux (this includes Steam Dekc) and are running into problems check [tips for linux seciton](tips_for_linux.md)
## Configuration ### Configuration
Most people will not have to configure anything, just open BoilR and click Synchronize, but it is possible to configure a lot, see the [configuration section](configuration.md) Most people will not have to configure anything, just open BoilR and click Synchronize, but it is possible to configure a lot, see the [configuration section](configuration.md)
### Run as CLI
In previous releases there was both a CLI and UI version of BoilR, now there is only a UI version.
But you can add the commandling argument ``--no-ui`` and then the UI version will act like the old CLI version.
This saves some CO2 from not having to build 2 versions of BoilR for each platform, and it also makes development easier.
## What is up with the name BoilR? ## What is up with the name BoilR?
@@ -80,10 +88,19 @@ Check out the [discussions](https://github.com/PhilipK/BoilR/discussions) and fe
## How can I help/contribute? ## How can I help/contribute?
If you are a coder, you can fork this repo and then create a pull request, they are very welcome! If you are a coder, you can fork this repo and then create a pull request, they are very welcome!
To run BoilR just write:
```shell
cargo run
```
If you are not a developer (or you don't like to code in Rust) spread the work and create issues/discussions for anything. If you are not a developer (or you don't like to code in Rust) spread the work and create issues/discussions for anything.
## Can I donate to support BoilR? ## Can I donate to support BoilR?
Nope, please don't, donate it to your favorite charity instead, and if you don't have one of those may I suggest something like [GiveWell](https://www.givewell.org/). Nope, please don't, donate it to your favorite charity instead, and if you don't have one of those may I suggest something like [GiveWell](https://www.givewell.org/).
## License ## License
This project is dual license MIT or Apache 2.0 , it is up to you. In short, you can do what you want with this project, but if in doubt read the license files. This project is dual license MIT or Apache 2.0 , it is up to you. In short, you can do what you want with this project, but if in doubt read the license files.
-23
View File
@@ -11,38 +11,15 @@ mod steam;
mod steamgriddb; mod steamgriddb;
mod sync; mod sync;
mod uplay; mod uplay;
#[cfg(feature = "ui")]
mod ui; mod ui;
use std::error::Error; use std::error::Error;
#[cfg(not(feature = "ui"))]
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let settings = settings::Settings::new()?;
if settings.steam.stop_steam{
crate::steam::ensure_steam_stopped();
}
settings::Settings::write_config_if_missing();
let usersinfo = sync::run_sync(&settings,&mut None).unwrap();
sync::download_images(&settings,&usersinfo,&mut None).await;
if settings.steam.start_steam{
crate::steam::ensure_steam_started(&settings.steam);
}
Ok(())
}
#[cfg(feature = "ui")]
fn main() -> Result<(), Box<dyn Error>> { fn main() -> Result<(), Box<dyn Error>> {
let mut args = std::env::args(); let mut args = std::env::args();
if args.len() > 1 && args.nth(1).unwrap_or_default() == "--no-ui" { if args.len() > 1 && args.nth(1).unwrap_or_default() == "--no-ui" {
ui::run_sync(); ui::run_sync();
Ok(()) Ok(())
}else{ }else{
ui::run_ui() ui::run_ui()
} }
} }
-14
View File
@@ -54,20 +54,6 @@ impl Settings {
result result
} }
pub fn write_config_if_missing() {
let config_path = std::path::Path::new("config.toml");
if !config_path.exists() {
let worked = std::fs::write(config_path, include_str!("defaultconfig.toml"));
match worked {
Ok(_) => println!("Create configuration file at {:?}", &config_path),
Err(err) => println!(
"Could not create configuration file at {:?}, reason: {:?}",
&config_path, err
),
}
}
}
} }
fn sanitize_auth_key(result: &mut Result<Settings, ConfigError>) { fn sanitize_auth_key(result: &mut Result<Settings, ConfigError>) {
+2 -2
View File
@@ -41,7 +41,7 @@ impl MyEguiApp {
} }
} }
pub fn run_sync(&mut self) { pub fn run_sync(&mut self) {
let (sender,mut reciever ) = watch::channel(SyncProgress::NotStarted); let (sender,reciever ) = watch::channel(SyncProgress::NotStarted);
let settings = self.settings.clone(); let settings = self.settings.clone();
if settings.steam.stop_steam{ if settings.steam.stop_steam{
crate::steam::ensure_steam_stopped(); crate::steam::ensure_steam_stopped();
@@ -376,7 +376,7 @@ pub fn run_ui() -> Result<(), Box<dyn Error>> {
let mut native_options = eframe::NativeOptions::default(); let mut native_options = eframe::NativeOptions::default();
native_options.initial_window_size = Some(egui::Vec2{ native_options.initial_window_size = Some(egui::Vec2{
x:500., x:800.,
y:500. y:500.
}); });
native_options.icon_data = Some(get_logo_icon()); native_options.icon_data = Some(get_logo_icon());