diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 0e5b5d1..20c8455 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -1,10 +1,9 @@ -#!/bin/sh +#!/usr/bin/env fish -if [ ! -e ~/.bspwm_no_lock ] -then +if ! test -e ~/.bspwm_no_lock slock & touch ~/.bspwm_no_lock -fi +end setxkbmap -option altwin:swap_alt_win setxkbmap -option ctrl:swapcaps diff --git a/.config/fish/functions/vm_inst.fish b/.config/fish/functions/vm_inst.fish index 77d90db..0b2f577 100644 --- a/.config/fish/functions/vm_inst.fish +++ b/.config/fish/functions/vm_inst.fish @@ -4,14 +4,14 @@ function vm_inst -a name os_variant install_source 'c/cpus=' \ 'd/disk-size=' \ 'b/bridge=' \ - 'i/import' \ - 'n/netboot' \ + i/import \ + n/netboot \ -- $argv - set -l memory '4096' - set -l vcpus '2' - set -l disk_size '40' - set -l bridge_iface 'br0' + set -l memory 4096 + set -l vcpus 2 + set -l disk_size 40 + set -l bridge_iface br0 if test -n "$_flag_m" set memory $_flag_m @@ -33,8 +33,12 @@ function vm_inst -a name os_variant install_source --name $name \ --memory $memory \ --vcpus $vcpus \ - --os-variant $os_variant \ - --network bridge=$bridge_iface \ + --os-variant $os_variant + + if test -n "$_flag_b" + set inst_args $inst_args \ + --network bridge=$bridge_iface + end if test -n "$_flag_i" set inst_args $inst_args \ diff --git a/provision_debian b/provision_debian index 739c114..6d6844d 100755 --- a/provision_debian +++ b/provision_debian @@ -1,5 +1,7 @@ #!/usr/bin/env fish # Source: https://github.com/mitchell/run.fish +# +# OUTDATED USE ./provision_linux ### Config ### # Top-level configurations, like function prefixes and argument delimeters diff --git a/provision_linux b/provision_linux index f67cdaf..fdc5b39 100755 --- a/provision_linux +++ b/provision_linux @@ -1,4 +1,15 @@ #!/usr/bin/env fish +# +set general_help ' +A collection of useful functions for provisioning arch/debian linux. + +Either run a function like ./provision_linux [arg [arg [...]] +or source the file and run them as commands: +$ source ./provision_linux +$ lint [args] + +Run ./provision_linux to see it\'s definition. +' ### Config ### @@ -14,8 +25,6 @@ for line in (cat /etc/os-release) end ### Commands ### -# Add, edit, and remove commands freely below. -# To add a command simply create a function with this naming scheme: {run_func_prefix}_{name}. function provision_default -d 'Provisioning terminal, desktop, and m-net' provision_terminal_env @@ -102,8 +111,10 @@ function provision_desktop_env -d 'Install base desktop utilities and configure wget \ unzip \ physlock \ - pulseaudio \ - playerctl + pipewire \ + playerctl \ + tar \ + xz set -l arch_pkgs \ @@ -113,8 +124,9 @@ function provision_desktop_env -d 'Install base desktop utilities and configure ttf-ibm-plex \ ttf-jetbrains-mono \ pavucontrol \ - pulseaudio-alsa \ wmname \ + pipewire-pulse \ + pipewire-alsa \ polybar \ light \ slock @@ -202,6 +214,7 @@ end function provision_m_net -d 'Install syncthing and keepassxc' log 'Installing m-net utilities' install_pkgs \ + wireguard-tools \ keepassxc \ syncthing or return $status @@ -280,12 +293,25 @@ function install_pkgs -S end function log -a message - echo \n"---------------- $message ----------------"\n + echo \n"--- $message ---"\n end -function main - curl -fsS https://git.mjfs.us/mitchell/swim.fish/raw/branch/master/functions/sw.fish | source - run_swim_command $cmd_func_prefix $argv +# --- execution/help handling --- + +function help -a function_name -d 'Displays help for internal function' + if test -n "$function_name" + functions $function_name + else + echo $general_help + end end -main $argv +argparse --ignore-unknown h/help -- $argv + +if test -n "$_flag_h" + help $argv +else if test -n "$argv" + $argv +else + echo $general_help +end diff --git a/swim b/swim index 733b319..3204718 100755 --- a/swim +++ b/swim @@ -31,28 +31,6 @@ function format -d 'Format fish scripts' fish_indent --write $src_fish_files end -function sync -d 'Run the sync script' - ./sync $argv -end - -function install_arch -d 'Run the install_arch script' - ./install_arch $argv -end - -function upgrade_debi -d 'Run the debian_upgrade script' - ./upgrade_debian $argv -end - -function provision -d 'Run the provision_linux script with the specified distro' - argparse 'd/distro=' -- $argv - - if test -n "$_flag_d" - set -g distro $_flag_d - end - - ./provision_linux $argv[2..-1] -end - # --- execution/help handling --- function help -a function_name -d 'Displays help for internal function' diff --git a/upgrade_debian b/upgrade_debian index 1176d2c..06ddc01 100755 --- a/upgrade_debian +++ b/upgrade_debian @@ -15,7 +15,7 @@ deb-src http://ftp.us.debian.org/debian unstable main contrib non-free' | sudo t end function log -a message - echo \n"---------------- $message ----------------"\n + echo \n"--- $message ---"\n end main