Skip to content

Commit

Permalink
Merge pull request #10 from 0323pin/main
Browse files Browse the repository at this point in the history
fix: add NetBSD support
  • Loading branch information
InioX authored Aug 6, 2023
2 parents 64df701 + e844062 commit 00f43cd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ Matugen is a cross-platform tool that generates a colorscheme either from an ima
- Windows
- Linux
- MacOS
>**Warning** Matugen only supports setting the wallpaper and restarting apps on Linux for now.
- NetBSD
>**Warning** Matugen only supports setting the wallpaper and restarting apps on Linux and NetBSD for now.
## Roadmap

Expand Down Expand Up @@ -84,6 +85,16 @@ in {
}
```

### NetBSD
```shell
pkgin install matugen
```
or, if you prefer to build it from source
```shell
cd /usr/pkgsrc/graphics/matugen
make install
```

## Usage

>**Note** For some reason the output of the colors is a bit weird in the gifs, here is how the output actually looks:
Expand Down
2 changes: 1 addition & 1 deletion src/util/reload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::{arguments::Cli, config::ConfigFile};
use color_eyre::{eyre::Result, Report};
use std::process::Command;

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
pub fn reload_apps_linux(args: &Cli, config: &ConfigFile) -> Result<(), Report> {
reload_app("kitty", "SIGUSR1")?;
reload_app("waybar", "SIGUSR2")?;
Expand Down
10 changes: 5 additions & 5 deletions src/util/wallpaper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{
reload::reload_app,
};

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
pub fn set_wallaper(config: &ConfigFile, args: &Cli) -> Result<(), Report> {
let wallpaper_tool = match &config.config.wallpaper_tool {
Some(wallpaper_tool) => wallpaper_tool,
Expand All @@ -32,7 +32,7 @@ pub fn set_wallaper(config: &ConfigFile, args: &Cli) -> Result<(), Report> {
}
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
fn set_wallaper_swaybg(path: &String) -> Result<(), Report> {
reload_app("swaybg", "SIGUSR1")?;

Expand All @@ -45,7 +45,7 @@ fn set_wallaper_swaybg(path: &String) -> Result<(), Report> {
Ok(())
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
fn set_wallaper_swwww(config: &ConfigFile, path: &String) -> Result<(), Report> {
let mut binding = Command::new("swww");
let cmd = binding.stdout(Stdio::null()).stderr(Stdio::null());
Expand All @@ -62,7 +62,7 @@ fn set_wallaper_swwww(config: &ConfigFile, path: &String) -> Result<(), Report>
Ok(())
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
fn set_wallaper_nitrogen(path: &String) -> Result<(), Report> {
let mut binding = Command::new("nitrogen");
let cmd = binding.stdout(Stdio::null()).stderr(Stdio::null());
Expand All @@ -72,7 +72,7 @@ fn set_wallaper_nitrogen(path: &String) -> Result<(), Report> {
Ok(())
}

#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
fn set_wallaper_feh(config: &ConfigFile, path: &String) -> Result<(), Report> {
let mut binding = Command::new("feh");
let cmd = binding.stdout(Stdio::null()).stderr(Stdio::null());
Expand Down

0 comments on commit 00f43cd

Please sign in to comment.