Skip to content

Instantly share code, notes, and snippets.

View nwg-piotr's full-sized avatar
🏠
~/, sweet ~/

Piotr Miller nwg-piotr

🏠
~/, sweet ~/
View GitHub Profile
@milisarge
milisarge / greetd.py
Last active December 11, 2023 12:23
Python Greetd Based Login Manager - CLI
#!/usr/bin/env python3
import sys
import socket, os
import json
soket = os.getenv("GREETD_SOCK")
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
client.connect(soket)
@KurtJacobson
KurtJacobson / drag.c
Last active March 24, 2023 21:37
Re-positioning Gtk widget with a mouse drag in C and Python
#include <gtk/gtk.h>
// Source:
// http://www.linuxforums.org/forum/programming-scripting/117713-gtk-moving-widget-mouse-post906490.html#post906490
// higher values make movement more performant
// lower values make movement smoother
const gint Sensitivity = 1;
const gint EvMask = GDK_BUTTON_PRESS_MASK | GDK_BUTTON1_MOTION_MASK;