From 229bd3f6311e63b7081d8b9abb12ad655f52541f Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 9 Sep 2019 16:31:19 -0700 Subject: [PATCH 1/4] changed shell for bread --- bread | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bread b/bread index 466ccce..b88388e 100755 --- a/bread +++ b/bread @@ -1,4 +1,5 @@ -#!/bin/bash +#!/bin/sh + book=`ls $HOME/Books/ | dmenu -i -l 15` if [ ! -z "$book" ] then From 8aba6313c90bd56c967c491bc08d90c787a1a89a Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 18 Sep 2019 13:42:10 -0700 Subject: [PATCH 2/4] debugging thing --- dwm-stat/status.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dwm-stat/status.c b/dwm-stat/status.c index fff87dc..416e0c3 100644 --- a/dwm-stat/status.c +++ b/dwm-stat/status.c @@ -95,8 +95,8 @@ battery_percentage(void) #ifdef CPU_USAGE // stat(2) -> #define CPU_PROC_BASE -#define TOTAL "head /proc/stat -n 1 | cut -c 6- | sed 's/ /\\+/g' | bc" -#define IDLE "head /proc/stat -n 1 | cut -c 6- | awk '{print $4}'" +#define CPU_TOTAL "head /proc/stat -n 1 | cut -c 6- | sed 's/ /\\+/g' | bc" +#define CPU_IDLE "head /proc/stat -n 1 | cut -c 6- | awk '{print $4}'" static char* cpu_usage(void) { @@ -106,13 +106,13 @@ cpu_usage(void) static char buf[SMALL_BUF]; unsigned total, idle; // get the total time - query_p = popen(TOTAL, "r"); + query_p = popen(CPU_TOTAL, "r"); fgets(buf, sizeof(buf)-1, query_p); total = atoi(buf); pclose(query_p); // get the idle time - query_p = popen(IDLE, "r"); + query_p = popen(CPU_IDLE, "r"); fgets(buf, sizeof(buf)-1, query_p); idle = atoi(buf); pclose(query_p); @@ -182,7 +182,11 @@ main(void) remainder -= written; } +#ifdef DEBUG + printf("%s\n", stat_output); +#else XSetRoot(stat_output); +#endif sleep(TIME_DELAY); } return 0; From 23363dbfe0e562e791e4edaea19cb6ad4405e098 Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 18 Sep 2019 16:49:46 -0700 Subject: [PATCH 3/4] guard against mistypes --- wifi | 1 + 1 file changed, 1 insertion(+) diff --git a/wifi b/wifi index fafba7e..b71363a 100755 --- a/wifi +++ b/wifi @@ -47,6 +47,7 @@ __kill_old() { __connect_config() { if [ -z "$debug_kill" ] then + if [ ! -f "$1" ]; then echo Config not found;fi __kill_old wpa_supplicant -B -i wlp1s0 -c "$1" dhclient wlp1s0 From 8c07fc377cbcb087570f9788055e2dae6b0a814b Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Wed, 18 Sep 2019 16:50:29 -0700 Subject: [PATCH 4/4] forgot exit kek --- wifi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wifi b/wifi index b71363a..4a5bb95 100755 --- a/wifi +++ b/wifi @@ -47,7 +47,8 @@ __kill_old() { __connect_config() { if [ -z "$debug_kill" ] then - if [ ! -f "$1" ]; then echo Config not found;fi + if [ ! -f "$1" ]; then echo Config not found\ + exit 0;fi __kill_old wpa_supplicant -B -i wlp1s0 -c "$1" dhclient wlp1s0