9 Commits

29 changed files with 409 additions and 312 deletions

View File

@@ -1,35 +0,0 @@
BREWPATH ?= /opt/homebrew/bin
BREW = $(BREWPATH)/brew
DOTS = $(BREWPATH)/dots
APPDIR ?= /Applications
# This does not work inside of a make command.
bootstrap-homebrew:
xcode-select --install || true
source "$(PWD)/scripts/install-brew.sh"
# Install the dots application manager.
install-dots:
"$(BREW)" tap m-housh/formula
"$(BREW)" install dots
bootstrap-minimal: bootstrap-homebrew install-dots
"$(DOTS)" install --minimal "$(APPDIR)"
bootstrap: bootstrap-homebrew install-dots
"$(DOTS)" install --full "$(APPDIR)"
# make a local zsh configuration file, to extend
# the normal .zshrc for configuration that is only
# relevant on the local machine.
zshrc-local:
# check if a file already exists or not and create it if not.
test -f "$(PWD)/zsh/config/.zshrc-local" \
|| echo "#!/usr/bin/env zsh" > "$(PWD)/zsh/config/.zshrc-local"
# add symlink to appropriate location if doesn't exist.
test -L "$(HOME)/.config/zsh/.zshrc-local" \
|| ln -sfv "$(PWD)/zsh/config/.zshrc-local" "$(HOME)/.config/zsh/"
# open the file to edit.
vim "$(PWD)/zsh/config/.zshrc-local"
default: bootstrap

29
bootstrap Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Bootstraps a new machine, installing configuration, packages, and webapps.
#
if [ -z "$DEV_ENV" ]; then
echo "env var DEV_ENV needs to be present"
exit 1
fi
# if i just did DEV_ENV=$(pwd) ./run then this is needed for the rest of the
# scripts
export DEV_ENV="$DEV_ENV"
args=""
while [[ $# -gt 0 ]]; do
if [[ "$1" =~ dry ]]; then
args="--dry-run"
fi
done
echo "Args to bootstrap scripts: $args"
echo "Installing packages may require your password multiple times."
echo "Running packages" && $DEV_ENV/run "$args"
echo "Installing configuration" && $DEV_ENV/dev-env "$args"
echo "Installing webapps" && $DEV_ENV/webapp "$args"
echo "Starting system services" && $DEV_ENV/system "$args"

15
dev-env
View File

@@ -12,6 +12,12 @@ if [ -z "$XDG_CONFIG_HOME" ]; then
XDG_CONFIG_HOME=$HOME/.config
fi
if [ -z "$XDG_DATA_HOME" ]; then
echo "no xdg data home"
echo "using ~/.local/share"
XDG_DATA_HOME=$HOME/.local/share
fi
if [ -z "$DEV_ENV" ]; then
echo "env var DEV_ENV needs to be present"
exit 1
@@ -92,6 +98,7 @@ copy_files() {
############################## MAIN ##############################
# CONFIG
update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME
update_dirs $DEV_ENV/env/.local $HOME/.local
@@ -114,7 +121,15 @@ copy $DEV_ENV/env/.tmux.conf $HOME/.tmux.conf
mkdir $HOME/.gnupg
copy_files $DEV_ENV/env/.gnupg $HOME/.gnupg
# Wallpapers
mkdir $HOME/wallpapers
copy_files $DEV_ENV/env/wallpapers $HOME/wallpapers
# MISC
mkdir $HOME/Pictures
mkdir -p $XDG_DATA_HOME/clipse/tmp_files
copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env
systemctl --user daemon-reload
hyprctl reload
exec zsh -l

View File

@@ -170,7 +170,6 @@ alias ga='git add' # add files to git quickly
alias gcb='git checkout -b' # checkout a new git branch, creating if needed.
alias gco='git checkout' # checkout an already existing git branch
alias gcm='git commit -a -m' # commit files to git quickly
alias gen='just --justfile "$ANSIBLE_GEN_DIR/justfile"' # generate template files / directories
alias gp='git push' # push repo to git
alias gs='git status' # git status quickly
alias hn='hugo new' # generate a hugo site
@@ -182,9 +181,7 @@ alias ls='eza --long --git --group --links --icons --all'
alias lt='eza --long --git --group --links --icons --tree'
alias pass='gopass'
alias p='gopass' # run the pass command quickly.
alias pf='pass fzf' # fuzzy find a password quickly and copy selection to clipboard.
alias pg='gopass show' # get an attribute of a password file quickly.
alias pgc='gopass show --clip' # get an attribute of a password file and copy to the clipboard.
alias pc='gopass show --clip' # get an attribute of a password file and copy to the clipboard.
alias reload='exec zsh -l' # reload the shell, useful when making changes.
alias s='swift' # shorthand to access swift commands
alias st='swift test' # swift test
@@ -223,7 +220,7 @@ _source_if "$ZDOTDIR/.zshrc-local"
_source_if "$LOCAL_ENV"
# pnpm
export PNPM_HOME="/Users/michael/.local/share/pnpm"
export PNPM_HOME="$XDG_DATA_HOME/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;

View File

@@ -8,7 +8,7 @@ Generates a '.desktop' file for a web application, so that it
can act as a stand alone application and launched from an application
launcher.
USAGE: install-webapp [-n <name>] [-u <url>] [-i <icon>] [-e <exec-cmd>] [-m <mime-types>] [-h] [args...]
USAGE: install-webapp [-n <name>] [-u <url>] [-i <icon>] [-e <exec-cmd>] [-m <mime-types>] [-f <file>] [-h] [args...]
OPTIONS:
-n | --name: The name of the application.
@@ -16,6 +16,7 @@ OPTIONS:
-i | --icon: The icon for the application.
-e | --exec: Custom execution command (optional).
-m | --mime-types: MIME-types for the application (optional).
-f | --file: Install from a spec in a json file.
-h | --help: Show usage information.
EXAMPLES:
@@ -32,6 +33,10 @@ Calling the app with named arguments:
--url "https://awesome.com" \\
--icon "https://awesome.com/assets/icon.png"
Using a json file as input:
$ install-webapp --file myapp.json
It is also possible to use only positional arguments with out their key. They can be passed in the order as
they're listed.
@@ -47,6 +52,16 @@ can either be the full path to the file or a file name of an icon located in '~/
Interactive sessions do not give the option to use a custom execution command or supply the
MIME types, which are less frequently used options.
If using a json spec file, all keys are the same as their option name, except for mime-types use 'mime_types' as the
key in the json object. Although the 'exec' and 'mime_types' are not required in the spec file. An common json spec
file example would look like:
{
"name": "My Awesome App",
"url": "https://awesome.com",
"icon: "https://awesome.com/assets/icon.png"
}
EOF
}
@@ -56,6 +71,7 @@ declare -a icon_ref
declare -a custom_exec # Optional custom exec command
declare -a mime_types # Optional mime types
declare -a help_flag
declare -a file_mode
declare INTERACTIVE_MODE=false
zparseopts -D -F -K -- \
@@ -64,6 +80,7 @@ zparseopts -D -F -K -- \
{i,-icon}:=icon_ref \
{e,-exec}:=custom_exec \
{m,-mime-types}:=mime_types \
{f,-file}:=file_mode \
{h,-help}=help_flag
[ ${#help_flag[@]} -gt 0 ] && usage && exit 0
@@ -75,6 +92,16 @@ zparseopts -D -F -K -- \
[ -n "$4" ] && custom_exec+=("$4")
[ -n "$5" ] && mime_types+=("$5")
# If passed in a json spec file.
if [[ -n "$file_mode" ]]; then
file=$(cat ${file_mode[-1]})
app_name+=$(echo $file | jq -r '.name')
app_url+=$(echo $file | jq -r '.url')
icon_ref+=$(echo $file | jq -r '.icon')
custom_exec+=$(echo $file | jq -r '.exec')
mime_types+=$(echo $file | jq -r '.mime_types')
fi
# Check if proper arguments were passed in. Start interactive mode if not.
if [[ -z "$app_name[-1]" || -z "$app_url[-1]" || -z "$icon_ref[-1]" ]]; then
echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m"
@@ -87,7 +114,9 @@ else
fi
# Ensure valid execution
if [[ -z "$app_name[-1]" || -z "$app_url[-1]" || -z "$icon_ref[-1]" ]]; then
if [[ -z "$app_name[-1]" || "$app_name[-1]" == "null" ||
-z "$app_url[-1]" || "$app_url[-1]" == "null" ||
-z "$icon_ref[-1]" || "$icon_ref[-1]" == "null" ]]; then
echo "You must set app name, app URL, and icon URL!"
exit 1
fi
@@ -121,7 +150,7 @@ else
fi
# Use custom exec if provided, otherwise default behavior
if [[ -n $CUSTOM_EXEC ]]; then
if [[ -n $CUSTOM_EXEC ]] && [[ ! $CUSTOM_EXEC == "null" ]]; then
EXEC_COMMAND="$CUSTOM_EXEC"
else
EXEC_COMMAND="${SCRIPTS:-$HOME/.local/scripts}/launch-webapp $APP_URL"
@@ -143,7 +172,7 @@ StartupNotify=true
EOF
# Add mime types if provided
if [[ -n $MIME_TYPES ]]; then
if [[ -n $MIME_TYPES ]] && [[ ! $MIME_TYPES == "null" ]]; then
echo "MimeType=$MIME_TYPES" >>"$DESKTOP_FILE"
fi

44
env/.local/scripts/uninstall-webapp vendored Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Uninstall's a web app, including it's icon.
app_dir="$HOME/.local/share/applications"
spec=""
file=""
while [[ $# -gt 0 ]]; do
if [[ $1 =~ "-f" ]] || [[ $1 =~ "--file" ]]; then
shift
file=$(jq -r '.name' $1)
else
file=$1
fi
shift
done
if [[ -z "$file" ]]; then
echo -e "Must supplye a web app name to uninstall.\n\n"
echo "Usage: uninstall-webapp <name | path>"
exit 1
fi
file="$(basename $file)"
if [[ ! $file =~ \.desktop$ ]]; then
file="$file.desktop"
fi
desktop="$app_dir/$file"
if [[ ! -f "$desktop" ]]; then
echo "No webapp found @: $desktop"
exit 1
fi
icon=$(cat $desktop | grep "Icon")
icon="${icon/#Icon=/}"
echo "Removing Application: $desktop"
rm -rf "$desktop"
echo "Removing Icon: $icon"
rm -rf "$icon" >/dev/null 2>&1

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

6
env/webapps/excalidraw.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Excalidraw",
"url": "https://draw.housh.dev",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/excalidraw.png"
}

6
env/webapps/gitea.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Gitea",
"url": "https://git.housh.dev",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/gitea.png"
}

6
env/webapps/github.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Github",
"url": "https://github.com",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/github-light.png"
}

6
env/webapps/housecallpro.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "HouseCall Pro",
"url": "https://pro.housecallpro.com/app/calendar_new",
"icon": "~/.local/share/applications/icons/housecallpro.png"
}

6
env/webapps/hyprland-wiki.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Hyprland Wiki",
"url": "https://wiki.hypr.land",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/hyprland.png"
}

6
env/webapps/immich.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Immich",
"url": "https://photos.housh.dev",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/immich.png"
}

6
env/webapps/oryx.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Oryx",
"url": "https://configure.zsa.io/voyager/layouts/v9LLL/latest/0",
"icon": "~/.local/share/applications/icons/oryx.png"
}

6
env/webapps/unifi.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "Unifi",
"url": "https://unifi.ui.com",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/unifi.png"
}

6
env/webapps/youtube.json vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"name": "YouTube",
"url": "https://youtube.com",
"icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/youtube.png"
}

81
gen Executable file
View File

@@ -0,0 +1,81 @@
#!/usr/bin/env bash
# Generates a new run file or webapp file.
if [ -z "$DEV_ENV" ]; then
echo "env var DEV_ENV needs to be present"
exit 1
fi
file=""
run="0"
webapp="0"
while [[ $# -gt 0 ]]; do
echo "Arg: \"$1\""
if [[ "$1" == "run" ]]; then
run="1"
elif [[ "$1" == "webapp" ]]; then
webapp="1"
else
file="$1"
fi
shift
done
log() { echo "$1"; }
generate-new-run() {
local dest="$DEV_ENV/runs/$file"
if [ -f "$dest" ]; then
log "file exists: $dest"
exit 1
fi
log "Creating new run: $dest"
printf "#!/usr/bin/env bash\n\n" >$dest
printf "yay \${1:-\"-S --noconfirm\"} # packages\n" >>$dest
chmod +x $dest
}
generate-new-webapp() {
local dest="$DEV_ENV/env/webapps/$file"
if [[ ! $dest =~ \.json$ ]]; then
dest="$dest.json"
fi
if [ -f "$dest" ]; then
log "dest exists: $dest"
exit 1
fi
log "Creating new webapp: $dest"
printf "{\n" >$dest
printf " \"name\": \"My App\",\n" >>$dest
printf " \"url\": \"https://example.com\",\n" >>$dest
printf " \"icon\": \"https://icon.com\"\n" >>$dest
printf "}" >>$dest
}
############################## MAIN ##############################
if [[ -z "$file" ]]; then
log "No file name supplied."
exit 1
fi
if [[ $run == "1" ]]; then
generate-new-run
elif [[ $webapp == "1" ]]; then
generate-new-webapp
else
log "Must supply either \"run\" or \"webapp\" option."
exit 1
fi

View File

@@ -1,71 +0,0 @@
# NOTE:
# Configuration settings for the `hpa` command line tool.
# You can delete settings that are not applicable to your use case.
# Default arguments / options that get passed into `ansible-playbook` commands.
# WARNING: Do not put arguments / options that contain spaces in the same string,
# they should be separate strings, for example do not do something like
# ['--tags debug'], instead use ['--tags', 'debug'].
#
args = []
# Set to true if you want to pass the vault args to `ansible-playbook` commands.
useVaultArgs = true
# NOTE:
# Configuration for running the generate command(s). This allows custimizations
# to the files that get used to generate the final output (generally a pdf).
# See `pandoc --help`. Below are the defaults that get used, which only need
# adjusted if your template does not follow the default template design or if
# you add extra files to your template that need to be included in the final
# output. Also be aware that any of the files specified in the `files` or
# `includeInHeader` options, need to be inside the `buildDirectory` when generating
# the final output file.
# [generate]
# this relative to the project directory.
# buildDirectory = '.build'
# pdfEngine = 'xelatex'
# includeInHeader = [
# 'head.tex',
# 'footer.tex'
# ]
# files = [
# 'Report.md',
# 'Definitions.md'
# ]
# outputFileName = 'Report'
# NOTE:
# These are more for local development of the ansible playbook and should not be needed
# in most cases. Uncomment the lines if you want to customize the playbook and use it
# instead of the provided / default playbook.
#[playbook]
#directory = '/path/to/local/playbook-directory'
#inventory = '/path/to/local/inventory.ini'
#version = 'main'
# NOTE:
# These are to declare where your template files are either on your local system or
# a remote git repository.
[template]
# The directory path on your local system to the template files.
directory = '/Volumes/Bucket/Repos/hhe-consult-template'
# The url to a git repository that contains your template files.
url = 'https://git.housh.dev/hhe/consult-template.git'
# The version, tag, branch, or sha of the template files to clone from the remote
# template repository. In general it is best practice to use a version instead of a
# branch.
version = 'main'
# NOTE:
# Holds settings for `ansible-vault` commands.
[vault]
# Arguments to pass to commands that use `ansible-vault`, such as encrypting or decrypting
# files.
args = [ '--vault-id=consults@$SCRIPTS/vault-gopass-client' ]
# An id to use when encrypting `ansible-vault` files.
encryptId = 'consults'

33
run
View File

@@ -1,6 +1,11 @@
#!/usr/bin/env bash
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
# Adapted from https://github.com/ThePrimeagen/dev/blob/master/run
#
# Runs scripts in the `./runs` directory, which will install or uninstall
# packages. It either runs a single script given an argument (filename in runs)
# or all scripts in the runs directory.
#
if [ -z "$DEV_ENV" ]; then
echo "env var DEV_ENV needs to be present"
@@ -14,7 +19,6 @@ export DEV_ENV="$DEV_ENV"
grep=""
dry_run="0"
uninstall="0"
create="0"
while [[ $# -gt 0 ]]; do
echo "ARG: \"$1\""
@@ -25,9 +29,6 @@ while [[ $# -gt 0 ]]; do
# Handle an --uninstall argument
elif [[ "$1" =~ ^--u ]]; then
uninstall="1"
# Handle an --uninstall argument
elif [[ "$1" =~ ^--c ]]; then
create="1"
# Handle an --install argument (default)
elif [[ ! "$1" =~ ^--i ]]; then
grep="$1"
@@ -43,21 +44,6 @@ log() {
fi
}
generate-new-run() {
local file="$script_dir/runs/$1"
if [ -f "$file" ]; then
log "File exists: $file"
exit 1
fi
log "Creating new run: $file"
printf "#!/usr/bin/env bash\n\n" >$file
printf "yay \${1:-\"-S --noconfirm\"} # packages\n" >>$file
chmod +x $file
}
run() {
local script=$1
local flag=$2
@@ -76,14 +62,11 @@ run() {
}
if [[ "$create" == "1" ]]; then
generate-new-run "$grep"
exit 0
fi
############################## MAIN ##############################
log "RUN: env: $env -- grep: $grep"
runs_dir=$(find $script_dir/runs -mindepth 1 -maxdepth 1 -executable)
runs_dir=$(find $DEV_ENV/runs -mindepth 1 -maxdepth 1 -executable)
for s in $runs_dir; do
if basename $s | grep -vq "$grep"; then

View File

@@ -1,10 +0,0 @@
#!/bin/bash
systemctl --user enable --now hyprpaper.service
systemctl --user enable --now hypridle.service
espanso service register
sudo setcap "cap_dac_override+p" $(which espanso)
systemctl --user enable --now logout-task.service
systemctl --user enable --now batter-monitor.timer
sudo sysetmctl enable --now pscsd.service

View File

@@ -1,95 +0,0 @@
#!/bin/bash
# Installs required packages / applications when setting up a new
# arch linux with hyprland machine.
if ! command -v yay >/dev/null 2>&1; then
sudo pacman -S --noconfirm --needed git base-devel
git clone https://aur.archlinux.org/yay.git ~/yay
cd ~/yay
makepkg -si
rm -rf ~/yay
fi
# Basics
yay -S --noconfirm --needed \
asahi-desktop-meta \
base-devel \
bat \
bc \
btop \
catppuccin-gtk-theme-mocha \
sddm-theme-catppuccin \
eza \
fastfetch \
fzf \
git \
git-lfs \
github-cli \
gum \
hyprpaper \
hyrpidle \
hyprlock \
jq \
neovim \
nodejs \
npm \
nwg-look \
pam-u2f \
pcsc-tools \
starship \
swaync \
tree-sitter-cli \
tmux \
yubikey-manger \
zoxide \
zsh
# Terminals
yay -S --noconfirm ghostty-git kitty
# Clipboard history utility
yay -S --noconfirm clipse wl-clipboard
# Menu bar
yay -S --noconfirm waybar
# Fonts
yay -S --noconfirm \
ttf-jetbrains-mono-nerd \
ttf-firacode \
ttf-inconsolata-nerd
# Application launcher
yay -S --noconfirm walker \
elephant \
elephant-calc \
elephant-symbols
# Bluetooth management
yay -S --noconfirm blueberry-wayland
# terminal based password manager.
yay -S --noconfirm gopass-git git-credential-gopass
# Audio stuff
yay -S --noconfirm pipewire \
pavucontrol \
wireplumber \
pipewire-jack \
pipewire-pulse
# Browsers
yay -S --noconfirm zen-browser-bin chromium
# File managers / explorers
yay -S --noconfirm yazi nautilus
# Email
yay -S --noconfirm thunderbird
# Text expander
yay -S --noconfirm espanso-wayland-git
# Yubikey support
sudo sysetmctl enable --now pscsd.service

View File

@@ -1,61 +0,0 @@
#!/bin/zsh
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Excalidraw" \
--url "https://draw.housh.dev" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/excalidraw.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Gitea" \
--url "https://git.housh.dev" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/gitea.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "GitHub" \
--url "https://github.com" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/github-light.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "HouseCall Pro" \
--url "https://pro.housecallpro.com" \
--icon "~/.dotfiles/assets/icons/housecallpro.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Hyprland Wiki" \
--url "https://https://wiki.hypr.land" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/hyprland.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Immich" \
--url "https://photos.housh.dev" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/immich.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Oryx" \
--url "https://configure.zsa.io/voyager/layouts/v9LLL/latest/0" \
--icon "~/.dotfiles/assets/icons/oryx.png"
#
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Proton Mail" \
--url "https://mail.proton.me" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/proton-mail.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Proton Pass" \
--url "https://pass.proton.me" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/proton-pass.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Unifi Drive" \
--url "https://192.168.10.105/drive/dashboard" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/unifi-drive.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "Unifi" \
--url "https://unifi.ui.com" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/unifi.png"
source ~/.dotfiles/scripts/arch/install-webapp \
--name "YouTube" \
--url "https://youtube.com" \
--icon "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/youtube.png"

View File

@@ -1,6 +0,0 @@
#!/bin/bash
# Set up clipse (clipboard history) storage directories / files.
mkdir -p ~/.local/share/clipse/tmp_files
mkdir ~/Pictures >/dev/null 2>&1

Binary file not shown.

Binary file not shown.

40
system Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# Enable system services.
dry_run="0"
while [[ $# -gt 0 ]]; do
echo "ARG: \"$1\""
# Handle a --dry or --dry-run argument
if [[ "$1" =~ ^--dry ]]; then
dry_run="1"
fi
shift
done
log() {
if [[ $dry_run == "1" ]]; then
echo "[DRY_RUN]: $1"
else
echo "$1"
fi
}
log_and_run() {
log "Running: \"$@\""
if [[ $dry_run == "0" ]]; then
eval $1
fi
}
log_and_run "systemctl --user daemon-reload"
log_and_run "systemctl --user enable --now hyprpaper.service"
log_and_run "systemctl --user enable --now hypridle.service"
log_and_run "espanso service register"
log_and_run "sudo setcap "cap_dac_override+p" $(which espanso)"
log_and_run "systemctl --user enable --now logout-task.service"
log_and_run "systemctl --user enable --now battery-monitor.timer"
log_and_run "sudo systemctl enable --now pcscd.service"

103
webapp Executable file
View File

@@ -0,0 +1,103 @@
#!/usr/bin/env bash
# Installs or uninstalls webapps based on the spec in the './webapps' directory.
#
# This is used when setting up a new machine.
if [ -z "$DEV_ENV" ]; then
echo "env var DEV_ENV needs to be present"
exit 1
fi
if [ -z "$XDG_DATA_HOME" ]; then
echo "no xdg data home"
echo "using ~/.local/share"
XDG_DATA_HOME=~/.local/share
fi
grep=""
dry_run="0"
uninstall="0"
while [[ $# -gt 0 ]]; do
echo "ARG: \"$1\""
# Handle a --dry or --dry-run argument
if [[ "$1" =~ ^--dry ]]; then
dry_run="1"
# Handle an --uninstall argument
elif [[ "$1" =~ ^--u ]]; then
uninstall="1"
# Handle an --install argument (default)
elif [[ ! "$1" =~ ^--i ]]; then
grep="$1"
fi
shift
done
log() {
if [[ $dry_run == "1" ]]; then
echo "[DRY_RUN]: $1"
else
echo "$1"
fi
}
install() {
local file=$DEV_ENV/env/webapps/$(basename $1)
local script="$DEV_ENV/env/.local/scripts/install-webapp"
if [[ ! -x $script ]]; then
log "Failed to find install web app script."
exit 1
fi
# Install local icons if needed
mkdir -p $XDG_DATA_HOME/applications/icons
for i in $(find $DEV_ENV/env/icons -mindepth 1 -maxdepth 1 -type f); do
if [[ ! -f $XDG_DATA_HOME/applications/icons/$i ]] && [[ $dry_run == "0" ]]; then
cp $i $XDG_DATA_HOME/applications/icons
fi
done
log "Installing webapp from spec: $file"
if [[ $dry_run == "0" ]]; then
$script --file $file
fi
}
uninstall() {
local file=$DEV_ENV/env/webapps/$(basename $1)
local script="$DEV_ENV/env/.local/scripts/uninstall-webapp"
if [[ ! -x $script ]]; then
log "Failed to find uninstall web app script."
exit 1
fi
log "Uninstalling webapp from spec: $file"
if [[ $dry_run == "0" ]]; then
$script --file $file
fi
}
############################## MAIN ##############################
log "WEBAPP: -- grep: $grep"
apps_dir=$(find $DEV_ENV/env/webapps -mindepth 1 -maxdepth 1 -type f)
for s in $apps_dir; do
if basename $s | grep -vq "$grep"; then
log "grep \"$grep\" filtered out $s"
continue
fi
if [[ $uninstall == "1" ]]; then
uninstall $s
else
install $s
fi
done