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
|
||||
IndentWidth: 4
|
||||
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 %.c,$(BUILD_DIR)/%.o,$(wildcard *.c))
|
||||
|
||||
INSTALL_DIR := $(subst //,/,$(DESTDIR)/$(PREFIX)/bin)
|
||||
INSTALL_DIR := $(DESTDIR)$(PREFIX)/bin
|
||||
|
||||
# Prettify output
|
||||
PRINTF := @printf "%-8s %s\n"
|
||||
@ -39,8 +39,8 @@ $(BUILD_DIR):
|
||||
$Qmkdir -p $@
|
||||
|
||||
clean:
|
||||
$(PRINTF) "RM" $(BUILD_DIR)
|
||||
$Q$(RM) -r $(BUILD_DIR)
|
||||
$(PRINTF) "CLEAN" $(BUILD_DIR)
|
||||
$Q$(RM) $(BUILD_DIR)/*
|
||||
|
||||
install: $(BUILD_DIR)/$(BIN)
|
||||
$(PRINTF) "INSTALL" $(INSTALL_DIR)/$(BIN)
|
||||
|
22
config.c
22
config.c
@ -3,19 +3,17 @@
|
||||
#include "block.h"
|
||||
#include "util.h"
|
||||
|
||||
// clang-format off
|
||||
Block blocks[] = {
|
||||
{"sb-mail", 600 , 1 },
|
||||
{"sb-music", 0, 2 },
|
||||
{"sb-disk", 1800, 3 },
|
||||
{"sb-memory", 10, 4 },
|
||||
{"sb-loadavg", 5, 5 },
|
||||
{"sb-mic", 0, 6 },
|
||||
{"sb-record", 0, 7 },
|
||||
{"sb-volume", 0, 8 },
|
||||
{"sb-battery", 5, 9 },
|
||||
{"sb-date", 1, 10},
|
||||
{"sb-mail", 600, 1 },
|
||||
{"sb-music", 0, 2 },
|
||||
{"sb-disk", 1800, 3 },
|
||||
{"sb-memory", 10, 4 },
|
||||
{"sb-loadavg", 5, 5 },
|
||||
{"sb-mic", 0, 6 },
|
||||
{"sb-record", 0, 7 },
|
||||
{"sb-volume", 0, 8 },
|
||||
{"sb-battery", 5, 9 },
|
||||
{"sb-date", 1, 10},
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const unsigned short blockCount = LEN(blocks);
|
||||
|
8
config.h
8
config.h
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#define CLICKABLE_BLOCKS 1 // Enable clickability for blocks
|
||||
#define CMDLENGTH 45 // Number of characters that each block will output
|
||||
#define DELIMITER " " // Delimiter string used to separate blocks
|
||||
#define LEADING_DELIMITER 0 // Whether a leading separator should be used
|
||||
#define CLICKABLE_BLOCKS 1 // Enable clickability for blocks
|
||||
#define CMDLENGTH 45 // Trim block output to this length
|
||||
#define DELIMITER " " // Delimiter string used to separate blocks
|
||||
#define LEADING_DELIMITER 0 // Whether a leading separator should be used
|
||||
|
@ -1,6 +1,4 @@
|
||||
#pragma once
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#include "config.h"
|
||||
|
||||
typedef struct {
|
||||
|
@ -1,7 +1,6 @@
|
||||
#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)
|
||||
|
||||
int gcd(int, int);
|
||||
|
@ -1,8 +1,10 @@
|
||||
#include "block.h"
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "util.h"
|
||||
|
||||
|
@ -47,7 +47,9 @@ void signalHandler() {
|
||||
}
|
||||
}
|
||||
|
||||
void termHandler() { statusContinue = 0; }
|
||||
void termHandler() {
|
||||
statusContinue = 0;
|
||||
}
|
||||
|
||||
void setupSignals() {
|
||||
sigset_t handledSignals;
|
||||
|
@ -1,5 +1,7 @@
|
||||
#include "util.h"
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
int gcd(int a, int b) {
|
||||
int temp;
|
||||
while (b > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user