mirror of
https://github.com/mintycube/dwmblocks.git
synced 2024-10-22 14:05:47 +02:00
Update clang-format
This commit is contained in:
parent
a9f7763596
commit
2773129533
@ -1,3 +1,6 @@
|
|||||||
BasedOnStyle: Google
|
BasedOnStyle: Google
|
||||||
IndentWidth: 4
|
IndentWidth: 4
|
||||||
ColumnLimit: 79
|
ColumnLimit: 79
|
||||||
|
AlignArrayOfStructures: Left
|
||||||
|
AlignConsecutiveMacros: true
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
6
Makefile
6
Makefile
@ -16,7 +16,7 @@ VPATH := $(SRC_DIR)
|
|||||||
OBJS := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
OBJS := $(patsubst $(SRC_DIR)/%.c,$(BUILD_DIR)/%.o,$(wildcard $(SRC_DIR)/*.c))
|
||||||
OBJS += $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard *.c))
|
OBJS += $(patsubst %.c,$(BUILD_DIR)/%.o,$(wildcard *.c))
|
||||||
|
|
||||||
INSTALL_DIR := $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
|
INSTALL_DIR := $(DESTDIR)$(PREFIX)/bin
|
||||||
|
|
||||||
# Prettify output
|
# Prettify output
|
||||||
PRINTF := @printf "%-8s %s\n"
|
PRINTF := @printf "%-8s %s\n"
|
||||||
@ -39,8 +39,8 @@ $(BUILD_DIR):
|
|||||||
$Qmkdir -p $@
|
$Qmkdir -p $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(PRINTF) "RM" $(BUILD_DIR)
|
$(PRINTF) "CLEAN" $(BUILD_DIR)
|
||||||
$Q$(RM) -r $(BUILD_DIR)
|
$Q$(RM) $(BUILD_DIR)/*
|
||||||
|
|
||||||
install: $(BUILD_DIR)/$(BIN)
|
install: $(BUILD_DIR)/$(BIN)
|
||||||
$(PRINTF) "INSTALL" $(INSTALL_DIR)/$(BIN)
|
$(PRINTF) "INSTALL" $(INSTALL_DIR)/$(BIN)
|
||||||
|
22
config.c
22
config.c
@ -3,19 +3,17 @@
|
|||||||
#include "block.h"
|
#include "block.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
Block blocks[] = {
|
Block blocks[] = {
|
||||||
{"sb-mail", 600 , 1 },
|
{"sb-mail", 600, 1 },
|
||||||
{"sb-music", 0, 2 },
|
{"sb-music", 0, 2 },
|
||||||
{"sb-disk", 1800, 3 },
|
{"sb-disk", 1800, 3 },
|
||||||
{"sb-memory", 10, 4 },
|
{"sb-memory", 10, 4 },
|
||||||
{"sb-loadavg", 5, 5 },
|
{"sb-loadavg", 5, 5 },
|
||||||
{"sb-mic", 0, 6 },
|
{"sb-mic", 0, 6 },
|
||||||
{"sb-record", 0, 7 },
|
{"sb-record", 0, 7 },
|
||||||
{"sb-volume", 0, 8 },
|
{"sb-volume", 0, 8 },
|
||||||
{"sb-battery", 5, 9 },
|
{"sb-battery", 5, 9 },
|
||||||
{"sb-date", 1, 10},
|
{"sb-date", 1, 10},
|
||||||
};
|
};
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
const unsigned short blockCount = LEN(blocks);
|
const unsigned short blockCount = LEN(blocks);
|
||||||
|
8
config.h
8
config.h
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define CLICKABLE_BLOCKS 1 // Enable clickability for blocks
|
#define CLICKABLE_BLOCKS 1 // Enable clickability for blocks
|
||||||
#define CMDLENGTH 45 // Number of characters that each block will output
|
#define CMDLENGTH 45 // Trim block output to this length
|
||||||
#define DELIMITER " " // Delimiter string used to separate blocks
|
#define DELIMITER " " // Delimiter string used to separate blocks
|
||||||
#define LEADING_DELIMITER 0 // Whether a leading separator should be used
|
#define LEADING_DELIMITER 0 // Whether a leading separator should be used
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#define _GNU_SOURCE
|
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#define LEN(arr) (sizeof(arr) / sizeof(arr[0]))
|
#define LEN(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||||
#define MAX(a, b) (a > b ? a : b)
|
#define MAX(a, b) (a > b ? a : b)
|
||||||
|
|
||||||
int gcd(int, int);
|
int gcd(int, int);
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
#include "block.h"
|
#include "block.h"
|
||||||
|
|
||||||
|
#define _GNU_SOURCE
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
@ -47,7 +47,9 @@ void signalHandler() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void termHandler() { statusContinue = 0; }
|
void termHandler() {
|
||||||
|
statusContinue = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void setupSignals() {
|
void setupSignals() {
|
||||||
sigset_t handledSignals;
|
sigset_t handledSignals;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int gcd(int a, int b) {
|
int gcd(int a, int b) {
|
||||||
int temp;
|
int temp;
|
||||||
while (b > 0) {
|
while (b > 0) {
|
||||||
|
@ -15,7 +15,9 @@ int setupX() {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int closeX() { return XCloseDisplay(display); }
|
int closeX() {
|
||||||
|
return XCloseDisplay(display);
|
||||||
|
}
|
||||||
|
|
||||||
void setXRootName(char *str) {
|
void setXRootName(char *str) {
|
||||||
XStoreName(display, rootWindow, str);
|
XStoreName(display, rootWindow, str);
|
||||||
|
Loading…
Reference in New Issue
Block a user