Skip to content

Instantly share code, notes, and snippets.

@dvdkon
dvdkon / panel.c
Created October 25, 2015 17:36
A simple C program for feeding data into a lemonbar-like panel
/* Copyright 2015 David Koňařík
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@dvdkon
dvdkon / evdev_read_prototype.c
Last active March 24, 2019 00:45
Evdev keyboard reading prototype
#include <unistd.h>
#include <fcntl.h>
#include <linux/input.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int fd = open("/dev/input/event5", O_RDONLY);
struct input_event ie;
while(read(fd, &ie, sizeof(struct input_event)) >= sizeof(struct input_event))
@dvdkon
dvdkon / .config
Created August 29, 2015 14:23
Moto G custom kernel config for Debian
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.4.108 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
CONFIG_GENERIC_CLOCKEVENTS=y