aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--emacs-go-mode/init-go-mode.el2
-rw-r--r--emacs-haskell-mode/init-haskell-mode.el2
-rw-r--r--emacs/init.el12
-rw-r--r--gdb/init-gdb.el2
-rwxr-xr-xgit/new-c-proj75
-rw-r--r--mpv/Makefile11
-rw-r--r--mpv/input.conf8
-rw-r--r--xpybar/config/common.py24
8 files changed, 126 insertions, 10 deletions
diff --git a/emacs-go-mode/init-go-mode.el b/emacs-go-mode/init-go-mode.el
index 56e3c16..81c7576 100644
--- a/emacs-go-mode/init-go-mode.el
+++ b/emacs-go-mode/init-go-mode.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t; -*-
+
(add-to-list 'load-path "/usr/share/emacs/site-lisp/go-mode/")
(autoload 'go-mode "go-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.go\\'" . go-mode))
diff --git a/emacs-haskell-mode/init-haskell-mode.el b/emacs-haskell-mode/init-haskell-mode.el
index 6fe75c2..46392a2 100644
--- a/emacs-haskell-mode/init-haskell-mode.el
+++ b/emacs-haskell-mode/init-haskell-mode.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t; -*-
+
(add-to-list 'load-path "/usr/share/emacs/site-lisp/haskell-mode/")
(require 'haskell-mode-autoloads)
(add-to-list 'Info-default-directory-list "/usr/share/emacs/site-lisp/haskell-mode/")
diff --git a/emacs/init.el b/emacs/init.el
index 432b772..ebaf0d7 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -1,3 +1,5 @@
+;;; -*- lexical-binding: t; -*-
+
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
@@ -69,3 +71,13 @@
((lambda ()
(dolist (file (directory-files (expand-file-name "~/.config/emacs/") t "^init-.*\\.el$"))
(load-file file))))
+
+
+;; Disable Emacs overriding the terminal's background
+(unless (display-graphic-p)
+ (set-face-attribute 'default nil :background "unspecified-bg")
+ (set-face-attribute 'default nil :foreground "unspecified-fg"))
+
+;; Disable Emacs take control over the terminal's mouse features
+;; (This is important for copy and paste between Emacs and other applications)
+(unless (display-graphic-p) (xterm-mouse-mode -1))
diff --git a/gdb/init-gdb.el b/gdb/init-gdb.el
index 51b1a35..ba3ce0b 100644
--- a/gdb/init-gdb.el
+++ b/gdb/init-gdb.el
@@ -1 +1,3 @@
+;;; -*- lexical-binding: t; -*-
+
(setq gdb-many-windows t)
diff --git a/git/new-c-proj b/git/new-c-proj
index 503bdf9..7546478 100755
--- a/git/new-c-proj
+++ b/git/new-c-proj
@@ -40,8 +40,10 @@ cat > .gitignore <<EOF
*.o
*.a
*.t
+*.f
*.lo
*.to
+*.fo
*.su
*.so
*.so.*
@@ -96,17 +98,37 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then
x $1.h
LOBJ = \$(OBJ:.o=.lo)
+ TOBJ = \$(OBJ:.o=.to)
- all: $1.a $1.\$(LIBEXT)
+ ALL_CPPFLAGS = \$(CPPFLAGS) \$(FUZZED_CPPFLAGS)
+ ALL_CFLAGS = \$(CFLAGS) \$(FUZZED_CFLAGS)
+ ALL_LDFLAGS = \$(LDFLAGS) \$(FUZZED_LDFLAGS)
+
+
+ all: $1.a $1.\$(LIBEXT) \$(TEST)
\$(OBJ): \$(HDR)
\$(LOBJ): \$(HDR)
+ \$(TOBJ): \$(HDR)
+ \$(TEST): $1.a
.c.o:
- x \$(CC) -c -o \$@ \$< \$(CFLAGS) \$(CPPFLAGS)
+ x \$(CC) -c -o \$@ \$< \$(ALL_CFLAGS) \$(COV_CFLAGS) \$(ALL_CPPFLAGS) \$(COV_CPPFLAGS)
.c.lo:
- x \$(CC) -fPIC -c -o \$@ \$< \$(CFLAGS) \$(CPPFLAGS)
+ x \$(CC) -fPIC -c -o \$@ \$< \$(ALL_CFLAGS) \$(COV_CFLAGS) \$(ALL_CPPFLAGS) \$(COV_CPPFLAGS)
+
+ .c.to:
+ x \$(CC) -DTEST -c -o \$@ \$< $\(G) \$(ALL_CFLAGS) \$(ALL_CPPFLAGS) \$(COV_CPPFLAGS)
+
+ .to.t:
+ x \$(CC) -o \$@ \$< $1.a \$(G) \$(ALL_LDFLAGS) \$(COV_LDFLAGS)
+
+ .c.fo:
+ x \$(CC) -DTEST -DFUZZ -c -o \$@ \$< \$(G) \$(ALL_CFLAGS) \$(ALL_CPPFLAGS) \$(FUZZ_CFLAGS) \$(FUZZ_CPPFLAGS)
+
+ .fo.f:
+ x \$(CC) -o \$@ \$< $1.a \$(G) \$(ALL_LDFLAGS) \$(TEST_LDFLAGS) \$(FUZZ_LDFLAGS)
$1.a: \$(OBJ)
x @rm -f -- \$@
@@ -114,7 +136,7 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then
x \$(AR) ts \$@ > /dev/null
$1.\$(LIBEXT): \$(LOBJ)
- x \$(CC) \$(LIBFLAGS) -o \$@ \$(LOBJ) \$(LDFLAGS)
+ x \$(CC) \$(LIBFLAGS) -o \$@ \$(LOBJ) \$(ALL_LDFLAGS)
install: $1.a $1.\$(LIBEXT)
x mkdir -p -- "\$(DESTDIR)\$(PREFIX)/lib"
@@ -136,9 +158,10 @@ if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then
clean:
x -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib
x -rm -f -- *.gch *.gcov *.gcno *.gcda *.\$(LIBEXT)
+ x -rm -f -- *.t *.to *.f *.fo
.SUFFIXES:
- .SUFFIXES: .lo .o .c
+ .SUFFIXES: .lo .o .c .to .t .fo .f
.PHONY: all install uninstall clean
EOF
@@ -185,14 +208,20 @@ else
HDR =
+
+ ALL_CPPFLAGS = \$(CPPFLAGS) \$(FUZZED_CPPFLAGS)
+ ALL_CFLAGS = \$(CFLAGS) \$(FUZZED_CFLAGS)
+ ALL_LDFLAGS = \$(LDFLAGS) \$(FUZZED_LDFLAGS)
+
+
all: $1
\$(OBJ): \$(HDR)
.c.o:
- x \$(CC) -c -o \$@ \$< \$(CFLAGS) \$(CPPFLAGS)
+ x \$(CC) -c -o \$@ \$< \$(ALL_CFLAGS) \$(GOV_CFLAGS) \$(ALL_CPPFLAGS) \$(GOV_CPPFLAGS)
$1: \$(OBJ)
- x \$(CC) -o \$@ \$(OBJ) \$(LDFLAGS)
+ x \$(CC) -o \$@ \$(OBJ) \$(ALL_LDFLAGS) \$(COV_LDFLAGS)
install: $1
x mkdir -p -- "\$(DESTDIR)\$(PREFIX)/bin"
@@ -205,7 +234,8 @@ else
x -rm -f -- "\$(DESTDIR)\$(MANPREFIX)/man1/$1.1"
clean:
- x -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch *.gcov *.gcno *.gcda
+ x -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch
+ x -rm -f -- *.gcov *.gcno *.gcda *.t *.to *.f *.fo
x -rm -f -- $1
.SUFFIXES:
@@ -221,7 +251,32 @@ cat > config.mk <<-EOF
CC = c99
+ COMMON_SANITIZE = -fsanitize=alignment,shift,signed-integer-overflow,object-size,null,undefined,bounds,address
+ CLANG_SANITIZE = -O1 \$(COMMON_SANITIZE),cfi -flto -fvisibility=hidden -fno-sanitize-trap=cfi
+ GCC_SANITIZE = -O1 \$(COMMON_SANITIZE)
+ #SANITIZE = \$(CLANG_SANITIZE)
+ #SANITIZE = \$(GCC_SANITIZE)
+
CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
- CFLAGS =
- LDFLAGS =
+ CFLAGS = \$(SANITIZE)
+ LDFLAGS = \$(SANITIZE)
+
+ G = -g
+EOF
+
+cat <<-EOF | sed 's/x\t/\t/g' > config-coverage-gcc.mk
+ CONFIGFILE_PROPER = config.mk
+ include \$(CONFIGFILE_PROPER)
+
+ CC = \$(CC_PREFIX)gcc -std=c99
+ GCOV = gcov
+
+ COV_CPPFLAGS = -DCOVERAGE_TEST
+ COV_CFLAGS = --coverage -g -O0
+ COV_LDFLAGS = --coverage -g -O0
+
+ G =
+
+ coverage: check
+ x \$(GCOV) -pr -- *.gcda 2>&1
EOF
diff --git a/mpv/Makefile b/mpv/Makefile
new file mode 100644
index 0000000..8f60516
--- /dev/null
+++ b/mpv/Makefile
@@ -0,0 +1,11 @@
+.POSIX:
+
+install:
+ mkdir -p -- ~/.config/mpv
+ test ! -e ~/.config/mpv/input.conf || test -L ~/.config/mpv/input.conf
+ ln -sf -- ~/.dotfiles/mpv/input.conf ~/.config/mpv/input.conf
+
+uninstall:
+ +! ../check-installed mpv
+ -unlink -- ~/.dotfiles/mpv/input.conf
+ -rmdir -- ~/.dotfiles/mpv
diff --git a/mpv/input.conf b/mpv/input.conf
new file mode 100644
index 0000000..68b5af8
--- /dev/null
+++ b/mpv/input.conf
@@ -0,0 +1,8 @@
+Ctrl+Up add video-align-y -1
+Ctrl+Down add video-align-y 1
+Ctrl+Left add video-align-x -1
+Ctrl+Right add video-align-x 1
+Alt+Up add video-pan-y -0.01
+Alt+Down add video-pan-y 0.01
+Alt+Left add video-pan-x -0.01
+Alt+Right add video-pan-x 0.01
diff --git a/xpybar/config/common.py b/xpybar/config/common.py
index fca2b73..dd2c1b7 100644
--- a/xpybar/config/common.py
+++ b/xpybar/config/common.py
@@ -38,6 +38,18 @@ class Globals:
@property
def HEIGHT(self):
return self.globals['HEIGHT']
+ @property
+ def XPOS(self):
+ return self.globals['XPOS']
+ @property
+ def LEFT(self):
+ return self.globals['LEFT']
+ @property
+ def WIDTH(self):
+ return self.globals['WIDTH']
+ @property
+ def SIDEBAR(self):
+ return self.globals['SIDEBAR']
@OUTPUT.setter
def OUTPUT(self, value):
@@ -54,6 +66,18 @@ class Globals:
@HEIGHT.setter
def HEIGHT(self, value):
self.globals['HEIGHT'] = value
+ @XPOS.setter
+ def XPOS(self, value):
+ self.globals['XPOS'] = value
+ @LEFT.setter
+ def LEFT(self, value):
+ self.globals['LEFT'] = value
+ @WIDTH.setter
+ def WIDTH(self, value):
+ self.globals['WIDTH'] = value
+ @SIDEBAR.setter
+ def SIDEBAR(self, value):
+ self.globals['SIDEBAR'] = value
G = Globals()