Giter Club home page Giter Club logo

connmap's Introduction

connmap

connmap is an X11 desktop widget that shows location of your current network peers on a world map. (Works on Wayland as well!)

Demo

Installation

Clone the repository git clone https://github.com/jafarlihi/connmap --depth 1, install the dependencies (see below), run make install, then run the resulting executable ./connmap.elf.

If you want to run it without attaching it to the terminal then add ampersand at the end of the command: ./connmal.elf &.

You can also add it to your i3wm config to run at startup (make sure it is in the PATH):

exec --no-startup-id connmap.elf

Dependencies

Build dependencies: xlib, libxext, libxfixes, libcairo2

Installation dependencies: unzip

Runtime dependencies: iproute2

Installation for Arch Linux:

sudo pacman -S --needed iproute2 libx11 libxext libxfixes cairo unzip

Installation for Ubuntu:

sudo apt install iproute2 libx11-dev libxext-dev libxfixes-dev libcairo2-dev unzip

Config

Installation will create ~/.config/connmap/connmaprc. Default connmaprc looks like this:

location_x 20
location_y 500
small true
black false
update_interval 1
  • location_x/location_y specifies the widget location in your desktop.

  • Setting small to false will resize widget from 500px/250px to 1000px/500px.

  • Setting black to true will draw map outline in black instead of white.

  • update_interval is seconds the application will sleep for before fetching the updated list of network connections.

Limitations

  • Tested only with i3wm, might not work as expected in other DE/WM.

  • Only IPv4 is supported.

connmap's People

Contributors

10maurycy10 avatar jafarlihi avatar jbalintbiro 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connmap's Issues

Anyway to replace red dot with program icon?

I suspect not all binaries come with an icon, or really no binary ever comes with an icon , an icon is probably associated with desktop entries but wonder if you can bypass this by assigning some icons to standard programs?

build error on debian

after installing libcairo-dev and libx11-dev

~/src/connmap $ make install
mkdir -p ./build
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 ./build/geo.o ./build/ss.o ./build/cairo.o ./build/x11.o ./build/main.o ./build/ip.o ./build/config.o -o connmap.exe
/usr/bin/ld: ./build/cairo.o: in function `draw_invisible_point':
cairo.c:(.text+0x14): undefined reference to `cairo_create'
/usr/bin/ld: cairo.c:(.text+0x3c): undefined reference to `cairo_set_source_rgba'
/usr/bin/ld: cairo.c:(.text+0x54): undefined reference to `cairo_set_line_width'
/usr/bin/ld: cairo.c:(.text+0x84): undefined reference to `cairo_arc'
/usr/bin/ld: cairo.c:(.text+0x90): undefined reference to `cairo_fill'
/usr/bin/ld: cairo.c:(.text+0x9c): undefined reference to `cairo_destroy'
/usr/bin/ld: ./build/cairo.o: in function `draw_world':
cairo.c:(.text+0xbb): undefined reference to `cairo_create'
/usr/bin/ld: cairo.c:(.text+0xcb): undefined reference to `cairo_image_surface_create_from_png'
/usr/bin/ld: cairo.c:(.text+0xea): undefined reference to `cairo_set_source_surface'
/usr/bin/ld: cairo.c:(.text+0xf6): undefined reference to `cairo_paint'
/usr/bin/ld: cairo.c:(.text+0x102): undefined reference to `cairo_destroy'
/usr/bin/ld: ./build/cairo.o: in function `draw_point':
cairo.c:(.text+0x134): undefined reference to `cairo_create'
/usr/bin/ld: cairo.c:(.text+0x174): undefined reference to `cairo_set_source_rgba'
/usr/bin/ld: cairo.c:(.text+0x18c): undefined reference to `cairo_set_line_width'
/usr/bin/ld: cairo.c:(.text+0x1d6): undefined reference to `cairo_arc'
/usr/bin/ld: cairo.c:(.text+0x206): undefined reference to `cairo_arc'
/usr/bin/ld: cairo.c:(.text+0x212): undefined reference to `cairo_fill'
/usr/bin/ld: cairo.c:(.text+0x21e): undefined reference to `cairo_destroy'
/usr/bin/ld: ./build/cairo.o: in function `clear_surface':
cairo.c:(.text+0x239): undefined reference to `cairo_create'
/usr/bin/ld: cairo.c:(.text+0x259): undefined reference to `cairo_set_source_rgba'
/usr/bin/ld: cairo.c:(.text+0x26a): undefined reference to `cairo_set_operator'
/usr/bin/ld: cairo.c:(.text+0x276): undefined reference to `cairo_paint'
/usr/bin/ld: cairo.c:(.text+0x282): undefined reference to `cairo_destroy'
/usr/bin/ld: ./build/x11.o: in function `initX11':
x11.c:(.text+0x2d): undefined reference to `XOpenDisplay'
/usr/bin/ld: x11.c:(.text+0xb2): undefined reference to `XCreateColormap'
/usr/bin/ld: x11.c:(.text+0x16b): undefined reference to `XCreateWindow'
/usr/bin/ld: x11.c:(.text+0x186): undefined reference to `XLowerWindow'
/usr/bin/ld: x11.c:(.text+0x199): undefined reference to `XMapWindow'
/usr/bin/ld: ./build/main.o: in function `main':
main.c:(.text+0x190): undefined reference to `cairo_xlib_surface_create'
/usr/bin/ld: main.c:(.text+0x1a8): undefined reference to `cairo_xlib_surface_set_size'
collect2: error: ld returned 1 exit status
make: *** [Makefile:28: build] Error 1

Can't make on Pop!_os

I probable need some dependencies but I can't figure out which one.

System info:
OS: Pop!_OS 19.10 x86_64
Kernel: 5.3.0-7642-generic

I already installed:
libghc-diagrams-cairo-dev
libx11-dev

Error:
`% make install

mkdir -p ./build
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/ss.c -o build/ss.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/x11.c -o build/x11.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/cairo.c -o build/cairo.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/config.c -o build/config.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/geo.c -o build/geo.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/main.c -o build/main.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 -c sources/ip.c -o build/ip.o
gcc -std=gnu11 -I./includes -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -lcairo -lX11 -O0 ./build/ss.o ./build/x11.o ./build/cairo.o ./build/config.o ./build/geo.o ./build/main.o ./build/ip.o -o connmap.exe
/usr/bin/ld: ./build/x11.o: in function initX11': x11.c:(.text+0x40): undefined reference to XOpenDisplay'
/usr/bin/ld: x11.c:(.text+0xe6): undefined reference to XCreateColormap' /usr/bin/ld: x11.c:(.text+0x1ba): undefined reference to XCreateWindow'
/usr/bin/ld: x11.c:(.text+0x1de): undefined reference to XLowerWindow' /usr/bin/ld: x11.c:(.text+0x1f7): undefined reference to XMapWindow'
/usr/bin/ld: ./build/cairo.o: in function cairo_close_x11_surface': cairo.c:(.text+0x18): undefined reference to cairo_xlib_surface_get_display'
/usr/bin/ld: cairo.c:(.text+0x28): undefined reference to cairo_surface_destroy' /usr/bin/ld: cairo.c:(.text+0x34): undefined reference to XCloseDisplay'
/usr/bin/ld: ./build/cairo.o: in function draw_world': cairo.c:(.text+0x72): undefined reference to cairo_create'
/usr/bin/ld: cairo.c:(.text+0x98): undefined reference to cairo_set_source_rgba' /usr/bin/ld: cairo.c:(.text+0xa7): undefined reference to cairo_paint'
/usr/bin/ld: cairo.c:(.text+0x13d): undefined reference to cairo_image_surface_create_from_png' /usr/bin/ld: cairo.c:(.text+0x165): undefined reference to cairo_set_source_surface'
/usr/bin/ld: cairo.c:(.text+0x174): undefined reference to cairo_paint' /usr/bin/ld: cairo.c:(.text+0x183): undefined reference to cairo_destroy'
/usr/bin/ld: ./build/cairo.o: in function draw_point': cairo.c:(.text+0x1c1): undefined reference to cairo_create'
/usr/bin/ld: cairo.c:(.text+0x1e1): undefined reference to cairo_set_source_rgba' /usr/bin/ld: cairo.c:(.text+0x1ed): undefined reference to cairo_paint'
/usr/bin/ld: cairo.c:(.text+0x229): undefined reference to cairo_set_source_rgba' /usr/bin/ld: cairo.c:(.text+0x241): undefined reference to cairo_set_line_width'
/usr/bin/ld: cairo.c:(.text+0x28b): undefined reference to cairo_arc' /usr/bin/ld: cairo.c:(.text+0x2bb): undefined reference to cairo_arc'
/usr/bin/ld: cairo.c:(.text+0x2c7): undefined reference to cairo_fill' /usr/bin/ld: cairo.c:(.text+0x2d3): undefined reference to cairo_destroy'
/usr/bin/ld: ./build/cairo.o: in function draw_invisible_point': cairo.c:(.text+0x2f2): undefined reference to cairo_create'
/usr/bin/ld: cairo.c:(.text+0x312): undefined reference to cairo_set_source_rgba' /usr/bin/ld: cairo.c:(.text+0x31e): undefined reference to cairo_paint'
/usr/bin/ld: cairo.c:(.text+0x342): undefined reference to cairo_set_source_rgba' /usr/bin/ld: cairo.c:(.text+0x35a): undefined reference to cairo_set_line_width'
/usr/bin/ld: cairo.c:(.text+0x38a): undefined reference to cairo_arc' /usr/bin/ld: cairo.c:(.text+0x396): undefined reference to cairo_fill'
/usr/bin/ld: cairo.c:(.text+0x3a2): undefined reference to cairo_destroy' /usr/bin/ld: ./build/cairo.o: in function clear_surface':
cairo.c:(.text+0x3c1): undefined reference to cairo_create' /usr/bin/ld: cairo.c:(.text+0x3e1): undefined reference to cairo_set_source_rgba'
/usr/bin/ld: cairo.c:(.text+0x3f2): undefined reference to cairo_set_operator' /usr/bin/ld: cairo.c:(.text+0x3fe): undefined reference to cairo_paint'
/usr/bin/ld: cairo.c:(.text+0x40a): undefined reference to cairo_destroy' /usr/bin/ld: ./build/main.o: in function main':
main.c:(.text+0x153): undefined reference to cairo_xlib_surface_create' /usr/bin/ld: main.c:(.text+0x16b): undefined reference to cairo_xlib_surface_set_size'
collect2: error: ld returned 1 exit status
make: *** [Makefile:28: build] Error 1`

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.