Giter VIP home page Giter VIP logo

netctl-tray's Introduction

netctl-tray

A lightweight netctl tray app with notifications written in Rust.

Note: This repository has been archived, since I personally no longer use netctl and can't furtherly develop or fix bugs of this project. If anyone wants to take over, feel free to make an issue.

Screenshots

Usage

To launch the tray app:

$ netctl-tray

You have to be in groups wheel and network for it to work properly.
To add an user to them, use:

# usermod -a -G wheel,network <user>

Compiling

This application needs to be compiled for netctl and netctl-auto separately. For netctl:

cargo build --release

For netctl-auto:

cargo build --release --features "auto"

Installation

This app is available on the AUR: netctl-tray and netctl-tray-auto

Contributing

All contributions are welcome!

netctl-tray's People

Contributors

maxzinkus avatar ponaskovas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

netctl-tray's Issues

io error: Operation not permitted (os error 1)

I get the following error (both with the aur package and with RUST_BACKTRACE=1 cargo +nightly run:

io error: Operation not permitted (os error 1) }
Error { inner: stack backtrace:
   0: failure::backtrace::internal::InternalBacktrace::new
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.8/src/backtrace/internal.rs:46
   1: failure::backtrace::Backtrace::new
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.8/src/backtrace/mod.rs:121
   2: failure::context::Context<D>::new
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/failure-0.1.8/src/context.rs:84
   3: <ping::errors::Error as core::convert::From<std::io::error::Error>>::from
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/ping-0.2.0/src/errors.rs:41
   4: ping::ping::ping
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/ping-0.2.0/src/ping.rs:35
   5: netctl_tray::state::update_state
             at src/state.rs:180
   6: netctl_tray::main::{{closure}}::{{closure}}
             at src/main.rs:191
   7: <alloc::boxed::Box<F> as core::ops::function::FnMut<A>>::call_mut
             at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1049
   8: qt_core::Slot::set::callback
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/qt_core-0.3.0/src/lib.rs:185513
   9: _ZN29ctr_qt_core_ffi_slot_wrapper_11custom_slotEv
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/qt_core-0.3.0/c_lib/file1.cpp:368
  10: _ZN29ctr_qt_core_ffi_slot_wrapper_18qt_static_metacallEP7QObjectN11QMetaObject4CallEiPPv
             at target/debug/build/qt_core-933c6b103b2b6f3c/out/c_lib_build/qt_core_c_autogen/include/file1.moc:1648
  11: <unknown>
  12: _ZN6QTimer7timeoutENS_14QPrivateSignalE
  13: _ZN7QObject5eventEP6QEvent
  14: _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent
  15: _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent
  16: _ZN14QTimerInfoList14activateTimersEv
  17: <unknown>
  18: g_main_context_dispatch
  19: <unknown>
  20: g_main_context_iteration
  21: _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE
  22: _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE
  23: _ZN16QCoreApplication4execEv
  24: ctr_qt_widgets_ffi_QApplication_exec
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/qt_widgets-0.3.0/c_lib/file1.cpp:8395
  25: qt_widgets::QApplication::exec
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/qt_widgets-0.3.0/src/lib.rs:31133
  26: netctl_tray::main::{{closure}}
             at src/main.rs:209
  27: qt_widgets::impl_q_application::<impl qt_widgets::QApplication>::init
             at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/qt_widgets-0.3.0/src/impl_q_application.rs:33
  28: netctl_tray::main
             at src/main.rs:80
  29: core::ops::function::FnOnce::call_once
             at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
  30: std::sys_common::backtrace::__rust_begin_short_backtrace
             at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:137
  31: std::rt::lang_start::{{closure}}
             at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:66
  32: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
             at /rustc/e2be5f568d1f60365b825530f5b5cb722460591b/library/core/src/ops/function.rs:259
      std::panicking::try::do_call
             at library/std/src/panicking.rs:381
      std::panicking::try
             at library/std/src/panicking.rs:345
      std::panic::catch_unwind
             at library/std/src/panic.rs:382
      std::rt::lang_start_internal
             at library/std/src/rt.rs:51
  33: std::rt::lang_start
             at ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs:65
  34: main
  35: __libc_start_main
  36: _start

iwconfig is a hidden (and depreacated?) dependency

Hi,

I've just stumbled your package, decided to try it, but it failed when I launched it :

> netctl-tray
thread 'main' panicked at 'failed to run iwconfig: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/main.rs:280:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Because I don't have iwconfig. A quick search in the Arch Wiki led me to https://wiki.archlinux.org/index.php/Network_configuration/Wireless#iw_and_wireless_tools_comparison, where the first line states that iw replaces iwconfig. I'm sure of the status of iw/iwconfig, but maybe I know I have iw installed on my machine and not iwconfig.

Not sure of the solution: should you try both before failing? Use iwconfig instead?

Happy to help review as much as I can.

Btw, I'm using Arch and netcl, up-to-date of course.

tray on gnome?

when using it on gnome it says:

$ netctl-tray 
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QObject::connect: No such signal QPlatformNativeInterface::systemTrayWindowChanged(QScreen*)

QT_QPA_PLATFORM is set. and no tray icon appears. i saw https://bugreports.qt.io/browse/QTBUG-31762 though which suggests that there was a bug long time ago, but should be fixed nowadays.

PermissionDenied, message: "Permission denied" solved

getting a repeating error message.

Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }
Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

I am part of the network group and wheel

Version: 0.2.1

in /etc/sudoers

%wheel ALL=(ALL) ALL

uncommitted I don't know if that matters. I type in the sudo password every time.

Ping doesn't work with a VPN

I use mullvad as my VPN. If it is connected (which it always is), the icon shows a little exclamation mark and clicking on the icon shows an infinite ping.

If I disconnect the VPN then the icon loses the exclamation mark, the ping works properly, etc..

VPN connected:
icon when vpn is connected

VPN disconnected:
icon when vpn is disconnected

Support netctl-auto

Hi! Thank you for developing this, especially seeing as all of the gnome extension packages which try to add system trays for netctl are outdated and broken.

I wanted to request support for netctl-auto. As it is, netctl list doesn't list any active profiles when netctl-auto is managing things. sudo netctl-auto list will, but it requires root for some reason probably specific to netctl.

I'm working on a PR, but if you're willing to do it, that'd be better. Thanks!

AUR package building fails

Hello, I tried to install this program from AUR and got errors during build:

   Compiling netctl-tray v0.2.0 (/home/user/.cache/yay/netctl-tray/src/netctl-tray-0.2.0)
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:1:1
  |
1 | #![feature(vec_remove_item)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> src/main.rs:2:1
  |
2 | #![feature(exclusive_range_pattern)]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0554`.
error: could not compile `netctl-tray`.

To learn more, run the command again with --verbose.
==> ERROR: A failure occurred in build().
    Aborting...
error making: %!s(func() string=0x564ec44c7880)

How do I build this?

Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

Greetings PonasKovas,
I am trying to use your netctl-tray (installed via aur (netctl-tray-auto for netctl-auto) on archlinux (i3wm, with netctl-auto, 5.12.2-arch1-1)). But I am not able to resolve the error:

Can't update tray state: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }

Therefore the tray icon can't request or update the state and is just running showing some default state. It is however able to show the ESSID of the network I am connected to when I click on it.
Of course I am in the groups wheel and network. (Just double checked just in case)

Could you be so kind and look into this issue and maybe come up with some proposal on how to solve it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.