Skip to content

Commit

Permalink
feat: add kde support for linux (#1)
Browse files Browse the repository at this point in the history
Co-authored-by: GyDi <zzzgydi@gmail.com>
  • Loading branch information
SafeSmallPace and zzzgydi authored Apr 16, 2024
1 parent 31f96dd commit ac61f59
Show file tree
Hide file tree
Showing 4 changed files with 267 additions and 79 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ log = "0.4"
thiserror = "1"
iptools = { version = "0.2.4", optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
xdg = "^2.5"

[target.'cfg(target_os = "macos")'.dependencies]
interfaces = "0.0.8"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# sysproxy-rs

A library for set/get system proxy. Supports Windows, macOS and linux (via gsettings).
A library for set/get system proxy. Supports Windows, macOS and linux (via gsettings/kconfig).
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ pub enum Error {
#[error("failed to get default network interface")]
NetworkInterface,

#[error("failed to set proxy for this environment")]
NotSupport,

#[cfg(target_os = "linux")]
#[error(transparent)]
Xdg(#[from] xdg::BaseDirectoriesError),

#[cfg(target_os = "windows")]
#[error("system call failed")]
SystemCall(#[from] windows::Win32Error),
Expand Down
Loading

0 comments on commit ac61f59

Please sign in to comment.