diff --git a/config/bin/i3-utils b/config/bin/i3-utils index 1b93ac0..3d0dc15 100755 --- a/config/bin/i3-utils +++ b/config/bin/i3-utils @@ -14,7 +14,8 @@ export DESKTOP__SFX_PATH="${HOME}/Media/sfx" export SCWRYPTS_LOG_LEVEL=0 case $(hostnamectl --static) in ( pikachu ) - export DESKTOP__BACKLIGHT_DEVICE=amdgpu_bl1 + export DESKTOP__BACKLIGHT_DEVICE=xrandr-fake-brightness + export XRANDR_TARGET=DP-2 ;; esac diff --git a/config/colorschemes/active/getty.sh b/config/colorschemes/active/getty.sh index f82e415..e7666bf 100644 --- a/config/colorschemes/active/getty.sh +++ b/config/colorschemes/active/getty.sh @@ -1,11 +1,11 @@ #!/bin/sh # do not edit; generated by scwrypts -# theme : winter +# theme : main # # source this file to apply colorscheme to linux getty # [[ "$TERM" =~ ^linux$ ]] || return 0 -/bin/echo -e " ]P0000505 ]P1d11455 ]P2906556 ]P300ffe7 ]P43d8890 ]P57b70af ]P650a3b5 ]P7d0f0f0 ]P8f48bae ]P9cfb8af ]PA8bfff4 ]PB1abcdd ]PC7d72fe ]PD86abb3 ]PEd0f0f0 ]PF7e707e " +/bin/echo -e " ]P0000505 ]P1c80064 ]P211bb98 ]P36911aa ]P42262bb ]P59922dd ]P622ccba ]P7d0f0f0 ]P8ff44ff ]P944dddd ]PAaa44ff ]PB229df6 ]PCdd88ff ]PD88ffff ]PEd0f0f0 ]PF7e707e " [ ! $NO_CLEAR ] && clear return 0 sed $d diff --git a/config/colorschemes/active/name.txt b/config/colorschemes/active/name.txt index 53a94ed..ba2906d 100644 --- a/config/colorschemes/active/name.txt +++ b/config/colorschemes/active/name.txt @@ -1 +1 @@ -winter +main diff --git a/config/colorschemes/active/rofi.rasi b/config/colorschemes/active/rofi.rasi index 92e0403..aba6a98 100644 --- a/config/colorschemes/active/rofi.rasi +++ b/config/colorschemes/active/rofi.rasi @@ -1,14 +1,14 @@ /** * do not edit; generated by scwrypts - * theme : winter + * theme : main **/ *{ - background: #100906; + background: #001129; foreground: #d0f0f0; - background-alt: #007469; - foreground-alt: #d0f0f0; - selected: #d0f0f0; - active: #00ffe7; - urgent: #d11455; + background-alt: #9922dd; + foreground-alt: #000505; + selected: #000505; + active: #6911aa; + urgent: #c80064; } diff --git a/config/colorschemes/active/source.yaml b/config/colorschemes/active/source.yaml index fda9106..edf1e6f 120000 --- a/config/colorschemes/active/source.yaml +++ b/config/colorschemes/active/source.yaml @@ -1 +1 @@ -../winter.yaml \ No newline at end of file +../main.yaml \ No newline at end of file diff --git a/config/local/pikachu/user/alacritty/local.toml b/config/local/pikachu/user/alacritty/local.toml index a1657e3..73b24ae 100644 --- a/config/local/pikachu/user/alacritty/local.toml +++ b/config/local/pikachu/user/alacritty/local.toml @@ -1,2 +1,2 @@ [font] -size = 9.9 +size = 9 diff --git a/config/scwrypts/config.zsh b/config/scwrypts/config.zsh index a8a1b66..5eeb321 100644 --- a/config/scwrypts/config.zsh +++ b/config/scwrypts/config.zsh @@ -10,7 +10,11 @@ SCWRYPTS_SHORTCUT='' # CTRL + W SCWRYPTS_GENERATOR__SHOW_HELP=false [ ${DOTWRYN} ] || source "${HOME}/.zshrc" -SCWRYPTS_GROUP_DIRS+=("${DOTWRYN}/scwrypts") +SCWRYPTS_GROUP_DIRS+=( + "${DOTWRYN}/scwrypts" + "${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code/yage/home" + "${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code/yage/ttf-pokemoji" +) [ -f "${XDG_CONFIG_HOME:-${HOME}/.config}/scwrypts/config.local.zsh" ] \ && source "${XDG_CONFIG_HOME:-${HOME}/.config}/scwrypts/config.local.zsh" diff --git a/config/user/alacritty/theme.toml b/config/user/alacritty/theme.toml index 948140f..122b18e 100644 --- a/config/user/alacritty/theme.toml +++ b/config/user/alacritty/theme.toml @@ -1,7 +1,7 @@ # do not edit; generated by scwrypts -# theme : winter +# theme : main [colors.cursor] -cursor = '0xe8fffd' +cursor = '0xeeddff' [colors.primary] background = '0x000505' @@ -9,20 +9,20 @@ foreground = '0xd0f0f0' [colors.normal] black = '0x000505' -red = '0xd11455' -green = '0x906556' -yellow = '0x00ffe7' -blue = '0x3d8890' -magenta = '0x7b70af' -cyan = '0x50a3b5' +red = '0xc80064' +green = '0x11bb98' +yellow = '0x6911aa' +blue = '0x2262bb' +magenta = '0x9922dd' +cyan = '0x22ccba' white = '0xd0f0f0' [colors.bright] black = '0x424253' -red = '0xf48bae' -green = '0xcfb8af' -yellow = '0x8bfff4' -blue = '0x1abcdd' -magenta = '0x7d72fe' -cyan = '0x86abb3' +red = '0xff44ff' +green = '0x44dddd' +yellow = '0xaa44ff' +blue = '0x229df6' +magenta = '0xdd88ff' +cyan = '0x88ffff' white = '0x7e707e' diff --git a/config/user/flameshot/flameshot.ini b/config/user/flameshot/flameshot.ini index f406c89..be84e60 100644 --- a/config/user/flameshot/flameshot.ini +++ b/config/user/flameshot/flameshot.ini @@ -1,6 +1,6 @@ [General] contrastOpacity=188 -contrastUiColor=#a97f6f +contrastUiColor=#11bb98 disabledTrayIcon=false drawColor=#d11455 drawFontSize=13 @@ -11,10 +11,10 @@ saveAsFileExtension=png savePath=/home/w0ryn/Pictures/screenshot showSidePanelButton=false showStartupLaunchMessage=false -uiColor=#00d1bd +uiColor=#490099 undoLimit=100 uploadClientSecret= -userColors=picker, #8bfff4, #00ffe7, #007469, #cfb8af, #906556, #30221d, #d11455, #f48bae, #d0f0f0 +userColors=picker, #aa44ff, #6911aa, #220069, #44dddd, #00aa79, #006922, #c80064, #ff44ff, #d0f0f0 [Shortcuts] TYPE_ARROW=E diff --git a/config/user/git/config b/config/user/git/config index 4279fee..bb3365c 100644 --- a/config/user/git/config +++ b/config/user/git/config @@ -55,3 +55,8 @@ [format] signoff = true +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + process = git-lfs filter-process + required = true diff --git a/config/user/kitty/theme.conf b/config/user/kitty/theme.conf index 2497b8e..634caf5 100644 --- a/config/user/kitty/theme.conf +++ b/config/user/kitty/theme.conf @@ -1,22 +1,22 @@ # do not edit; generated by scwrypts -# theme : winter +# theme : main color0 #000505 -color1 #d11455 -color2 #906556 -color3 #00ffe7 -color4 #3d8890 -color5 #7b70af -color6 #50a3b5 +color1 #c80064 +color2 #11bb98 +color3 #6911aa +color4 #2262bb +color5 #9922dd +color6 #22ccba color7 #d0f0f0 color8 #424253 -color9 #f48bae -color10 #cfb8af -color11 #8bfff4 -color12 #1abcdd -color13 #7d72fe -color14 #86abb3 +color9 #ff44ff +color10 #44dddd +color11 #aa44ff +color12 #229df6 +color13 #dd88ff +color14 #88ffff color15 #7e707e -cursor #e8fffd +cursor #eeddff background #000505 foreground #d0f0f0 selection_background # diff --git a/config/user/polybar/theme.ini b/config/user/polybar/theme.ini index 31ec848..0356788 100644 --- a/config/user/polybar/theme.ini +++ b/config/user/polybar/theme.ini @@ -1,23 +1,23 @@ # do not edit; generated by scwrypts -# theme : winter +# theme : main [colors] background = #000505 foreground = #d0f0f0 -background-alt = #007469 +background-alt = #6911aa foreground-alt = #d0f0f0 -primary = #00ffe7 -secondary = #906556 -alert = #d11455 +primary = #6911aa +secondary = #11bb98 +alert = #c80064 disabled = #424253 -primary-gradient-0 = #00a293 -primary-gradient-1 = #00d1bd -primary-gradient-2 = #00ffe7 -primary-gradient-3 = #2effec -primary-gradient-4 = #5dfff0 +primary-gradient-0 = #420069 +primary-gradient-1 = #490099 +primary-gradient-2 = #6911aa +primary-gradient-3 = #8811cc +primary-gradient-4 = #9922dd -secondary-gradient-0 = #503830 -secondary-gradient-1 = #704f43 -secondary-gradient-2 = #906556 -secondary-gradient-3 = #a97f6f -secondary-gradient-4 = #bc9b8f +secondary-gradient-0 = #006942 +secondary-gradient-1 = #009949 +secondary-gradient-2 = #00aa79 +secondary-gradient-3 = #11bb98 +secondary-gradient-4 = #22ccba diff --git a/config/xinitrc.common b/config/xinitrc.common index d732472..186c712 100644 --- a/config/xinitrc.common +++ b/config/xinitrc.common @@ -6,8 +6,8 @@ for PREFERRED_TERMINAL in \ kitty \ ; do - command -v $PREFERRED_TERMINAL &>/dev/null \ - && export TERMINAL="$(which $PREFERRED_TERMINAL)" \ + command -v ${PREFERRED_TERMINAL} &>/dev/null \ + && export TERMINAL="$(which ${PREFERRED_TERMINAL})" \ && break done unset PREFERRED_TERMINAL @@ -21,22 +21,22 @@ for PREFERRED_BROWSER in \ google-chrome \ ; do - command -v $PREFERRED_BROWSER &>/dev/null \ - && export BROWSER="$(which $PREFERRED_BROWSER)" \ + command -v ${PREFERRED_BROWSER} &>/dev/null \ + && export BROWSER="$(which ${PREFERRED_BROWSER})" \ && break done unset PREFERRED_BROWSER ##################################################################### -for XINITRC_FILE in $(find /etc/X11/xinit/xinitrc.d | sort); do source "$XINITRC_FILE"; done +for XINITRC_FILE in $(find /etc/X11/xinit/xinitrc.d | sort); do source "${XINITRC_FILE}"; done unset XINITRC_FILE -[ -f "$HOME/.config/X11/xmodmap" ] \ - && xmodmap "$HOME/.config/X11/xmodmap" +[ -f "${XDG_CONFIG_HOME:=${HOME}/.config}/X11/xmodmap" ] \ + && xmodmap "${XDG_CONFIG_HOME}/X11/xmodmap" -[ -f "$HOME/.config/X11/xkeymap" ] \ - && xkbcomp "$HOME/.config/X11/xkeymap" ${DISPLAY} +[ -f "${XDG_CONFIG_HOME}/X11/xkeymap" ] \ + && xkbcomp "${XDG_CONFIG_HOME}/X11/xkeymap" ${DISPLAY} ##################################################################### diff --git a/scwrypts/dotwryn/desktop/xorg/backlight b/scwrypts/dotwryn/desktop/xorg/backlight index 52fed58..8e4089d 100755 --- a/scwrypts/dotwryn/desktop/xorg/backlight +++ b/scwrypts/dotwryn/desktop/xorg/backlight @@ -14,6 +14,10 @@ MAIN() { command -v ${UTIL} >/dev/null 2>&1 && break done + case ${DESKTOP__BACKLIGHT_DEVICE} in + ( xrandr-fake-brightness ) UTIL=xrandr ;; + esac + [[ ${UTIL} =~ ^enlighten$ ]] && { CURRENT_PERCENT=$(BACKLIGHT_DEVICE=${DESKTOP__BACKLIGHT_DEVICE} enlighten | sed 's/.*(//;s/%.*//') [[ ${CURRENT_PERCENT} -gt 60 ]] && DELTA=40 @@ -22,6 +26,22 @@ MAIN() { [[ ${CURRENT_PERCENT} -le 10 ]] && DELTA=5 } + local UP DOWN + [[ ${UTIL} =~ ^xrandr$ ]] && { + [[ "${XRANDR_TARGET[@]}" ]] \ + || XRANDR_TARGET=$(xrandr | grep ' connected' | awk '{print $1;}') + + CURRENT_BRIGHTNESS=$(xrandr --verbose | grep Brightness | awk '{print $2;}' | head -n1) + + [[ ${CURRENT_BRIGHTNESS} -gt 0.80 ]] && { UP=1.00; DOWN=0.80; } + [[ ${CURRENT_BRIGHTNESS} -le 0.80 ]] && { UP=1.00; DOWN=0.60; } + [[ ${CURRENT_BRIGHTNESS} -le 0.60 ]] && { UP=0.80; DOWN=0.40; } + [[ ${CURRENT_BRIGHTNESS} -le 0.40 ]] && { UP=0.60; DOWN=0.20; } + [[ ${CURRENT_BRIGHTNESS} -le 0.20 ]] && { UP=0.40; DOWN=0.10; } + [[ ${CURRENT_BRIGHTNESS} -le 0.10 ]] && { UP=0.20; DOWN=0.05; } + [[ ${CURRENT_BRIGHTNESS} -le 0.05 ]] && { UP=0.10; DOWN=0.05; } + } + case $1 in up ) case ${UTIL} in @@ -32,6 +52,8 @@ MAIN() { [[ ${CURRENT_PERCENT} -ge 99 ]] && notify.status 'at maximum brightness' && exit 0 BACKLIGHT_DEVICE=${DESKTOP__BACKLIGHT_DEVICE} enlighten +${DELTA}% ;; + + ( xrandr ) xrandr --output ${XRANDR_TARGET} --brightness ${UP} ;; esac ;; down ) @@ -50,6 +72,8 @@ MAIN() { [[ ${CURRENT_PERCENT} -le 2 ]] && ARGS='=1%' || ARGS="-${DELTA}%" BACKLIGHT_DEVICE=${DESKTOP__BACKLIGHT_DEVICE} enlighten "${ARGS}" ;; + + ( xrandr ) xrandr --output ${XRANDR_TARGET} --brightness ${DOWN} ;; esac ;; set ) diff --git a/scwrypts/dotwryn/desktop/xorg/xrandr/disconnect-all b/scwrypts/dotwryn/desktop/xorg/xrandr/disconnect-all index ddbb1fc..9354a2d 100755 --- a/scwrypts/dotwryn/desktop/xorg/xrandr/disconnect-all +++ b/scwrypts/dotwryn/desktop/xorg/xrandr/disconnect-all @@ -1,5 +1,5 @@ #!/bin/zsh -use desktop/xorg/xrandr --group dotwryn +use --group dotwryn desktop/xorg/xrandr ##################################################################### MAIN() { diff --git a/scwrypts/dotwryn/office/memo/memo.module.zsh b/scwrypts/dotwryn/office/memo/memo.module.zsh index df7a381..222e43c 100644 --- a/scwrypts/dotwryn/office/memo/memo.module.zsh +++ b/scwrypts/dotwryn/office/memo/memo.module.zsh @@ -12,4 +12,4 @@ MEMO__DIR="$SCWRYPTS_DATA_PATH/memo" [ ! -d $MEMO__DIR ] && mkdir -p $MEMO__DIR -MEMO__LIST_ALL() { ls $MEMO__DIR | sed "s/\.$MEMO__FILETYPE$//" | sort; } +${scwryptsmodule}.list-all() { ls $MEMO__DIR | sed "s/\.$MEMO__FILETYPE$//" | sort; } diff --git a/scwrypts/dotwryn/office/memo/open b/scwrypts/dotwryn/office/memo/open index ca96ea2..85e3db6 100755 --- a/scwrypts/dotwryn/office/memo/open +++ b/scwrypts/dotwryn/office/memo/open @@ -1,14 +1,16 @@ #!/usr/bin/env zsh -use office/memo +use --group dotwryn office/memo ##################################################################### MAIN() { - local MEMO_NAME=$(MEMO__LIST_ALL | FZF_USER_INPUT 'select/create a memo') - [ ! "$MEMO_NAME" ] && user.abort + local MEMO_NAME=$(dotwryn.office.memo.list-all | utils.fzf.user-input 'select/create a memo') + [ "${MEMO_NAME}" ] || utils.abort - MEMO_FILE="$MEMO__DIR/$MEMO_NAME.$MEMO__FILETYPE" + echo.debug -v MEMO_NAME - [ ! -f $MEMO_FILE ] && { + MEMO_FILE="${MEMO__DIR}/${MEMO_NAME}.${MEMO__FILETYPE}" + + [ ! -f ${MEMO_FILE} ] && { echo.status "creating memo '$MEMO_NAME'" echo "# $MEMO_NAME" > "$MEMO_FILE" \ && echo.success "created memo '$MEMO_NAME'" \ @@ -19,5 +21,5 @@ MAIN() { DATESTRING="## $(date '+%A, %B %-d, %Y')" grep -q "$DATESTRING" "$MEMO_FILE" || echo "$DATESTRING" >> "$MEMO_FILE" - utils.io.edit "$MEMO_FILE" + utils.io.edit "${MEMO_FILE}" } diff --git a/scwrypts/dotwryn/system/setup b/scwrypts/dotwryn/system/setup index 9cc0deb..3a909f0 100755 --- a/scwrypts/dotwryn/system/setup +++ b/scwrypts/dotwryn/system/setup @@ -1,7 +1,7 @@ #!/bin/zsh ##################################################################### -use system --group dotwryn +use --group dotwryn system ##################################################################### diff --git a/scwrypts/dotwryn/system/system.module.zsh b/scwrypts/dotwryn/system/system.module.zsh index 2364fac..0e17102 100644 --- a/scwrypts/dotwryn/system/system.module.zsh +++ b/scwrypts/dotwryn/system/system.module.zsh @@ -4,12 +4,12 @@ # symlinks to source-controlled configurations -use system/symlinks --group dotwryn +use --group dotwryn system/symlinks # compile source-controlled terminfo files -use system/terminfo --group dotwryn +use --group dotwryn system/terminfo # common argument parsing -use system/zshparse --group dotwryn +use --group dotwryn system/zshparse diff --git a/scwrypts/media/.config/env.yaml b/scwrypts/media/.config/env.yaml index 024b499..97d0e5f 100644 --- a/scwrypts/media/.config/env.yaml +++ b/scwrypts/media/.config/env.yaml @@ -6,3 +6,7 @@ media-sync: .ENVIRONMENT: MEDIA_SYNC__S3_BUCKET targets: .ENVIRONMENT: MEDIA_SYNC__TARGETS + +mscore: + scores-path: + .ENVIRONMENT: MSCORE__SCORES_PATH diff --git a/scwrypts/media/audio/play-sfx b/scwrypts/media/audio/play-sfx index 090c433..8aa81a1 100755 --- a/scwrypts/media/audio/play-sfx +++ b/scwrypts/media/audio/play-sfx @@ -1,7 +1,7 @@ #!/usr/bin/env zsh ##################################################################### -use audio/play-sfx --group media +use --group media audio/play-sfx ##################################################################### diff --git a/scwrypts/media/audio/pulseaudio/volume b/scwrypts/media/audio/pulseaudio/volume index 823037a..70cde32 100755 --- a/scwrypts/media/audio/pulseaudio/volume +++ b/scwrypts/media/audio/pulseaudio/volume @@ -1,7 +1,7 @@ #!/bin/zsh ##################################################################### -use audio/pulseaudio/volume --group media +use --group media audio/pulseaudio/volume ##################################################################### diff --git a/scwrypts/media/audio/pulseaudio/volume.module.zsh b/scwrypts/media/audio/pulseaudio/volume.module.zsh index 852f39c..ea4cc94 100644 --- a/scwrypts/media/audio/pulseaudio/volume.module.zsh +++ b/scwrypts/media/audio/pulseaudio/volume.module.zsh @@ -2,7 +2,7 @@ ##################################################################### use notify -use audio/play-sfx --group media +use --group media audio/play-sfx DEPENDENCIES+=(pactl) diff --git a/scwrypts/media/cloud/cloud.module.zsh b/scwrypts/media/cloud/cloud.module.zsh index 752776d..3fd3c3e 100644 --- a/scwrypts/media/cloud/cloud.module.zsh +++ b/scwrypts/media/cloud/cloud.module.zsh @@ -4,11 +4,11 @@ # synchronize cloud media with configured targets -use cloud/synchronize --group media +use --group media cloud/synchronize # synchronize cloud media with a specific target -use cloud/synchronize-target --group media +use --group media cloud/synchronize-target # common parsers -use cloud/zshparse --group media +use --group media cloud/zshparse diff --git a/scwrypts/media/cloud/synchronize b/scwrypts/media/cloud/synchronize index c87a519..788a82e 100755 --- a/scwrypts/media/cloud/synchronize +++ b/scwrypts/media/cloud/synchronize @@ -1,7 +1,7 @@ #!/usr/bin/env zsh ##################################################################### -use cloud --group media +use --group media cloud ##################################################################### diff --git a/scwrypts/media/cloud/synchronize-target.module.zsh b/scwrypts/media/cloud/synchronize-target.module.zsh index 9976cd8..ef30486 100644 --- a/scwrypts/media/cloud/synchronize-target.module.zsh +++ b/scwrypts/media/cloud/synchronize-target.module.zsh @@ -3,7 +3,7 @@ REQUIRED_ENV+=(MEDIA_SYNC__S3_BUCKET) use cloud/aws -use cloud/zshparse/actions --group media +use --group media cloud/zshparse/actions ##################################################################### diff --git a/scwrypts/media/cloud/synchronize.module.zsh b/scwrypts/media/cloud/synchronize.module.zsh index d582839..3c135bc 100644 --- a/scwrypts/media/cloud/synchronize.module.zsh +++ b/scwrypts/media/cloud/synchronize.module.zsh @@ -2,8 +2,8 @@ REQUIRED_ENV+=(MEDIA_SYNC__TARGETS) -use cloud/synchronize-target --group media -use cloud/zshparse/actions --group media +use --group media cloud/synchronize-target +use --group media cloud/zshparse/actions ##################################################################### diff --git a/scwrypts/media/cloud/zshparse/zshparse.module.zsh b/scwrypts/media/cloud/zshparse/zshparse.module.zsh index f65d08c..32fef15 100644 --- a/scwrypts/media/cloud/zshparse/zshparse.module.zsh +++ b/scwrypts/media/cloud/zshparse/zshparse.module.zsh @@ -2,4 +2,4 @@ # common parsers for cloud media synchronization # -use cloud/zshparse/actions --group media +use --group media cloud/zshparse/actions diff --git a/scwrypts/media/ffmpeg/ffmpeg.module.zsh b/scwrypts/media/ffmpeg/ffmpeg.module.zsh index 3b5d48c..a94f1c3 100644 --- a/scwrypts/media/ffmpeg/ffmpeg.module.zsh +++ b/scwrypts/media/ffmpeg/ffmpeg.module.zsh @@ -5,5 +5,5 @@ DEPENDENCIES+=(ffmpeg) -use ffmpeg/get-audio-clip-from-video --group media -use ffmpeg/get-video-length-seconds --group media +use --group media ffmpeg/get-audio-clip-from-video +use --group media ffmpeg/get-video-length-seconds diff --git a/scwrypts/media/ffmpeg/get-audio-clip-from-video.module.zsh b/scwrypts/media/ffmpeg/get-audio-clip-from-video.module.zsh index 958683e..c90d77c 100644 --- a/scwrypts/media/ffmpeg/get-audio-clip-from-video.module.zsh +++ b/scwrypts/media/ffmpeg/get-audio-clip-from-video.module.zsh @@ -2,7 +2,7 @@ DEPENDENCIES+=(ffmpeg) -use ffmpeg/get-video-length-seconds --group media +use --group media ffmpeg/get-video-length-seconds ##################################################################### diff --git a/scwrypts/media/mscore/cli.module.zsh b/scwrypts/media/mscore/cli.module.zsh new file mode 100644 index 0000000..15e37c5 --- /dev/null +++ b/scwrypts/media/mscore/cli.module.zsh @@ -0,0 +1,9 @@ +##################################################################### + +DEPENDENCIES+=(mscore) + +##################################################################### + +${scwryptsmodule}.cli() { + QT_QPA_PLATFORM=offscreen mscore $@ +} diff --git a/scwrypts/media/mscore/mscore.module.zsh b/scwrypts/media/mscore/mscore.module.zsh new file mode 100644 index 0000000..0c0a0df --- /dev/null +++ b/scwrypts/media/mscore/mscore.module.zsh @@ -0,0 +1,14 @@ +# +# render / upload tools for MuseScore +# + +# context wrapper for MuseScore CLI +use --group media mscore/cli +eval "${scwryptsmodule}() { ${scwryptsmodule}.cli \$@; }" + +# render pdf from MuseScore file +use --group media mscore/render + + +# common parsers +use --group media mscore/zshparse diff --git a/scwrypts/media/mscore/render.module.zsh b/scwrypts/media/mscore/render.module.zsh new file mode 100644 index 0000000..9cbec23 --- /dev/null +++ b/scwrypts/media/mscore/render.module.zsh @@ -0,0 +1,23 @@ +##################################################################### + +use --group media mscore/cli +use --group media mscore/zshparse/filename + +##################################################################### + + +${scwryptsmodule}.pdf() { + eval "$(USAGE.reset)" + + local \ + MSCORE_FILENAME \ + PARSERS=( + media.mscore.zshparse.filename + ) + + eval "$ZSHPARSEARGS" + + ########################################## + + +} diff --git a/scwrypts/media/mscore/zshparse/filename.module.zsh b/scwrypts/media/mscore/zshparse/filename.module.zsh new file mode 100644 index 0000000..0c6dd8e --- /dev/null +++ b/scwrypts/media/mscore/zshparse/filename.module.zsh @@ -0,0 +1,72 @@ +REQUIRED_ENV+=(MSCORE__SCORES_PATH) + +${scwryptsmodule}() { + # local MSCORE_FILENAME + local PARSED=0 + + case $1 in + ( --filename ) + PARSED=2 + MSCORE_FILENAME="$2" + ;; + esac + + return $PARSED +} + +##################################################################### + +${scwryptsmodule}.usage() { + USAGE__options+=" + --filename a valid mscore filename + " +} + +${scwryptsmodule}.validate() { + case "${MSCORE_FILENAME}" in + ( '' ) + MSCORE__SCORES_PATH + MSCORE_FILENAME="$(cd "${MSCORE__SCORES_PATH}"; find . -type f | grep '\.msc[zx]$' | utils.fzf 'select a score')" + + [ "${MSCORE_FILENAME}" ] && [ -f "${MSCORE__SCORES_PATH}/${MSCORE_FILENAME}" ] \ + || ERROR "invalid score '${MSCORE_FILENAME}'" + + MSCORE_FILENAME="${MSCORE__SCORES_PATH}/${MSCORE_FILENAME}" + ;; + + ( * ) + [ -f "${MSCORE_FILENAME}" ] \ + || ERROR "no score '${MSCORE_FILENAME}' exists" + ;; + esac + + [[ ${ERRORS} -eq 0 ]] || return + + local TEMP_PATH="${SCWRYPTS_TEMP_PATH}/mscore" + local MSCORE_BASENAME="$(basename -- ${MSCORE_FILENAME} | sed 's/\.[^.]*$//')" + local TEMP_FILE="${TEMP_PATH}/${MSCORE_BASENAME}.mscx" + + case "${MSCORE_FILENAME}" in + ( *.mscz ) + mkdir -p "${TEMP_PATH}/zip" + { + cp "${MSCORE_FILENAME}" "${TEMP_PATH}/zip/${MSCORE_BASENAME}.zip" + cd "${TEMP_PATH}/zip" + unzip "${MSCORE_BASENAME}.zip" + cp "./${MSCORE_BASENAME}.mscx" "${TEMP_FILE}" + } + ;; + + ( *.mscx ) + mkdir -p "${TEMP_PATH}" + cp "${MSCORE_FILENAME}" "${TEMP_FILE}" + ;; + esac + + [ -f "${TEMP_FILE}" ] \ + && MSCORE_FILENAME="${TEMP_FILE}" \ + || ERROR "failed to extract '${TEMP_FILE}'" \ + || MSCORE_FILENAME='' \ + ; + +} diff --git a/scwrypts/media/mscore/zshparse/zshparse.module.zsh b/scwrypts/media/mscore/zshparse/zshparse.module.zsh new file mode 100644 index 0000000..5e3b04e --- /dev/null +++ b/scwrypts/media/mscore/zshparse/zshparse.module.zsh @@ -0,0 +1,6 @@ +# +# common parsers for MuseScore actions +# + +# helpers to get/select filenames for MuseScore +use --group media mscore/zshparse/filename diff --git a/scwrypts/media/youtube/download b/scwrypts/media/youtube/download index e912d42..7d4127c 100755 --- a/scwrypts/media/youtube/download +++ b/scwrypts/media/youtube/download @@ -1,7 +1,7 @@ #!/bin/zsh ##################################################################### -use youtube --group media +use --group media youtube ##################################################################### diff --git a/scwrypts/media/youtube/download.module.zsh b/scwrypts/media/youtube/download.module.zsh index 01184c4..03eb4ad 100644 --- a/scwrypts/media/youtube/download.module.zsh +++ b/scwrypts/media/youtube/download.module.zsh @@ -1,8 +1,8 @@ ##################################################################### -use youtube/yt-dlp --group media -use youtube/get-filename --group media -use youtube/get-download-path --group media +use --group media youtube/yt-dlp +use --group media youtube/get-filename +use --group media youtube/get-download-path ##################################################################### diff --git a/scwrypts/media/youtube/get-audio-clip b/scwrypts/media/youtube/get-audio-clip index 259e4c8..784d3fd 100755 --- a/scwrypts/media/youtube/get-audio-clip +++ b/scwrypts/media/youtube/get-audio-clip @@ -1,7 +1,7 @@ #!/bin/zsh -use ffmpeg/get-audio-clip-from-video --group media -use youtube/get-download-path --group media +use --group media ffmpeg/get-audio-clip-from-video +use --group media youtube/get-download-path ##################################################################### diff --git a/scwrypts/media/youtube/get-filename.module.zsh b/scwrypts/media/youtube/get-filename.module.zsh index ed89c20..f02926c 100644 --- a/scwrypts/media/youtube/get-filename.module.zsh +++ b/scwrypts/media/youtube/get-filename.module.zsh @@ -1,6 +1,6 @@ ##################################################################### -use youtube/yt-dlp --group media +use --group media youtube/yt-dlp ##################################################################### diff --git a/scwrypts/media/youtube/youtube.module.zsh b/scwrypts/media/youtube/youtube.module.zsh index 274b08c..d3363b8 100644 --- a/scwrypts/media/youtube/youtube.module.zsh +++ b/scwrypts/media/youtube/youtube.module.zsh @@ -4,12 +4,12 @@ # download a youtube video by URL -use youtube/download --group media +use --group media youtube/download # show fully-qualified path to downloads -use youtube/get-download-path --group media +use --group media youtube/get-download-path # interact with yt-dlp directly -use youtube/yt-dlp --group media +use --group media youtube/yt-dlp diff --git a/scwrypts/media/youtube/yt-dlp.module.zsh b/scwrypts/media/youtube/yt-dlp.module.zsh index a8dafda..f427bdd 100644 --- a/scwrypts/media/youtube/yt-dlp.module.zsh +++ b/scwrypts/media/youtube/yt-dlp.module.zsh @@ -1,6 +1,6 @@ ##################################################################### -use youtube/get-download-path --group media +use --group media youtube/get-download-path ##################################################################### diff --git a/scwrypts/remote/connect b/scwrypts/remote/connect index 89a1d69..e735f2d 100755 --- a/scwrypts/remote/connect +++ b/scwrypts/remote/connect @@ -1,6 +1,6 @@ #!/bin/zsh -use bastion --group remote -use config --group remote +use --group remote bastion +use --group remote config ##################################################################### USAGE__options=" diff --git a/scwrypts/remote/test b/scwrypts/remote/test index 048f814..0313d20 100755 --- a/scwrypts/remote/test +++ b/scwrypts/remote/test @@ -1,6 +1,6 @@ #!/bin/zsh -use bastion --group remote -use config --group remote +use --group remote bastion +use --group remote config DEPENDENCIES+=(timeout ssh) ##################################################################### @@ -24,7 +24,7 @@ USAGE__description=' MAIN() { local CONNECTION_STRING REMOTE_NAME - local TIMEOUT_SECONDS=3 + local TIMEOUT_SECONDS=5 local COMMAND='echo OK &>/dev/null' local USE_BASTION while [[ $# -gt 0 ]] diff --git a/scwrypts/remote/tmux/manager b/scwrypts/remote/tmux/manager index 835a729..e7bfb1b 100755 --- a/scwrypts/remote/tmux/manager +++ b/scwrypts/remote/tmux/manager @@ -3,7 +3,7 @@ # must work as a standalone zsh script # eval "$(scwrypts --config)" \ - && use omni --group remote \ + && use --group omni \ && utils.check-environment \ || { echo 'scwrypts config error; aborting' >&2; sleep 5; return 1; } diff --git a/zsh/rc.d/98.1password-ssh-agent.zsh b/zsh/rc.d/98.1password-ssh-agent.zsh index 8adce76..e1b529d 100644 --- a/zsh/rc.d/98.1password-ssh-agent.zsh +++ b/zsh/rc.d/98.1password-ssh-agent.zsh @@ -1,4 +1,6 @@ -find "${HOME}/.1password/agent.sock" &>/dev/null \ - && export SSH_AUTH_SOCK="${HOME}/.1password/agent.sock" +[[ ${SSH_AUTH_SOCK} ]] || { + find "${HOME}/.1password/agent.sock" &>/dev/null \ + && export SSH_AUTH_SOCK="${HOME}/.1password/agent.sock" +} return 0