Add VPN module.

This commit is contained in:
Eduard Tolosa 2019-10-27 03:22:37 -05:00
parent c9542b0dce
commit d0632fd562
41 changed files with 56 additions and 0 deletions

6
Cargo.lock generated Normal file
View file

@ -0,0 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "waybar-rust-modules"
version = "0.1.0"

13
Cargo.toml Normal file
View file

@ -0,0 +1,13 @@
[package]
name = "waybar-rust-modules"
version = "0.1.0"
authors = ["Eduard Tolosa <edu4rdshl@protonmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "waybar_vpn"
src = "src/bin/waybar_vpn.rs"
[dependencies]

9
src/bin/waybar_vpn.rs Normal file
View file

@ -0,0 +1,9 @@
use std::path::Path;
fn main() {
if Path::new("/proc/sys/net/ipv4/conf/tun0").exists() {
println!("{{\"text\": \" ON\"}}");
} else {
println!("{{\"text\": \" OFF\", \"class\": \"down\"}}");
}
}

1
target/.rustc_info.json Normal file
View file

@ -0,0 +1 @@
{"rustc_fingerprint":16361012863914107182,"outputs":{"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/sechacklabs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""],"1164083562126845933":["rustc 1.37.0 (eae3437df 2019-08-13)\nbinary: rustc\ncommit-hash: eae3437dfe991621e8afdc82734f4a172d7ddf9b\ncommit-date: 2019-08-13\nhost: x86_64-unknown-linux-gnu\nrelease: 1.37.0\nLLVM version: 8.0\n",""],"2196823701345282402":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/sechacklabs/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n",""]},"successes":{}}

0
target/debug/.cargo-lock Normal file
View file

View file

@ -0,0 +1 @@
{"rustc":15611408172799703797,"features":"[]","target":5292255576470338685,"profile":14996655781355331481,"path":14354059685716671544,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint/waybar-rust-modules-17daf4084cd21a8b/dep-bin-waybar_vpn-17daf4084cd21a8b"}}],"rustflags":[],"metadata":5648991159062139020}

View file

@ -0,0 +1 @@
This file has an mtime of when this was started.

Binary file not shown.

View file

@ -0,0 +1,5 @@
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/debug/deps/waybar_vpn-17daf4084cd21a8b: src/bin/waybar_vpn.rs
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/debug/deps/waybar_vpn-17daf4084cd21a8b.d: src/bin/waybar_vpn.rs
src/bin/waybar_vpn.rs:

BIN
target/debug/waybar_vpn Executable file

Binary file not shown.

View file

@ -0,0 +1 @@
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/debug/waybar_vpn: /home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/src/bin/waybar_vpn.rs

View file

View file

@ -0,0 +1 @@
{"rustc":15611408172799703797,"features":"[]","target":11799719445219010114,"profile":2574335274271406459,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint/waybar-rust-modules-07a12dde15091900/dep-bin-waybar_rust_modules-07a12dde15091900"}}],"rustflags":[],"metadata":5648991159062139020}

View file

@ -0,0 +1 @@
This file has an mtime of when this was started.

View file

@ -0,0 +1 @@
{"rustc":15611408172799703797,"features":"[]","target":5292255576470338685,"profile":2574335274271406459,"path":14354059685716671544,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint/waybar-rust-modules-8bf3532a5b02e814/dep-bin-waybar_vpn-8bf3532a5b02e814"}}],"rustflags":[],"metadata":5648991159062139020}

View file

@ -0,0 +1 @@
This file has an mtime of when this was started.

Binary file not shown.

View file

@ -0,0 +1,5 @@
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/release/deps/waybar_rust_modules-07a12dde15091900: src/main.rs
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/release/deps/waybar_rust_modules-07a12dde15091900.d: src/main.rs
src/main.rs:

Binary file not shown.

View file

@ -0,0 +1,5 @@
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/release/deps/waybar_vpn-8bf3532a5b02e814: src/bin/waybar_vpn.rs
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/release/deps/waybar_vpn-8bf3532a5b02e814.d: src/bin/waybar_vpn.rs
src/bin/waybar_vpn.rs:

Binary file not shown.

View file

@ -0,0 +1 @@
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/release/waybar-rust-modules: /home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/src/main.rs

BIN
target/release/waybar_vpn Executable file

Binary file not shown.

View file

@ -0,0 +1 @@
/home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/target/release/waybar_vpn: /home/sechacklabs/Projects/Rust/Development/waybar-rust-modules/src/bin/waybar_vpn.rs