aboutsummaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
committerMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
commit0f1df0db903ba576fd17b08197d3066af7a61e5f (patch)
treea59c04307b1382257afa3c3512ec3abadf7e0e47 /base
parentUse losetup -d instead of --detach and add clean up (diff)
downloaddotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.gz
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.bz2
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.xz
A lot of changes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'base')
-rw-r--r--base/Makefile59
-rwxr-xr-xbase/new-c-proj222
-rw-r--r--base/user-profile (renamed from base/profile)0
-rw-r--r--base/user-profile-North (renamed from base/profile-North)0
-rw-r--r--base/user-profile-Zenith4
-rw-r--r--base/xinit7
6 files changed, 49 insertions, 243 deletions
diff --git a/base/Makefile b/base/Makefile
index 365bde6..9752ef1 100644
--- a/base/Makefile
+++ b/base/Makefile
@@ -1,20 +1,26 @@
.POSIX:
-include ../common.mk
FACE = penguin.png
+XINITRC_ORDER = 90
+
install:
mkdir -p -- ~/.config
- test ! -d ~/.profile
- test ! -d ~/.config/profile
- test ! -d ~/.config/profile-North
- test ! -d ~/.config/user-dirs.locale
- test ! -d ~/.config/face
- test ! -d ~/.face
- test ! -d ~/.face.icon
+ test ! -e ~/.profile || test -L ~/.profile
+ test ! -e ~/.config/user-profile || test -L ~/.config/profile
+ test ! -e ~/.config/user-profile-North || test -L ~/.config/profile-North
+ test ! -e ~/.config/user-profile-Zenith || test -L ~/.config/profile-Zenith
+ test ! -e ~/.config/user-dirs.locale || test -L ~/.config/user-dirs.locale
+ test ! -e ~/.config/face || test -L ~/.config/face || \
+ sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.config/face | cut -d ' ' -f 1)" > /dev/null
+ test ! -e ~/.face || test -L ~/.face || \
+ sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.face | cut -d ' ' -f 1)" > /dev/null
+ test ! -e ~/.face.icon || test -L ~/.face.icon || \
+ sha256sum faces/* | cut -d ' ' -f 1 | grep "$(sha256sum -- ~/.face.icon | cut -d ' ' -f 1)" > /dev/null
ln -sf -- .config/profile ~/.profile
- ln -sf -- ~/.dotfiles/base/profile ~/.config/profile
- ln -sf -- ~/.dotfiles/base/profile-North ~/.config/profile-North
+ ln -sf -- ~/.dotfiles/base/user-profile ~/.config/profile
+ ln -sf -- ~/.dotfiles/base/user-profile-North ~/.config/profile-North
+ ln -sf -- ~/.dotfiles/base/user-profile-Zenith ~/.config/profile-Zenith
ln -sf -- ~/.dotfiles/base/user-dirs.locale ~/.config/
ln -sf -- ~/.dotfiles/base/faces/$(FACE) ~/.config/face
ln -sf -- .config/face ~/.face
@@ -25,28 +31,39 @@ install:
test ! -e ~/.config/locations && \
ln -s -- ~/.dotfiles/.secrets/locations ~/.config/locations; \
fi
- test ! -d ~/.config/geolocation
- test ! -d ~/.config/metar
+ test ! -e ~/.config/geolocation || test -L ~/.config/geolocation
+ test ! -e ~/.config/metar || test -L ~/.config/metar
test -L ~/.config/locations/current || test ! -e ~/.config/locations/current
test -L ~/.config/locations/current || ln -sf default ~/.config/locations/current
ln -sf locations/current/geolocation ~/.config/geolocation
ln -sf locations/current/metar ~/.config/metar
mkdir -p -- ~/.local/bin
test ! -d ~/.local/bin/iswork
- test -x /bin/false
- ln -sf -- /bin/false ~/.local/bin/iswork
- ln -sf ~/.dotfiles/base/new-c-proj ~/.local/bin/
- test ! -r ../.secrets/bin/Makefile || make -C ../.secrets/bin install
+ test -x /bin/false && test -x /bin/true
+ if test -e "../.secrets/workmachine-$$(hostname)"; then \
+ ln -sf -- /bin/true ~/.local/bin/iswork; \
+ else \
+ ln -sf -- /bin/false ~/.local/bin/iswork; \
+ fi
+ test ! -r ../.secrets/bin/Makefile || (cd ../.secrets/bin && $(MAKE) install)
+ mkdir -p -- ~/.config/X11/xinit/xinitrc.d
+ test ! -e ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base || \
+ test -L ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base
+ ln -sf -- ~/.dotfiles/base/xinit ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base
uninstall:
- -unlink -- ~/.config/profile
+ +! ../check-installed base
+ -unlink -- ~/.config/X11/xinit/xinitrc.d/$(XINITRC_ORDER)-base
+ -rmdir -- ~/.config/X11/xinit/xinitrc.d
+ -rmdir -- ~/.config/X11/xinit
+ -rmdir -- ~/.config/X11
+ -unlink -- ~/.config/user-profile
+ -unlink -- ~/.config/user-profile-North
+ -unlink -- ~/.config/user-profile-Zenith
-unlink -- ~/.config/user-dirs.locale
-unlink -- ~/.profile
-unlink -- ~/.config/locations
-unlink -- ~/.config/geolocation
-unlink -- ~/.config/metar
-unlink -- ~/.local/bin/iswork
- -unlink -- ~/.local/bin/new-c-proj
- -test ! -r ../.secrets/bin/Makefile || make -C ../.secrets/bin uninstall
-
-.PHONY: install uninstall
+ -test ! -r ../.secrets/bin/Makefile || (cd ../.secrets/bin && $(MAKE) uninstall)
diff --git a/base/new-c-proj b/base/new-c-proj
deleted file mode 100755
index 48f8d83..0000000
--- a/base/new-c-proj
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if ! test $# = 1; then
- printf 'usage %s: proj-name\n' "$0" >&2
- exit 1
-fi
-
-if printf '%s\n' "$1" | grep / >/dev/null 2>/dev/null; then
- printf 'project name cannot contain a slash\n' "$0" >&2
- exit 1
-fi
-
-mkdir -- "$1"
-cd -- "$1"
-git init .
-
-cat > LICENSE <<EOF
-ISC License
-
-© $(date +%Y) Mattias Andrée <maandree@kth.se>
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-EOF
-
-cat > .gitignore <<EOF
-*\#*
-*~
-*.o
-*.a
-*.lo
-*.su
-*.so
-*.so.*
-*.dll
-*.dylib
-*.gch
-*.gcov
-*.gcno
-*.gcda
-EOF
-
-printf '_*\n' >> .git/info/exclude
-
-if printf '%s\n' "$1" | grep '^lib' >/dev/null 2>/dev/null; then
- UPPERCASE="$(printf '%s\n' "$1" | tr '[a-z-]' '[A-Z_]')"
- LIBNAME="$(printf '%s\n' "$1" | sed 's/^lib//')"
-
- printf '%s\n' >> "$1".h \
- '/* See LICENSE file for copyright and license details. */' \
- "#ifndef ${UPPERCASE}_H" \
- "#define ${UPPERCASE}_H" \
- '' \
- '#endif'
-
- mkdir -p -- mk
-
- cat <<-EOF | sed 's/x\t/\t/g' > Makefile
- .POSIX:
-
- CONFIGFILE = config.mk
- include \$(CONFIGFILE)
-
- OS = linux
- # Linux: linux
- # Mac OS: macos
- # Windows: windows
- include mk/\$(OS).mk
-
-
- LIB_MAJOR = 1
- LIB_MINOR = 0
- LIB_VERSION = \$(LIB_MAJOR).\$(LIB_MINOR)
- LIB_NAME = ${LIBNAME}
-
-
- OBJ =
-
- HDR =\\
- x $1.h
-
- LOBJ = \$(OBJ:.o=.lo)
-
-
- all: $1.a $1.\$(LIBEXT)
- \$(OBJ): \$(HDR)
- \$(LOBJ): \$(HDR)
-
- .c.o:
- x \$(CC) -c -o \$@ \$< \$(CFLAGS) \$(CPPFLAGS)
-
- .c.lo:
- x \$(CC) -fPIC -c -o \$@ \$< \$(CFLAGS) \$(CPPFLAGS)
-
- $1.a: \$(OBJ)
- x @rm -f -- \$@
- x \$(AR) rc \$@ \$(OBJ)
- x \$(AR) ts \$@ > /dev/null
-
- $1.\$(LIBEXT): \$(LOBJ)
- x \$(CC) \$(LIBFLAGS) -o \$@ \$(LOBJ) \$(LDFLAGS)
-
- install: $1.a $1.\$(LIBEXT)
- x mkdir -p -- "\$(DESTDIR)\$(PREFIX)/lib"
- x mkdir -p -- "\$(DESTDIR)\$(PREFIX)/include"
- x cp -- $1.a "\$(DESTDIR)\$(PREFIX)/lib/"
- x cp -- $1.\$(LIBEXT) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMINOREXT)"
- x \$(FIX_INSTALL_NAME) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMINOREXT)"
- x ln -sf -- $1.\$(LIBMINOREXT) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMAJOREXT)"
- x ln -sf -- $1.\$(LIBMAJOREXT) "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBEXT)"
- x cp -- $1.h "\$(DESTDIR)\$(PREFIX)/include/"
-
- uninstall:
- x -rm -f -- "\$(DESTDIR)\$(PREFIX)/lib/$1.a"
- x -rm -f -- "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMAJOREXT)"
- x -rm -f -- "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBMINOREXT)"
- x -rm -f -- "\$(DESTDIR)\$(PREFIX)/lib/$1.\$(LIBEXT)"
- x -rm -f -- "\$(DESTDIR)\$(PREFIX)/include/$1.h"
-
- clean:
- x -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib
- x -rm -f -- *.gch *.gcov *.gcno *.gcda *.\$(LIBEXT)
-
- .SUFFIXES:
- .SUFFIXES: .lo .o .c
-
- .PHONY: all install uninstall clean
- EOF
-
- cat <<-EOF | sed 's/x\t/\t/g' > mk/linux.mk
- LIBEXT = so
- LIBFLAGS = -shared -Wl,-soname,lib\$(LIB_NAME).\$(LIBEXT).\$(LIB_MAJOR)
- LIBMAJOREXT = \$(LIBEXT).\$(LIB_MAJOR)
- LIBMINOREXT = \$(LIBEXT).\$(LIB_VERSION)
-
- FIX_INSTALL_NAME = :
- EOF
-
- cat <<-EOF | sed 's/x\t/\t/g' > mk/macos.mk
- LIBEXT = dylib
- LIBFLAGS = -dynamiclib -Wl,-compatibility_version,\$(LIB_MAJOR) -Wl,-current_version,\$(LIB_VERSION)
- LIBMAJOREXT = \$(LIB_MAJOR).\$(LIBEXT)
- LIBMINOREXT = \$(LIB_VERSION).\$(LIBEXT)
-
- FIX_INSTALL_NAME = install_name_tool -id "\$(PREFIX)/lib/$1.\$(LIBMAJOREXT)"
- EOF
-
- cat <<-EOF | sed 's/x\t/\t/g' > mk/windows.mk
- LIBEXT = dll
- LIBFLAGS = -shared
- LIBMAJOREXT = \$(LIB_MAJOR).\$(LIBEXT)
- LIBMINOREXT = \$(LIB_VERSION).\$(LIBEXT)
-
- FIX_INSTALL_NAME = :
- EOF
-else
- printf '%s\n' "/$1" >> .gitignore
-
- printf '%s\n' '/* See LICENSE file for copyright and license details. */' >> "$1".c
-
- cat <<-EOF | sed 's/x\t/\t/g' > Makefile
- .POSIX:
-
- CONFIGFILE = config.mk
- include \$(CONFIGFILE)
-
- OBJ =\\
- x $1.o
-
- HDR =
-
- all: $1
- \$(OBJ): \$(HDR)
-
- .c.o:
- x \$(CC) -c -o \$@ \$< \$(CFLAGS) \$(CPPFLAGS)
-
- $1: \$(OBJ)
- x \$(CC) -o \$@ \$(OBJ) \$(LDFLAGS)
-
- install: $1
- x mkdir -p -- "\$(DESTDIR)\$(PREFIX)/bin"
- x mkdir -p -- "\$(DESTDIR)\$(MANPREFIX)/man1/"
- x cp -- $1 "\$(DESTDIR)\$(PREFIX)/bin/"
- x cp -- $1.1 "\$(DESTDIR)\$(MANPREFIX)/man1/"
-
- uninstall:
- x -rm -f -- "\$(DESTDIR)\$(PREFIX)/bin/$1"
- 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 -- $1
-
- .SUFFIXES:
- .SUFFIXES: .o .c
-
- .PHONY: all install uninstall clean
- EOF
-fi
-
-cat > config.mk <<-EOF
- PREFIX = /usr
- MANPREFIX = \$(PREFIX)/share/man
-
- CC = cc
-
- CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -D_GNU_SOURCE
- CFLAGS = -std=c99 -Wall -g
- LDFLAGS =
-EOF
diff --git a/base/profile b/base/user-profile
index 2206a1f..2206a1f 100644
--- a/base/profile
+++ b/base/user-profile
diff --git a/base/profile-North b/base/user-profile-North
index 7a5acc9..7a5acc9 100644
--- a/base/profile-North
+++ b/base/user-profile-North
diff --git a/base/user-profile-Zenith b/base/user-profile-Zenith
new file mode 100644
index 0000000..97cf492
--- /dev/null
+++ b/base/user-profile-Zenith
@@ -0,0 +1,4 @@
+# -*- shell-script -*-
+
+# Set audio interface
+export MAIN_ALSA_CARD=2
diff --git a/base/xinit b/base/xinit
new file mode 100644
index 0000000..2ef7ed0
--- /dev/null
+++ b/base/xinit
@@ -0,0 +1,7 @@
+# -*- shell-script -*-
+
+# Set keyboard settings
+setkeys || :
+
+# Start hotkey daemon
+xkbdbind &