mirror of https://github.com/mitchell/dotfiles.git
Swap bspwmrc to fish; refactor root-level scripts
This commit is contained in:
parent
43c56716f8
commit
8ac7a6cb37
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 <function> [arg [arg [...]]
|
||||
or source the file and run them as commands:
|
||||
$ source ./provision_linux
|
||||
$ lint [args]
|
||||
|
||||
Run ./provision_linux <function_name> 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
|
||||
|
|
22
swim
22
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'
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue