Update clang-format

This commit is contained in:
Utkarsh Verma 2023-04-06 06:18:16 +05:30
parent a9f7763596
commit 2773129533
No known key found for this signature in database
GPG Key ID: 817656CF818EFCCC
10 changed files with 31 additions and 25 deletions

View File

@ -1,3 +1,6 @@
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 79
AlignArrayOfStructures: Left
AlignConsecutiveMacros: true
AllowShortFunctionsOnASingleLine: None

View File

@ -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)

View File

@ -3,9 +3,8 @@
#include "block.h"
#include "util.h"
// clang-format off
Block blocks[] = {
{"sb-mail", 600 , 1 },
{"sb-mail", 600, 1 },
{"sb-music", 0, 2 },
{"sb-disk", 1800, 3 },
{"sb-memory", 10, 4 },
@ -16,6 +15,5 @@ Block blocks[] = {
{"sb-battery", 5, 9 },
{"sb-date", 1, 10},
};
// clang-format on
const unsigned short blockCount = LEN(blocks);

View File

@ -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 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

View File

@ -1,6 +1,4 @@
#pragma once
#define _GNU_SOURCE
#include "config.h"
typedef struct {

View File

@ -1,5 +1,4 @@
#pragma once
#include <unistd.h>
#define LEN(arr) (sizeof(arr) / sizeof(arr[0]))
#define MAX(a, b) (a > b ? a : b)

View File

@ -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"

View File

@ -47,7 +47,9 @@ void signalHandler() {
}
}
void termHandler() { statusContinue = 0; }
void termHandler() {
statusContinue = 0;
}
void setupSignals() {
sigset_t handledSignals;

View File

@ -1,5 +1,7 @@
#include "util.h"
#include <unistd.h>
int gcd(int a, int b) {
int temp;
while (b > 0) {

View File

@ -15,7 +15,9 @@ int setupX() {
return 0;
}
int closeX() { return XCloseDisplay(display); }
int closeX() {
return XCloseDisplay(display);
}
void setXRootName(char *str) {
XStoreName(display, rootWindow, str);