From 1a729e728182454858afa5f39641fe1215482857 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Sun, 28 Sep 2025 12:38:23 -0400 Subject: [PATCH] feat: removes old link-config script, rename a few things in dev-env script, more cleanup. --- ARCHNOTES.md | 19 ------- dev-env | 33 +++++++++--- env/.config/nvim/lua/plugins/oil.lua | 14 ++++-- env/.local/scripts/install-webapp | 5 +- scripts/link-config.sh | 75 ---------------------------- 5 files changed, 38 insertions(+), 108 deletions(-) delete mode 100644 ARCHNOTES.md delete mode 100755 scripts/link-config.sh diff --git a/ARCHNOTES.md b/ARCHNOTES.md deleted file mode 100644 index 5329977..0000000 --- a/ARCHNOTES.md +++ /dev/null @@ -1,19 +0,0 @@ -# Arch Linux Notes - -## Web App (PWA) - -For the `webapp-install` script to work there needs to be a directory -for the icons to be installed to. It can be done with the following command: - -```bash -mkdir -p ~/.local/share/applications/icons -``` - -## Monitor Lid Events - -In order to monitor lid events, the user needs to be -added to the `input` group. - -```bash -sudo usermod -aG input $USER -``` diff --git a/dev-env b/dev-env index 56ea28d..714d96e 100755 --- a/dev-env +++ b/dev-env @@ -32,7 +32,7 @@ log() { log "env: $DEV_ENV" # Removes a destination directory and copies all files to the destination. -update_files() { +update_dirs() { log "copying over files from: $1" pushd $1 &>/dev/null ( @@ -60,7 +60,7 @@ update_files() { copy() { log "removing: $2" if [[ $dry_run == "0" ]]; then - rm $2 + rm $2 &>/dev/null fi log "copying: $1 to $2" if [[ $dry_run == "0" ]]; then @@ -70,15 +70,30 @@ copy() { # Copy all files from a directory into another directory. copy_files() { - for f in $(find $1 -mindepth 1 -maxdepth 1 -type f); do - copy $f "$2/$(basename $f)" - done + log "copying over files from: $1" + pushd $1 &>/dev/null + ( + for f in $(find . -mindepth 1 -maxdepth 1 -type f); do + + local dest="$2/$(basename $f)" + + if [[ $dry_run == "0" ]]; then + rm -rf $dest >/dev/null 2>&1 + fi + + log " copying env: cp $f $dest" + if [[ $dry_run == "0" ]]; then + cp $f $dest + fi + done + ) + popd &>/dev/null } ############################## MAIN ############################## -update_files $DEV_ENV/env/.config $XDG_CONFIG_HOME -update_files $DEV_ENV/env/.local $HOME/.local +update_dirs $DEV_ENV/env/.config $XDG_CONFIG_HOME +update_dirs $DEV_ENV/env/.local $HOME/.local # SYSTEMD mkdir -p $XDG_CONFIG_HOME/systemd/user @@ -89,7 +104,7 @@ copy_files $DEV_ENV/env/.config/systemd/user $XDG_CONFIG_HOME/systemd/user # copying configuration. copy $DEV_ENV/env/.zshenv $HOME/.zshenv mkdir -p $XDG_CONFIG_HOME/zsh -update_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh +update_dirs $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh copy_files $DEV_ENV/env/.config/zsh $XDG_CONFIG_HOME/zsh # TMUX @@ -99,5 +114,7 @@ copy $DEV_ENV/env/.tmux.conf $HOME/.tmux.conf mkdir $HOME/.gnupg copy_files $DEV_ENV/env/.gnupg $HOME/.gnupg +copy $DEV_ENV/dev-env $HOME/.local/scripts/dev-env + systemctl --user daemon-reload hyprctl reload diff --git a/env/.config/nvim/lua/plugins/oil.lua b/env/.config/nvim/lua/plugins/oil.lua index 6584b62..f39d065 100644 --- a/env/.config/nvim/lua/plugins/oil.lua +++ b/env/.config/nvim/lua/plugins/oil.lua @@ -15,13 +15,15 @@ return { desc = "Open the entry in a vertical split", }, view_options = { + show_hidden = true, is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used. -- Don't show .DS_Store in output. - local is_ds_store = name ~= ".DS_Store" - return not is_ds_store + -- local is_ds_store = name ~= ".DS_Store" + -- return not is_ds_store + return false end, }, - } + }, }, keys = { -- Show the parent directory in current window. @@ -29,8 +31,10 @@ return { -- Open parent directory in floating window. { "-", - function() require("oil").toggle_float() end, - desc = "Open parent directory in floating window." + function() + require("oil").toggle_float() + end, + desc = "Open parent directory in floating window.", }, }, } diff --git a/env/.local/scripts/install-webapp b/env/.local/scripts/install-webapp index d8a2f1f..9ab023a 100755 --- a/env/.local/scripts/install-webapp +++ b/env/.local/scripts/install-webapp @@ -100,6 +100,9 @@ MIME_TYPES=$mime_types[-1] # Refer to local icon or fetch remotely from URL ICON_DIR="$HOME/.local/share/applications/icons" +# Ensure the icon directory exists (useful if it's the first run.) +[ ! -d $ICON_DIR ] && mkdir -p $ICON_DIR + if [[ $ICON_REF == https://* ]]; then ICON_PATH="$ICON_DIR/$APP_NAME.png" if curl -sL -o "$ICON_PATH" "$ICON_REF"; then @@ -121,7 +124,7 @@ fi if [[ -n $CUSTOM_EXEC ]]; then EXEC_COMMAND="$CUSTOM_EXEC" else - EXEC_COMMAND="$HOME/.local/scripts/launch-webapp $APP_URL" + EXEC_COMMAND="${SCRIPTS:-$HOME/.local/scripts}/launch-webapp $APP_URL" fi # Create application .desktop file diff --git a/scripts/link-config.sh b/scripts/link-config.sh deleted file mode 100755 index 92c98f1..0000000 --- a/scripts/link-config.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash - -function copy() { - local item=$1 - local dest=${2:-~/.config} - - if [ -d "$item" ]; then - cp -Rfv "$item" "$dest" - else - cp -fv "$item" "$dest" - fi -} - -gpgs=( - "gpg/gpg.conf" - "gpg/gpg-agent.conf" - "gpg/scdaemon.conf" -) - -ln -sfv ~/.dotfiles/clipse ~/.config -ln -sfv ~/.dotfiles/eza ~/.config -ln -sfv ~/.dotfiles/ghostty ~/.config -ln -sfv ~/.dotfiles/git ~/.config -# TODO: Remove kitty. -ln -sfv ~/.dotfiles/kitty ~/.config -ln -sfv ~/.dotfiles/npm ~/.config -ln -sfv ~/.dotfiles/nvim/lazynvim ~/.config -ln -sfv ~/.dotfiles/starship ~/.config -ln -sfv ~/.dotfiles/systemd ~/.config -ln -sfv ~/.dotfiles/tree-sitter ~/.config -ln -sfv ~/.dotfiles/walker ~/.config -ln -sfv ~/.dotfiles/waybar ~/.config -ln -sfv ~/.dotfiles/yubico ~/.config - -# Espanso -espanso service stop -rm -rf ~/.config/espanso >/dev/null 2>&1 -ln -sfV ~/.dotfiles/espanso ~/.config -espanso service start - -# Hyprland -rm -rf ~/.config/hypr >/dev/null 2>&1 -ln -sfv ~/.dotfiles/hypr ~/.config - -# GPG -mkdir ~/.gnupg -chmod 700 ~/.gnupg -ln -sfv ~/.dotfiles/gpg/gpg-agent.conf ~/.gnupg/gpg-agent.conf -ln -sfv ~/.dotfiles/gpg/gpg.conf ~/.gnupg/gpg.conf -ln -sfv ~/.dotfiles/gpg/scdaemon.conf ~/.gnupg/scdaemon.conf - -# yazi -mkdir ~/.config/yazi -ln -sfv ~/.dotfiles/yazi/theme.toml ~/.config/yazi/theme.toml -ln -sfv ~/.dotfiles/yazi/yazi.toml ~/.config/yazi/yazi.toml - -# tmux -mkdir -p ~/.config/tmux/plugins -ln -sfv ~/.dotfiles/tmux/tmux.conf ~/.config/tmux/tmux.conf - -# scripts -mkdir -p ~/.local/share -ln -sfv ~/.dotfiles/scripts/arch ~/.local/bin -ln -sfv ~/.dotfiles/scripts/scripts ~/.local/share/scripts - -# zsh -mkdir -p ~/.config/zsh/plugins -ln -sfv ~/.dotfiles/zsh/.zshenv ~/.zshenv -ln -sfv ~/.dotfiles/zsh/config/.zshenv ~/.config/zsh/.zshenv -ln -sfv ~/.dotfiles/zsh/config/.zshrc ~/.config/zsh/.zshrc -ln -sfv ~/.dotfiles/zsh/config/functions ~/.config/zsh/functions -ln -sfv ~/.dotfiles/zsh/config/zsh-functions ~/.config/zsh/zsh-functions -touch ~/.config/zsh/history -chmod 600 ~/.config/zsh/history -chsh -s $(which zsh)