Giter Club home page Giter Club logo

net_widgets's Introduction

Network Widgets

If you use netctl or another network manager which doesn't provide any good tray icon or if you want something more native than nm-applet, this is for you.

network widgets total

How to use

First of all you should clone repository in your awesome config directory

git clone [email protected]:pltanton/net_widgets.git ~/.config/awesome/net_widgets

Then, paste this in your 'rc.lua'

local net_widgets = require("net_widgets")

Requires installing the Arc Icon set https://github.com/horst3180/arc-icon-theme

Wireless widget.

wireless widget Widget is simple as hell. Icon changes depend on signal level, if you put mouse pointer on it you can see some information about current connection.

Create widget by

net_wireless = net_widgets.wireless({interface="wlp1s0"})

After that just place net_wireless wherever you want. You can also change widget update timeout. By default it is timeout=5, interface=wlan0

Wired network indicator.

wired widget If network is disconnected icon changes color to red. You can set multiple interfaces to indicate it. It also have got popup.

To create widget put in rc.lua

net_wired = net_widgets.indicator({
    interfaces  = {"enp2s0", "another_interface", "and_another_one"},
    timeout     = 5
})

By default interfaces={"enp2s0"}, timeout=5

Internet access indicator.

internet widget This indicator shows up when there is no internet access (detected by trying to connect to 8.8.8.8). Set showconnected to true if you're extra precautionary about your internet connection and don't mind seeing a green check mark almost all the time.

net_internet = net_widgets.internet({indent = 0, timeout = 5})

Tips

Table looks bad

You can change font to monospace by font option.

Display the signal strength in the popup instead of next to icon

strenght in popup

Set popup_signal=true.

Set action on click

Just set onclick argument, for example

net_wireless = net_widgets.wireless({interface   = "wlp3s0",
                                     onclick     = terminal .. " -e sudo wifi-menu" })

Get table of wireless widgets or set container widget

Just set widget argument as false to get table or some widget layout to change default layout, for example

net_wireless = net_widgets.wireless({interface   = "wlp3s0",
                                     widget = false, })

or

net_wireless = net_widgets.wireless({interface   = "wlp3s0",
                                     widget = wibox.layout.fixed.vertical(), })

By default widget = wibox.layout.fixed.horizontal()

Set indent in wireless textbox

Just set indent

net_wireless = net_widgets.wireless({interface   = "wlp3s0",
                                     indent = 0, })

or

net_wireless = net_widgets.wireless({interface   = "wlp3s0",
                                     indent = 5, })

By default indent = 3

Set the pop-up position

Helpful if the widget is placed on the bottom bar and you want the pop-up to appear near the widget rather than on top of the screen.

net_wireless = net_widgets.wireless({interface   = "wlp3s0",
                                     popup_position = "bottom_right" })

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.