Coder Social home page Coder Social logo

emacs-nm's Introduction

Gnome Network Manager

My laptop started misbehaving, or Gnome Network Manager's graphical user interface did.

I resorted to nmcli, the Network Manager command line tool. It's a bit baroque.

So here is a simple little Emacs Lisp interface to nmcli.

Installing

It's in marmalade - add marmalade as a package repository and then do:

M-x package-install [RET] gnomenm [RET]

Commands

Here are the useful commands:

gnomenm-connect ap

Connect to a specific ap.

gnomenm-disconnect

Disconnect from the current Access Point.

gnomenm-flip

Flip the AP to the last but one connected to.

If you don't have two APs in the history it does nothing.

This is really useful if you switch between a pair of APs like I do. I recommend using a keychord like:

 (key-chord-define-global "90"  'gnomenm-flip)

See http://www.emacswiki.org/KeyChord for details on KeyChord.

gnomenm-status

What's the network status?

gnomenm-toggle-enabled &optional status

Toggle whether networking is enabled or not.

emacs-nm's People

Contributors

nicferrier avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

emacs-nm's Issues

Dependency issue, undefined functions, and old nmcli interface

Hi,

There's a package dependency issue in that it doesn't include "s" as a dependency when installing.

Also, for love nor money, I can not find the either ->> or -keep in any elisp packages. What do I need to require for these functions to work? This is a bit of a show stopper for me.

I've been busy patching up the code to work with the latest version of nmcli which has different commands. How best might we support the different versions?

Cheers,

Matt.

nmcli changed its interface

Hi nic. it seems that nmcli changed its interface : the "nm" object vanished and some other options seem to have changed. I guess the more reliable way is to use dbus, which is what @tromey does at https://github.com/tromey/emacs-network-manager

as an example I wrote a dbus version of your (gnomenm/connected) function. (I'm not 100% sure I'm doing it right,but I guess it's not too far)

(require 'NetworkManager)
(defun gnomenm-dbus//get-prop (property &optional path interface)
  (dbus-get-property NetworkManager-bus
                     NetworkManager-service
                     (or path NetworkManager-path)
                     (or interface NetworkManager-interface)
                     property))
(defun gnomenm-dbus//PrimaryConnection ()
  (gnomenm-dbus//get-prop "PrimaryConnection"))

(defun gnomenm-dbus/connected ()
  "What AP are we currently connected to?"
  (and
   (NetworkManager-connected-p)
   (equal (gnomenm-dbus//get-prop "PrimaryConnectionType")
          "802-11-wireless")
   (gnomenm-dbus//get-prop
    "Id"
    (gnomenm-dbus//PrimaryConnection)
    "org.freedesktop.NetworkManager.Connection.Active")))

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.