Compare commits

..

2 Commits

38 changed files with 2360 additions and 91 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
[[ $EUID -eq 0 ]] || {
echo "root access required" >&2
exit 1
}
MAX_CHARGE_THRESHOLD=$1
[ "$MAX_CHARGE_THRESHOLD" ] \
|| MAX_CHARGE_THRESHOLD=75
DEVICE_SETTING_FILE=/sys/class/power_supply/BAT1/charge_control_end_threshold
[ "$MAX_CHARGE_THRESHOLD" ] && [[ $MAX_CHARGE_THRESHOLD -ge 40 ]] && [[ $MAX_CHARGE_THRESHOLD -le 100 ]] || {
echo -e "Value '$MAX_CHARGE_THRESHOLD' is invalid. If you REALLY want to do this, overwrite the setting yourself\n$DEVICE_SETTING_FILE" >&2
exit 2
}
echo "$MAX_CHARGE_THRESHOLD" > "$DEVICE_SETTING_FILE"

View File

@ -1,6 +1,20 @@
#!/bin/zsh
LAYOUT="$DOTWRYN/bin/$(hostnamectl --static)/default"
[ -f $LAYOUT ] && {
until xrandr -q >/dev/null 2>&1; do sleep .1; done
$LAYOUT
}
[ -f "$LAYOUT" ] \
&& XRANDR_LAYOUT_MODE=manual \
|| XRANDR_LAYOUT_MODE=auto \
;
case $XRANDR_LAYOUT_MODE in
manual )
"$LAYOUT"
;;
auto )
xrandr --auto
;;
esac
unset XRANDR_LAYOUT_MODE
true

View File

@ -9,3 +9,15 @@ primary = #6911aa
secondary = #11bb98
alert = #c80064
disabled = #424253
primary-gradient-0 = #420069
primary-gradient-1 = #490099
primary-gradient-2 = #6911aa
primary-gradient-3 = #8811cc
primary-gradient-4 = #9922dd
secondary-gradient-0 = #006942
secondary-gradient-1 = #009949
secondary-gradient-2 = #00aa79
secondary-gradient-3 = #11bb98
secondary-gradient-4 = #22ccba

1932
config/pikachu/X11/xkeymap Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
include-file = $DOTWRYN/colorschemes/active/polybar.ini
include-file = $HOME/.config/polybar/local.ini
[settings]
screenchange-reload = true
@ -10,8 +11,6 @@ width = 100%
height = 24pt
radius = 0
; dpi = 96
background = ${colors.background}
foreground = ${colors.foreground}
@ -64,7 +63,7 @@ label-urgent-padding = 1
#####################################################################
[bar/i3]
modules-center = tray
modules-center = tray battery0 battery1
[module/tray]
type = internal/tray
@ -72,12 +71,70 @@ type = internal/tray
format-margin = 8pt
tray-spacing = 8pt
[module/backlight]
type = internal/backlight
format = <bar>
[module/battery0]
type = internal/battery
battery = BAT0
interval = 31
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
ramp-capacity-0-foreground = ${colors.alert}
ramp-capacity-1-foreground = ${colors.foreground}
ramp-capacity-2-foreground = ${colors.secondary-gradient-2}
ramp-capacity-3-foreground = ${colors.secondary-gradient-3}
ramp-capacity-4-foreground = ${colors.secondary-gradient-4}
format-charging = <ramp-capacity>
format-discharging = <ramp-capacity>
format-full = <ramp-capacity> <label-full>
format-low = <ramp-capacity> <label-low>
full-at = 74
label-full = c:
label-full-foreground = ${colors.secondary-gradient-4}
low-at = 39
label-low =
label-low-foreground = ${colors.alert}
[module/battery1]
type = internal/battery
battery = BAT1
interval = 31
ramp-capacity-0 =
ramp-capacity-1 =
ramp-capacity-2 =
ramp-capacity-3 =
ramp-capacity-4 =
ramp-capacity-0-foreground = ${colors.alert}
ramp-capacity-1-foreground = ${colors.foreground}
ramp-capacity-2-foreground = ${colors.secondary-gradient-2}
ramp-capacity-3-foreground = ${colors.secondary-gradient-3}
ramp-capacity-4-foreground = ${colors.secondary-gradient-4}
format-charging = <ramp-capacity>
format-discharging = <ramp-capacity>
format-full = <ramp-capacity> <label-full>
format-low = <ramp-capacity> <label-low>
full-at = 74
label-full = c:
label-full-foreground = ${colors.secondary-gradient-4}
low-at = 39
label-low =
label-low-foreground = ${colors.alert}
#####################################################################
### modules-right ###################################################
#####################################################################
[bar/i3]
modules-right = fs memory cpu wlan eth datetime backlight battery
modules-right = fs memory cpu wlan eth datetime backlight
[module/fs]
type = internal/fs
@ -133,19 +190,3 @@ type = custom/script
label-foreground = ${colors.foreground}
interval = 0.5
exec = echo $(date +"%A %B %d, %Y : %I:%M:%S-%P") $(TZ=UTC date +"{%H:%M-UTC}")
[module/backlight]
type = internal/backlight
format = <bar>
[module/battery]
type = internal/battery
interval = 13
format-charging = <bar-capacity>
format-discharging = <bar-capacity>
format-full = <bar-capacity>
format-low = <bar-capacity> <label-low>
low-at = 10
label-low =
label-low-foreground = ${colors.alert}

View File

@ -3,6 +3,9 @@
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx"
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg"

View File

@ -3,6 +3,9 @@
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx" # from local
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg" # from local

View File

@ -3,6 +3,9 @@
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx" # from local
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg" # from local

View File

@ -3,6 +3,9 @@
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx" # from local
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg" # from local

View File

@ -3,6 +3,9 @@
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx" # from local
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg" # from local

View File

@ -0,0 +1,14 @@
#!/bin/zsh
#####################################################################
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=amdgpu_bl1
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx" # from local
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg" # from local
# home server data
export WRYN__SERVER_HOSTNAMES=

View File

@ -3,6 +3,9 @@
### scwrypts runtime configuration (group 'dotwryn') ################
#####################################################################
# enlighten BACKLIGHT_DEVICE (see 'man enlighten')
export DESKTOP__BACKLIGHT_DEVICE=
# directory containing sound effects
export DESKTOP__SFX_PATH="$HOME/Media/sfx" # from local
export DESKTOP__WALLPAPER_PATH="$HOME/Pictures/bg" # from local

View File

@ -0,0 +1,7 @@
#!/bin/zsh
#####################################################################
### scwrypts runtime configuration (group 'remote') #################
#####################################################################
# session name for remote connection (default 'remote')
export REMOTE_TMUX_SESSION=

View File

@ -0,0 +1,51 @@
#!/bin/zsh
#####################################################################
### scwrypts runtime configuration (group 'scwrypts') ###############
#####################################################################
# standard AWS environment variables used by awscli and other tools
export AWS_ACCOUNT=088935110352 # from local
export AWS_PROFILE=yage # from local
export AWS_REGION=us-east-2 # from local
# fully-qualified path to mount the EFS drive
export AWS__EFS__LOCAL_MOUNT_POINT=/mnt/efs/yage # from local
# details for a directus instance
export DIRECTUS__API_TOKEN=
export DIRECTUS__BASE_URL=https://heretic.directus.app # from local
# details for discord bot
export DISCORD__BOT_TOKEN=
export DISCORD__CONTENT_FOOTER=
export DISCORD__CONTENT_HEADER='<@380809228450922507> ' # from local
export DISCORD__DEFAULT_AVATAR_URL=
export DISCORD__DEFAULT_CHANNEL_ID=
export DISCORD__DEFAULT_USERNAME=
export DISCORD__DEFAULT_WEBHOOK=
# linear.app project management configuration
export LINEAR__API_TOKEN=
# s3 bucket name and filesystem targets for media backups
export MEDIA_SYNC__S3_BUCKET=yage # from local
export MEDIA_SYNC__TARGETS=(
Pictures
Documents
Media
.local/.porn
.local/share/dolphin-emu
Games/roms
)
# redis connection credentials
export REDIS_AUTH=
export REDIS_HOST=
export REDIS_PORT=
# twilio account / credentials
export TWILIO__ACCOUNT_SID=ACac926b109b3cd8a78685a2a0994d0271 # from local
export TWILIO__API_KEY=
export TWILIO__API_SECRET=
export TWILIO__DEFAULT_PHONE_FROM=
export TWILIO__DEFAULT_PHONE_TO=

View File

@ -0,0 +1 @@
ACTION=="add", RUN+="/home/w0ryn/.wryn/bin/pikachu/set-battery-max-charge"

View File

@ -0,0 +1 @@
SUBSYSTEM=="backlight", ACTION=="add", RUN+="/usr/bin/env chgrp video %S%p/brightness", RUN+="/usr/bin/env chmod g+w %S%p/brightness"

View File

@ -0,0 +1,40 @@
Section "Files"
ModulePath "/usr/lib/nvidia"
ModulePath "/usr/lib32/nvidia"
ModulePath "/usr/lib32/nvidia/xorg/modules"
ModulePath "/usr/lib32/xorg/modules"
ModulePath "/usr/lib64/nvidia/xorg/modules"
ModulePath "/usr/lib64/nvidia/xorg"
ModulePath "/usr/lib64/xorg/modules"
EndSection
Section "ServerLayout"
Identifier "layout"
Screen 0 "integrated"
Inactive "nvidia"
Option "AllowNVIDIAGPUScreens"
EndSection
Section "Device"
Identifier "integrated"
Driver "modesetting"
BusID "PCI:101:0:0"
Option "DRI" "3"
EndSection
Section "Screen"
Identifier "integrated"
Device "integrated"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:100:0:0"
Option "Coolbits" "28"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
EndSection

View File

@ -0,0 +1,2 @@
Host *
IdentityAgent ~/.1password/agent.sock

View File

@ -0,0 +1,5 @@
PasswordAuthentication no
Match Address 192.168.68.*
PasswordAuthentication yes
Match All

View File

@ -28,7 +28,7 @@ set -g mouse off
set -g status-style fg=brightmagenta,bg=black
set -g window-status-current-style fg=black,bg=brightmagenta
set -g status-right "#(cat /sys/class/power_supply/BAT0/capacity)% | #[fg=magneta]%d %b %R | #(ip address 2>&1 | grep wlp0 | sed -n 's/^.*\\(192.[^/]*\\)\\/.*$/\\1/p') "
set -g status-right "#(cat /sys/class/power_supply/BAT[01]/capacity | head -n1)% | #[fg=magneta]%d %b %R | #(ip address 2>&1 | grep wlp0 | sed -n 's/^.*\\(192.[^/]*\\)\\/.*$/\\1/p') "
#####################################################################

View File

@ -1,3 +1,4 @@
include "%L"
<Multi_key> <n> <n> : "ñ"
<Multi_key> <N> <N> : "Ñ"

View File

@ -21,4 +21,10 @@ done
for XINITRC in $(find /etc/X11/xinit/xinitrc.d); do source "$XINITRC"; done
[ -f "$HOME/.config/X11/xmodmap" ] \
&& xmodmap "$HOME/.config/X11/xmodmap"
[ -f "$HOME/.config/X11/xkeymap" ] \
&& xkbcomp "$HOME/.config/X11/xkeymap" ${DISPLAY}
unset PREFERRED_TERMINAL PREFERRED_BROWSER XINITRC

View File

@ -1,4 +1,5 @@
#!/bin/zsh
export DESKTOP__BACKLIGHT_DEVICE=
export DESKTOP__SFX_PATH=
export DESKTOP__WALLPAPER_PATH=
export WRYN__SERVER_HOSTNAMES=

View File

@ -1,3 +1,4 @@
DESKTOP__BACKLIGHT_DEVICE | enlighten BACKLIGHT_DEVICE (see 'man enlighten')
DESKTOP__SFX_PATH | directory containing sound effects
DESKTOP__DESKTOP_PATH | directory containing desktop background images

View File

@ -1,10 +1,16 @@
---
desktop:
backlight-device:
.DESCRIPTION: >-
enlighten BACKLIGHT_DEVICE (see 'man enlighten')
.ENVIRONMENT: DESKTOP__BACKLIGHT_DEVICE
sfx-path:
.DESCRIPTION: >-
directory containing sound effects
sfx-path:
.ENVIRONMENT: DESKTOP__SFX_PATH
wallpaper-path:
.DESCRIPTION: >-
directory containing wallpaper images
.ENVIRONMENT: DESKTOP__WALLPAPER_PATH
wryn:
.DESCRIPTION: >-

View File

@ -1,5 +1,8 @@
#!/bin/zsh
use desktop/notify --group dotwryn
__CHECK_ENV_VAR DESKTOP__BACKLIGHT_DEVICE --optional
#####################################################################
MAIN() {
@ -11,10 +14,10 @@ MAIN() {
[[ $UTIL =~ ^enlighten$ ]] && {
CURRENT_PERCENT=$(enlighten | sed 's/.*(//;s/%.*//')
[[ $CURRENT_PERCENT -gt 60 ]] && DELTA=20
[[ $CURRENT_PERCENT -le 60 ]] && DELTA=10
[[ $CURRENT_PERCENT -le 40 ]] && DELTA=5
[[ $CURRENT_PERCENT -le 10 ]] && DELTA=1
[[ $CURRENT_PERCENT -gt 60 ]] && DELTA=40
[[ $CURRENT_PERCENT -le 60 ]] && DELTA=20
[[ $CURRENT_PERCENT -le 40 ]] && DELTA=10
[[ $CURRENT_PERCENT -le 10 ]] && DELTA=5
}
case $1 in
@ -25,7 +28,7 @@ MAIN() {
enlighten )
[[ $CURRENT_PERCENT -ge 99 ]] && NOTIFY_SEND 'at maximum brightness' && exit 0
enlighten +${DELTA}%
BACKLIGHT_DEVICE=$DESKTOP__BACKLIGHT_DEVICE enlighten +${DELTA}%
;;
esac
;;
@ -43,7 +46,7 @@ MAIN() {
enlighten )
[[ $CURRENT_PERCENT -le 1 ]] && NOTIFY_SEND 'at minimum brightness' && exit 0
[[ $CURRENT_PERCENT -le 2 ]] && ARGS='=1%' || ARGS="-${DELTA}%"
enlighten "$ARGS"
BACKLIGHT_DEVICE=$DESKTOP__BACKLIGHT_DEVICE enlighten "$ARGS"
;;
esac
;;
@ -52,22 +55,22 @@ MAIN() {
case $UTIL in
xbacklight ) xbacklight -set $2 ;;
gmux_backlight ) gmux_backlight $2 ;;
enlighten ) enlighten "=$2" ;;
enlighten ) BACKLIGHT_DEVICE=$DESKTOP__BACKLIGHT_DEVICE enlighten "=$2" ;;
esac
;;
min | minimum )
case $UTIL in
enlighten ) enlighten '=1%' ;;
enlighten ) BACKLIGHT_DEVICE=$DESKTOP__BACKLIGHT_DEVICE enlighten '=1%' ;;
esac
;;
max | maximum )
case $UTIL in
enlighten ) enlighten '=100%' ;;
enlighten ) BACKLIGHT_DEVICE=$DESKTOP__BACKLIGHT_DEVICE enlighten '=100%' ;;
esac
;;
query | '' )
case $UTIL in
enlighten ) NOTIFY_SUCCESS "current brightness : $(enlighten)" ;;
enlighten ) NOTIFY_SUCCESS "current brightness : $(BACKLIGHT_DEVICE=$DESKTOP__BACKLIGHT_DEVICE enlighten)" ;;
esac
;;

View File

@ -12,6 +12,18 @@ primary = #$(_GET_HEX .polybar.primary .material.base.primary .ansi.
secondary = #$(_GET_HEX .polybar.secondary .material.base.secondary .ansi.blue.regular)
alert = #$(_GET_HEX .polybar.alert .material.base.error .ansi.red.regular)
disabled = #$(_GET_HEX .polybar.disabled .ansi.gray.regular)
primary-gradient-0 = #$(_GET_HEX .polybar.primary-gradient-0 .material.primary.700 .ansi.green.regular)
primary-gradient-1 = #$(_GET_HEX .polybar.primary-gradient-1 .material.primary.600 .ansi.green.regular)
primary-gradient-2 = #$(_GET_HEX .polybar.primary-gradient-2 .material.primary.500 .ansi.green.regular)
primary-gradient-3 = #$(_GET_HEX .polybar.primary-gradient-3 .material.primary.400 .ansi.green.regular)
primary-gradient-4 = #$(_GET_HEX .polybar.primary-gradient-4 .material.primary.300 .ansi.green.regular)
secondary-gradient-0 = #$(_GET_HEX .polybar.secondary-gradient-0 .material.secondary.700 .ansi.blue.regular )
secondary-gradient-1 = #$(_GET_HEX .polybar.secondary-gradient-1 .material.secondary.600 .ansi.blue.regular )
secondary-gradient-2 = #$(_GET_HEX .polybar.secondary-gradient-2 .material.secondary.500 .ansi.blue.regular )
secondary-gradient-3 = #$(_GET_HEX .polybar.secondary-gradient-3 .material.secondary.400 .ansi.blue.regular )
secondary-gradient-4 = #$(_GET_HEX .polybar.secondary-gradient-4 .material.secondary.300 .ansi.blue.regular )
" | sed '$d' > "$_COLORSCHEME_FILE__polybar"
}

View File

@ -0,0 +1,54 @@
#####################################################################
DEPENDENCIES+=(hostnamectl)
REQUIRED_ENV+=(DOTWRYN)
#####################################################################
${SCWRYPTS_MODULE}setup() {
STATUS "configuring system applications"
local \
APPLICATION \
CONFIG \
SOURCE_DIR SOURCE_CONFIG \
SYSTEM_DIR SYSTEM_CONFIG \
;
for SOURCE_DIR in $({
find "${DOTWRYN}/config/system/" -mindepth 1 -maxdepth 1 -type d
find "${DOTWRYN}/config/system/$(hostnamectl --static)/" -mindepth 1 -maxdepth 1 -type d
} 2>/dev/null | sort -u)
do
APPLICATION="$(echo "${SOURCE_DIR}" | sed 's|.*/||')"
case ${APPLICATION} in
( ssh | udev )
SYSTEM_DIR=/etc/${APPLICATION}
;;
( xinit )
SYSTEM_DIR=/etc/X11/xinit/xinitrc.d/
;;
( * )
SYSTEM_DIR=''
;;
esac
[ "${SYSTEM_DIR}" ] && sudo [ -d "${SYSTEM_DIR}" ] \
|| continue
for CONFIG in $(cd -- "${SOURCE_DIR}"; find . -mindepth 1 -type f | sed 's|^\./||')
do
SOURCE_CONFIG="${SOURCE_DIR}/${CONFIG}"
SYSTEM_CONFIG="${SYSTEM_DIR}/${CONFIG}"
sudo [ -f "${SYSTEM_CONFIG}" ] && {
STATUS "already linked '${APPLICATION}/${CONFIG}'"
continue
}
sudo ln -s "${SOURCE_CONFIG}" "${SYSTEM_CONFIG}" \
&& STATUS "linked '${APPLICATION}/${CONFIG}'" \
|| WARNING "cannot link '${APPLICATION}/${CONFIG}'" \
;
done
done
}

View File

@ -0,0 +1,7 @@
#
# provides system setup utilities
#
SCWRYPTS_MODULE=dotwryn.system.
use system/config --group dotwryn

17
scwrypts/dotwryn/system/setup Executable file
View File

@ -0,0 +1,17 @@
#!/bin/zsh
#####################################################################
use system --group dotwryn
#####################################################################
USAGE__description='
sets up links to things like /etc/*.d/ configurations
or systemd services; requires root access
'
#####################################################################
MAIN() {
dotwryn.system.setup
}

View File

@ -65,7 +65,10 @@ MAIN() {
* ) ERROR "unknown argument '$1'" ;;
esac
shift $_S
[[ $_S -le $# ]] \
&& shift $_S \
|| ERROR "missing argument for '$1'" \
|| shift $#
done
CHECK_ERRORS
@ -149,7 +152,9 @@ MAIN() {
[ $BASTION_HOST ] && {
PASSTHROUGH_COMMAND="$(GET_PASSTHROUGH_PREFIX) connect $REMOTE_NAME -- -c $(printf "%q " "$REMOTE_COMMAND")"
DEBUG "REMOTE_COMMAND : $REMOTE_COMMAND"
PASSTHROUGH_COMMAND="$(GET_PASSTHROUGH_PREFIX) connect $REMOTE_NAME --"
[ "$REMOTE_COMMAND" ] && PASSTHROUGH_COMMAND+=" -c $(printf "%q " "$REMOTE_COMMAND")"
BASTION_TARGET=$REMOTE_NAME REMOTE__TARGET=$BASTION_HOST MAIN --command "$PASSTHROUGH_COMMAND"
return $?

View File

@ -1,3 +1,3 @@
GET_PASSTHROUGH_PREFIX() {
echo "SUBSCWRYPT=$((SUBSCWRYPT+1)) SCWRYPTS_LOG_LEVEL=$SCWRYPTS_LOG_LEVEL scwrypts"
echo "source ~/.zshrc &>/dev/null; SUBSCWRYPT=$((SUBSCWRYPT+1)) SCWRYPTS_LOG_LEVEL=$SCWRYPTS_LOG_LEVEL scwrypts"
}

View File

@ -60,7 +60,10 @@ MAIN() {
;;
* ) ERROR "unrecognized argument '$1'" ;;
esac
shift $_S
[[ $_S -le $# ]] \
&& shift $_S \
|| ERROR "missing argument for '$1'" \
|| shift $#
done
[ $CONNECTION_STRING ] \
@ -108,7 +111,7 @@ MAIN() {
CONNECTION_TEST() {
[ $REMOTE_NAME ] && {
[[ $(REMOTE__QUERY_CONNECTION .sessions.$REMOTE_NAME) =~ false ]] && {
[[ $(REMOTE__QUERY_CONNECTION .sessions.$REMOTE_NAME.enabled) =~ false ]] && {
return 1
}
}

View File

@ -1,4 +1,4 @@
#!/bin/zsh
#!/usr/bin/env zsh
#
# works as a standalone zsh script
#

View File

@ -9,7 +9,7 @@ set-window-option -g status-keys vi
setw -gq utf8 on
set -g status-style fg=brightmagenta,bg=black
set -g window-status-current-style fg=black,bg=brightmagenta
set -g status-right "omni host : #(hostnamectl --static) | #(cat /sys/class/power_supply/BAT0/capacity)% "
set -g status-right "omni host : #(hostnamectl --static) | #(cat /sys/class/power_supply/BAT[01]/capacity | head -n1)% "
# navigate between hosts with ALT+window-number
set -g base-index 1

View File

@ -1,6 +1,8 @@
function SETUP__CONFIG() {
STATUS 'starting application configuration'
GENERATE_INITIAL_LOCAL_CONFIG
SCWRYPTS system/config/update || return 1
CONFIG__ZSH || return 2
@ -15,6 +17,23 @@ function SETUP__CONFIG() {
#####################################################################
GENERATE_INITIAL_LOCAL_CONFIG() {
local HOSTNAME="$(hostnamectl --static)"
[ $HOSTNAME ] || return 0
mkdir -p "$DOTWRYN_PATH/bin/$HOSTNAME"
local ENV_DIR="$DOTWRYN_PATH/config/scwrypts/environments"
local GROUP
for GROUP in $(find "$ENV_DIR" -type f -name \*env.yaml | sed -n 's|.*/local\.\([^.]*\)\.env\.yaml|\1|p')
do
[ -f "$ENV_DIR/local.$HOSTNAME.$GROUP.env.yaml" ] \
|| cp "$ENV_DIR/local.altaria.$GROUP.env.yaml" "$ENV_DIR/local.$HOSTNAME.$GROUP.env.yaml"
done
}
#####################################################################
CONFIG__ZSH() {
#CONFIG__ENV zsh || return 1
#CONFIG__RC zsh || return 2
@ -40,47 +59,27 @@ CONFIG__VIM() {
CONFIG__RC vim || return 1
STATUS 'starting vim setup'
SCWRYPTS --name system/vim/vundle/install --group scwrypts --type zsh || return 1
SCWRYPTS --name system/vim/vundle/install --group scwrypts --type zsh || return 2
CONFIG__VIM__LINK_SUPERUSER_RC
return 0
}
CONFIG__VIM__LINK_SUPERUSER_RC() {
sudo [ /root/.vimrc ] && return 0
echo "let $DOTWRYN=\"$DOTWRYN_PATH\"\nsource \"$DOTWRYN_PATH/vim/rc.vim\"" \
| sudo tee /root/.vimrc >/dev/null
sudo mkdir -p /root/.vim
sudo ln -s /home/w0ryn/.vim/bundle /root/.vim/bundle
}
#####################################################################
CONFIG__SYSTEM() {
STATUS "configuring system applications"
local \
SYSTEM_APPLICATION \
SOURCE_DIR SOURCE_CONFIG \
SYSTEM_DIR SYSTEM_CONFIG \
;
for SOURCE_DIR in $(find "$DOTWRYN_PATH/config/system/" -mindepth 1 -maxdepth 1 -type d)
do
SYSTEM_APPLICATION="$(echo "$SOURCE_DIR" | sed 's|.*/||')"
case $SYSTEM_APPLICATION in
( ssh | sshd )
SYSTEM_DIR=/etc/ssh/${SYSTEM_APPLICATION}_config.d
;;
( * )
SYSTEM_DIR=''
;;
esac
[ "$SYSTEM_DIR" ] && sudo [ -d "$SYSTEM_DIR" ] \
|| continue
for SOURCE_CONFIG in $(find "$SOURCE_DIR" -mindepth 1 -maxdepth 1 -type f)
do
SYSTEM_CONFIG="$SYSTEM_DIR/$(basename -- "$SOURCE_CONFIG")"
sudo [ -f "$SYSTEM_CONFIG" ] && {
echo "detected existing config '$SYSTEM_CONFIG'; skipping"
continue
}
sudo ln -s "$SOURCE_CONFIG" "$SYSTEM_CONFIG"
done
done
SCWRYPTS dotwryn system setup
}
#####################################################################

View File

@ -97,17 +97,14 @@ INSTALL_MANAGED__arch() {
return 0
}
STATUS "checking for $TARGET"
yay -Qq | grep -q "^$TARGET$\|^$TARGET-git$" && {
SUCCESS "found installation of '$TARGET'"
yay -Qq 2>/dev/null | grep -q "^$TARGET$\|^$TARGET-git$" && {
SUCCESS "found '$TARGET'"
} || {
WARNING "'$TARGET' not found"
STATUS "installing '$TARGET'"
yay -Syu --noconfirm $TARGET \
&& SUCCESS "successfully installed '$TARGET'" \
|| ERROR "failed to install '$TARGET'"
|| ERROR "failed to install '$TARGET'" \
;
}
}

View File

@ -23,14 +23,14 @@ source ./requirements.zsh || exit 1
LOGFILE="$HOME/dotwryn-install.log"
INFO "installation start : $(date)" 2>> "$LOGFILE"
STATUS "installation start : $(date)" 2>> "$LOGFILE"
{
SETUP__OS || FAIL 1 'failed to set up os-dependencies (see above)'
SETUP__GIT || FAIL 2 'failed to set up git (see above)'
SETUP__CONFIG || FAIL 3 'failed to set up program configuration (see above)'
} 2>&1 | tee --append "$LOGFILE"
INFO "installation complete: $(date)" 2>> "$LOGFILE"
STATUS "installation complete: $(date)" 2>> "$LOGFILE"
################################################################################
yN 'keep logfile?' \