--- /dev/null
+alias ls="ls --color=auto"
+
--- /dev/null
+alias ls="ls --color=auto"
--- /dev/null
+# because these are included by /etc/sway/config for probably good reason …
+include /etc/sway/config-vars.d/*
+include /etc/sway/config.d/*
+
+# font for wm text
+font pango:Terminus 16px
+
+# force "tabbed" as default layout for new windows
+workspace_layout tabbed
+
+# simple green background
+output * background #559911 solid_color
+
+# keyboard layout
+input * xkb_layout "us"
+
+# deactivate t490s touchpad
+input 1267:47:Elan_Touchpad events disabled
+
+# status bar
+bar {
+ position top
+ tray_output none
+ status_command ~/.config/sway/status.py
+}
+
+# make Windows key modifier key for all wm actions
+set $mod Mod4
+floating_modifier $mod
+
+# move pointer in 1px units
+bindsym --no-repeat $mod+h seat * cursor move -1 0
+bindsym --no-repeat $mod+j seat * cursor move 0 1
+bindsym --no-repeat $mod+k seat * cursor move 0 -1
+bindsym --no-repeat $mod+l seat * cursor move 1 0
+
+# program launcher
+bindsym $mod+x exec wmenu-run
+
+# launch terminal emulator
+bindsym $mod+Return exec foot --font="Courier New:size=14.5"
+
+# kill window
+bindsym $mod+Shift+q kill
+
+# move focus between windows, but not by mouse
+bindsym $mod+Left focus left
+bindsym $mod+Down focus down
+bindsym $mod+Up focus up
+bindsym $mod+Right focus right
+focus_follows_mouse no
+
+# move windows
+bindsym $mod+Shift+Left move left
+bindsym $mod+Shift+Down move down
+bindsym $mod+Shift+Up move up
+bindsym $mod+Shift+Right move right
+
+# resize windows
+bindsym $mod+Shift+h resize shrink width 1 ppt
+bindsym $mod+Shift+j resize shrink height 1 ppt
+bindsym $mod+Shift+k resize grow height 1 ppt
+bindsym $mod+Shift+l resize grow width 1 ppt
+
+# toggle fullscreen for focused window
+bindsym $mod+f fullscreen
+
+# toggle floating of window, focus on floating or tabbed windows.
+bindsym $mod+Shift+space floating toggle
+bindsym $mod+space focus mode_toggle
+
+# reload config file
+bindsym $mod+Shift+c reload
+
+# stop wm
+bindsym $mod+Shift+p exit
+
+# switch workspaces
+bindsym $mod+1 workspace 1
+bindsym $mod+2 workspace 2
+bindsym $mod+3 workspace 3
+bindsym $mod+4 workspace 4
+bindsym $mod+5 workspace 5
+bindsym $mod+6 workspace 6
+bindsym $mod+7 workspace 7
+bindsym $mod+8 workspace 8
+bindsym $mod+9 workspace 9
+bindsym $mod+0 workspace 10
+
+# move window to workspace
+bindsym $mod+Shift+1 move workspace 1
+bindsym $mod+Shift+2 move workspace 2
+bindsym $mod+Shift+3 move workspace 3
+bindsym $mod+Shift+4 move workspace 4
+bindsym $mod+Shift+5 move workspace 5
+bindsym $mod+Shift+6 move workspace 6
+bindsym $mod+Shift+7 move workspace 7
+bindsym $mod+Shift+8 move workspace 8
+bindsym $mod+Shift+9 move workspace 9
+bindsym $mod+Shift+0 move workspace 10
--- /dev/null
+#!/usr/bin/env python3
+'Sway bar status line generator.'
+from json import dumps as json_dumps
+from datetime import datetime
+from time import sleep
+
+METADATA = {'version': 1}
+
+
+if __name__ == '__main__':
+ print(json_dumps(METADATA))
+ print('[', end='')
+ while True:
+ print(json_dumps([
+ {'full_text': str(datetime.now().isoformat(' ', 'seconds'))},
+ ]), end=',\n', flush=True)
+ sleep(1)
--- /dev/null
+[user]
+ email = plom@plomlompom.com
+ name = Plom Heller
--- /dev/null
+#!/usr/bin/env python3
+'Simple wrapper for manipulating backlight device brightness file(s).'
+from argparse import ArgumentError, ArgumentParser
+from pathlib import Path
+
+FILENAME_MAX = 'max_brightness'
+FILENAME_TARGET = 'brightness'
+PATH_BACKLIGHTS = '/sys/class/backlight'
+PERCENTAGE_MIN = 0
+PERCENTAGE_MAX = 100
+
+APP_DESC = 'Set backlight strength.'
+ARG_NAME = 'strength'
+ARG_HELP = f'percentage of possible maximum (default: {PERCENTAGE_MAX})'
+ARG_ERR_RANGE = f'must be >={PERCENTAGE_MIN}, <={PERCENTAGE_MAX}'
+
+if __name__ == '__main__':
+ parser = ArgumentParser(description=APP_DESC)
+ arg = parser.add_argument(
+ ARG_NAME,
+ metavar=ARG_NAME.upper(),
+ type=int,
+ nargs='?',
+ default=PERCENTAGE_MAX,
+ help=ARG_HELP
+ )
+ args = parser.parse_args()
+ target_percentage = getattr(args, ARG_NAME)
+ if not PERCENTAGE_MIN <= target_percentage <= PERCENTAGE_MAX:
+ parser.error(str(ArgumentError(arg, ARG_ERR_RANGE)))
+ for path_backlight in Path(PATH_BACKLIGHTS).iterdir():
+ path_max = Path(path_backlight).joinpath(FILENAME_MAX)
+ path_target = Path(path_backlight).joinpath(FILENAME_TARGET)
+ brightness_max = int(path_max.read_text(encoding='utf8'))
+ target_abs = int((target_percentage / 100) * brightness_max)
+ path_target.write_text(f'{target_abs}\n', encoding='utf8')
+ print(f'set {path_backlight} to {target_percentage}% ({target_abs})')
+++ /dev/null
-# because these are included by /etc/sway/config for probably good reason …
-include /etc/sway/config-vars.d/*
-include /etc/sway/config.d/*
-
-# font for wm text
-font pango:Terminus 16px
-
-# force "tabbed" as default layout for new windows
-workspace_layout tabbed
-
-# simple green background
-output * background #559911 solid_color
-
-# keyboard layout
-input * xkb_layout "us"
-
-# deactivate t490s touchpad
-input 1267:47:Elan_Touchpad events disabled
-
-# status bar
-bar {
- position top
- tray_output none
- status_command ~/.config/sway/status.py
-}
-
-# make Windows key modifier key for all wm actions
-set $mod Mod4
-floating_modifier $mod
-
-# move pointer in 1px units
-bindsym --no-repeat $mod+h seat * cursor move -1 0
-bindsym --no-repeat $mod+j seat * cursor move 0 1
-bindsym --no-repeat $mod+k seat * cursor move 0 -1
-bindsym --no-repeat $mod+l seat * cursor move 1 0
-
-# program launcher
-bindsym $mod+x exec wmenu-run
-
-# launch terminal emulator
-bindsym $mod+Return exec foot --font="Courier New:size=14.5"
-
-# kill window
-bindsym $mod+Shift+q kill
-
-# move focus between windows, but not by mouse
-bindsym $mod+Left focus left
-bindsym $mod+Down focus down
-bindsym $mod+Up focus up
-bindsym $mod+Right focus right
-focus_follows_mouse no
-
-# move windows
-bindsym $mod+Shift+Left move left
-bindsym $mod+Shift+Down move down
-bindsym $mod+Shift+Up move up
-bindsym $mod+Shift+Right move right
-
-# resize windows
-bindsym $mod+Shift+h resize shrink width 1 ppt
-bindsym $mod+Shift+j resize shrink height 1 ppt
-bindsym $mod+Shift+k resize grow height 1 ppt
-bindsym $mod+Shift+l resize grow width 1 ppt
-
-# toggle fullscreen for focused window
-bindsym $mod+f fullscreen
-
-# toggle floating of window, focus on floating or tabbed windows.
-bindsym $mod+Shift+space floating toggle
-bindsym $mod+space focus mode_toggle
-
-# reload config file
-bindsym $mod+Shift+c reload
-
-# stop wm
-bindsym $mod+Shift+p exit
-
-# switch workspaces
-bindsym $mod+1 workspace 1
-bindsym $mod+2 workspace 2
-bindsym $mod+3 workspace 3
-bindsym $mod+4 workspace 4
-bindsym $mod+5 workspace 5
-bindsym $mod+6 workspace 6
-bindsym $mod+7 workspace 7
-bindsym $mod+8 workspace 8
-bindsym $mod+9 workspace 9
-bindsym $mod+0 workspace 10
-
-# move window to workspace
-bindsym $mod+Shift+1 move workspace 1
-bindsym $mod+Shift+2 move workspace 2
-bindsym $mod+Shift+3 move workspace 3
-bindsym $mod+Shift+4 move workspace 4
-bindsym $mod+Shift+5 move workspace 5
-bindsym $mod+Shift+6 move workspace 6
-bindsym $mod+Shift+7 move workspace 7
-bindsym $mod+Shift+8 move workspace 8
-bindsym $mod+Shift+9 move workspace 9
-bindsym $mod+Shift+0 move workspace 10
+++ /dev/null
-#!/usr/bin/env python3
-'Sway bar status line generator.'
-from json import dumps as json_dumps
-from datetime import datetime
-from time import sleep
-
-METADATA = {'version': 1}
-
-
-if __name__ == '__main__':
- print(json_dumps(METADATA))
- print('[', end='')
- while True:
- print(json_dumps([
- {'full_text': str(datetime.now().isoformat(' ', 'seconds'))},
- ]), end=',\n', flush=True)
- sleep(1)
+++ /dev/null
-[user]
- email = plom@plomlompom.com
- name = Plom Heller
+++ /dev/null
-#!/usr/bin/env python3
-'Simple wrapper for manipulating backlight device brightness file(s).'
-from argparse import ArgumentError, ArgumentParser
-from pathlib import Path
-
-FILENAME_MAX = 'max_brightness'
-FILENAME_TARGET = 'brightness'
-PATH_BACKLIGHTS = '/sys/class/backlight'
-PERCENTAGE_MIN = 0
-PERCENTAGE_MAX = 100
-
-APP_DESC = 'Set backlight strength.'
-ARG_NAME = 'strength'
-ARG_HELP = f'percentage of possible maximum (default: {PERCENTAGE_MAX})'
-ARG_ERR_RANGE = f'must be >={PERCENTAGE_MIN}, <={PERCENTAGE_MAX}'
-
-if __name__ == '__main__':
- parser = ArgumentParser(description=APP_DESC)
- arg = parser.add_argument(
- ARG_NAME,
- metavar=ARG_NAME.upper(),
- type=int,
- nargs='?',
- default=PERCENTAGE_MAX,
- help=ARG_HELP
- )
- args = parser.parse_args()
- target_percentage = getattr(args, ARG_NAME)
- if not PERCENTAGE_MIN <= target_percentage <= PERCENTAGE_MAX:
- parser.error(str(ArgumentError(arg, ARG_ERR_RANGE)))
- for path_backlight in Path(PATH_BACKLIGHTS).iterdir():
- path_max = Path(path_backlight).joinpath(FILENAME_MAX)
- path_target = Path(path_backlight).joinpath(FILENAME_TARGET)
- brightness_max = int(path_max.read_text(encoding='utf8'))
- target_abs = int((target_percentage / 100) * brightness_max)
- path_target.write_text(f'{target_abs}\n', encoding='utf8')
- print(f'set {path_backlight} to {target_percentage}% ({target_abs})')
+++ /dev/null
-include FNAME_PROFILE
-include msg
-
-augment_profile() {
- local ALIAS_LS='alias ls="ls --color=auto"'
- local PATH_PROFILE="${HOME}/${FNAME_PROFILE}"
- msg 'Augmenting user %s …' "${FNAME_PROFILE}"
- # test ensures idempotency
- grep -qxF "${ALIAS_LS}" "${PATH_PROFILE}" 2>/dev/null\
- || echo "${ALIAS_LS}" >> "${PATH_PROFILE}"
-}
-
--- /dev/null
+include FNAME_PROFILE
+include PATH_REPO
+include msg
+
+link_home() {
+ local PATH_SKEL="${PATH_REPO}/home/$1"
+ local DOT_ALIASFILE='. ${HOME}/.aliases'
+ local PATH_PROFILE="${HOME}/${FNAME_PROFILE}"
+ msg 'Linking %s files into home directory …' "${PATH_SKEL}"
+ find "${PATH_SKEL}" -mindepth 1 -maxdepth 1 | while IFS= read -r SRC; do
+ DEST="${HOME}/$(basename "${SRC}")"
+ if [ -e "${DEST}" ] || [ -L "${DEST}" ]; then
+ msg 'Skipping already-found %s …' "${DEST}"
+ else
+ ln -v -s "${SRC}" "${DEST}"
+ fi
+ done
+ msg 'Augmenting user %s …' "${FNAME_PROFILE}"
+ # test ensures idempotency
+ grep -qxF "${DOT_ALIASFILE}" "${PATH_PROFILE}" 2>/dev/null\
+ || printf '\n%s\n' "${DOT_ALIASFILE}" >> "${PATH_PROFILE}"
+}
include DIRNAME_SCRIPTS
include PATH_REPO
include USERNAME
-include augment_profile
+include link_home
include msg
include retry_until_success
include try_quiet
msg 'Setting system timezone to %s …' "${TIMEZONE}"
timedatectl set-timezone "${TIMEZONE}"
- augment_profile
+ link_home root
}
#!/bin/sh
. "$(dirname "$0")/_lib.sh"
-include PATH_REPO
-include augment_profile
-include msg
+include link_home
-# constants we might want to change at some point
-DIRNAME_HOME_USER=home_user
-
-# constants derived from changeables
-PATH_SKEL_USER="${PATH_REPO}/${DIRNAME_HOME_USER}"
-
-augment_profile
-msg 'Linking %s files into home directory …' "${PATH_SKEL_USER}"
-find "${PATH_SKEL_USER}" -mindepth 1 -maxdepth 1 | while IFS= read -r SRC; do
- DEST="${HOME}/$(basename "${SRC}")"
- if [ -e "${DEST}" ] || [ -L "${DEST}" ]; then
- msg 'Skipping already-found %s …' "${DEST}"
- else
- ln -v -s "${SRC}" "${DEST}"
- fi
-done
+link_home user