Compare commits
No commits in common. "011925061d840e947e6d0041ff65af6741edd50b" and "e196a5f96f7e6e6dad7be799a7ce7c0fa293ada2" have entirely different histories.
011925061d
...
e196a5f96f
|
@ -35,10 +35,6 @@ super + e
|
|||
super + shift + e
|
||||
systemctl suspend
|
||||
|
||||
# password menu
|
||||
super + z
|
||||
passmenu
|
||||
|
||||
# manipulate a node
|
||||
super + {_,ctrl +,shift + }{h,j,k,l}
|
||||
bspc node -{f,p,s} {west,south,north,east}
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
, xrandr
|
||||
, svkbd
|
||||
, xkbset
|
||||
, rbw
|
||||
, xclip
|
||||
, libsForQt5
|
||||
}:
|
||||
|
||||
|
@ -31,7 +29,7 @@ stdenv.mkDerivation rec {
|
|||
src = ./utils;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper pkg-config libxcb ];
|
||||
buildInputs = [ libxcb bash feh xrandr jq curl fzy ytfzf ffmpeg sshuttle svkbd scrcpy xkbset rbw xclip libsForQt5.kolourpaint ];
|
||||
buildInputs = [ libxcb bash feh xrandr jq curl fzy ytfzf ffmpeg sshuttle svkbd scrcpy xkbset libsForQt5.kolourpaint ];
|
||||
|
||||
buildPhase = ''
|
||||
ls
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
LDFLAGS=`pkg-config --cflags --libs xcb`
|
||||
CFLAGS=-ggdb -fsanitize=address
|
||||
main: battery.o bspwm.o time.o battstatus.o message.o
|
||||
main: battery.o bspwm.o time.o battstatus.o
|
||||
|
||||
clean:
|
||||
rm *.o main
|
||||
|
|
|
@ -17,14 +17,12 @@
|
|||
#include "battstatus.h"
|
||||
#include "bspwm.h"
|
||||
#include "time.h"
|
||||
#include "message.h"
|
||||
|
||||
struct module mods[] = {
|
||||
{mod_battery, "battery", "BAT0", { '\0' }},
|
||||
{mod_battstatus, "battstatus", "BAT0", { '\0' }},
|
||||
{mod_time, "time", "", { '\0' }},
|
||||
{mod_bspwm, "bspwm", "", { '\0' }},
|
||||
/* {mod_message, "message", "/home/usr/.cache/statusbar_notification", { '\0' }}, */
|
||||
};
|
||||
|
||||
void create_module_proc(int index, char *pipename) {
|
||||
|
@ -61,12 +59,17 @@ void redraw() {
|
|||
static char NAMED_PIPE[] = "/home/usr/.cache/statusbar_pipe";
|
||||
|
||||
int main(void) {
|
||||
char pipename[BUFFER_SIZE];
|
||||
srand(time(NULL));
|
||||
mkfifo(&NAMED_PIPE, 0666); /* it's okay if this fails */
|
||||
int fd = open(&NAMED_PIPE, O_RDWR);
|
||||
strcpy(pipename, &NAMED_PIPE);
|
||||
pipename[sizeof(NAMED_PIPE) - 1] = 'A' + (rand() % 26);
|
||||
pipename[sizeof(NAMED_PIPE)] = 'A' + (rand() % 26);
|
||||
pipename[sizeof(NAMED_PIPE) + 1] = '\0';
|
||||
mkfifo(pipename, 0666);
|
||||
int fd = open(pipename, O_RDWR);
|
||||
struct message msg;
|
||||
|
||||
create_module_procs(&NAMED_PIPE);
|
||||
create_module_procs(pipename);
|
||||
|
||||
for (;;) {
|
||||
int ret = read(fd, &msg, sizeof(msg));
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <sys/inotify.h>
|
||||
|
||||
#include "message.h"
|
||||
#include "common.h"
|
||||
|
||||
int mod_message(char *config, char *name, char *pipename) {
|
||||
struct message msg;
|
||||
struct inotify_event buf;
|
||||
strcpy(msg.name, name);
|
||||
|
||||
int fd = inotify_init();
|
||||
int outfd = open(pipename, O_WRONLY);
|
||||
|
||||
for(;;) {
|
||||
int watchdesc = inotify_add_watch(fd, config, IN_MODIFY);
|
||||
read:
|
||||
int watchread = read(fd, &buf, sizeof(struct inotify_event));
|
||||
|
||||
/* the file's changed, so reread it */
|
||||
int filefd = open(config, O_RDONLY, 0);
|
||||
int read_in = read(filefd, msg.content, sizeof(msg.content));
|
||||
msg.content[read_in - 1] = '\0';
|
||||
close(filefd);
|
||||
|
||||
/* write the new */
|
||||
write(outfd, &msg, sizeof(msg));
|
||||
inotify_rm_watch(fd, watchdesc); /* not sure why this is needed */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef STATUS_MESSAGE_H
|
||||
#define STATUS_MESSAGE_H
|
||||
|
||||
int mod_message(char *config, char *name, char *pipename);
|
||||
|
||||
#endif
|
|
@ -1,7 +0,0 @@
|
|||
# wrapper around rbw
|
||||
|
||||
resp=$(rbw list | tmenu)
|
||||
|
||||
rbw get "$resp" | xclip -selection clipboard
|
||||
sleep 15
|
||||
echo "cleared" | xclip -selection clipboard
|
Loading…
Reference in New Issue