diff --git a/README.md b/README.md index 5c1d9b0..eb435a4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Dotfiles -This repository contains most if not all of the changes made to my machines that run Arch Linux, Fedora, Ubuntu, or CentOS, but primarily Arch Linux as it's what I use on my personal computers. The desktop environment setup is Hyprland. +This repository contains most if not all of the changes made to my machines that run Arch Linux, Fedora, Ubuntu, or CentOS, but primarily Arch Linux as it's what I use on my personal computers. It should support both sway and i3. ## Example `~/.config/chezmoi/chezmoi.toml` @@ -85,6 +85,10 @@ sudo chmod a+rw /dev/i2c-* # Or after quick logout sudo chgrp i2c /dev/i2c-* +# oh-my-tmux +git clone git@github.com:gpakosz/.tmux.git +ln -s -f .tmux/.tmux.conf + # delta ## Arch Linux paru -S git-delta diff --git a/dot_bin/executable_emoji b/dot_bin/executable_emoji index c87c13c..7a97f67 100644 --- a/dot_bin/executable_emoji +++ b/dot_bin/executable_emoji @@ -26,6 +26,7 @@ source ~/.bin/utils.zsh + # Where to save the emojis file. EMOJI_FILE="$HOME/.cache/emojis.txt" @@ -42,41 +43,44 @@ URLS=( 'https://emojipedia.org/flags/' ) + function notify() { if [ "$(command -v notify-send)" ]; then notify-send "$1" "$2" fi } + function download() { - notify $(basename "$0") 'Downloading all emoji for your pleasure' + notify `basename "$0"` 'Downloading all emoji for your pleasure' - echo "" >"$EMOJI_FILE" + echo "" > "$EMOJI_FILE" for url in "${URLS[@]}"; do echo "Downloading: $url" # Download the list of emoji and remove all the junk around it - emojis=$(curl -s "$url" | - xmllint --html \ - --xpath '//ul[@class="emoji-list css_test1"]' - 2>/dev/null) + emojis=$(curl -s "$url" | \ + xmllint --html \ + --xpath '//ul[@class="emoji-list css_test1"]' - 2>/dev/null) # Get rid of starting/closing ul tags emojis=$(echo "$emojis" | head -n -1 | tail -n +1) # Extract the emoji and its description - emojis=$(echo "$emojis" | - sed -rn 's/.*(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p') + emojis=$(echo "$emojis" | \ + sed -rn 's/.*(.*)<\/span> (.*)<\/a><\/li>/\1 \2/p') - echo "$emojis" >>"$EMOJI_FILE" + echo "$emojis" >> "$EMOJI_FILE" done - notify $(basename "$0") "We're all set!" + notify `basename "$0"` "We're all set!" } + function display() { emoji=$(cat "$EMOJI_FILE" | grep -v '#' | grep -v '^[[:space:]]*$') - line=$(echo "$emoji" | rofi -dmenu -i -p emoji $@) + line=$(echo "$emoji" | rofi -dmenu -i -p emoji -kb-custom-1 Ctrl+c $@) exit_code=$? line=($line) @@ -94,6 +98,7 @@ function display() { } + # Some simple argparsing if [[ "$1" =~ -D|--download ]]; then download diff --git a/dot_bin/executable_updates b/dot_bin/executable_updates index c55f33b..1fe0ca4 100644 --- a/dot_bin/executable_updates +++ b/dot_bin/executable_updates @@ -37,6 +37,22 @@ function check_live() { fi } +function update_package_manager() { + if is_fedora; then + sudo dnf upgrade --refresh --assumeyes + else + paru -Syu --noconfirm + fi +} + +function update_flatpak() { + flatpak remove --unused --assumeyes && flatpak update --assumeyes +} + +function update_snap() { + sudo snap refresh +} + case "$1" in check) check_cache @@ -50,13 +66,32 @@ case "$1" in done ;; update) - if is_fedora; then - sudo dnf upgrade --refresh --assumeyes - else - paru -Syu --noconfirm - fi - flatpak remove --unused --assumeyes && flatpak update --assumeyes - sudo snap refresh + case "$2" in + --kitty) + kitty @ goto-layout vertical + kitty @ launch --title "Flatpak update" --no-response --dont-take-focus --type window -- updates update --flatpak + kitty @ launch --title "Snap update" --no-response --dont-take-focus --type window -- updates update --snap + kitty @ launch --title "Package manager update" --no-response --dont-take-focus --type window -- updates update --package-manager + ;; + --package-manager) + update_package_manager + ;; + --flatpak) + update_flatpak + ;; + --snap) + update_snap + ;; + *) + # If desktop environment is running. + if [[ -n "$DESKTOP_SESSION" ]]; then + kitty @ launch --title "Starting update" --no-response --dont-take-focus --type os-window -- updates update --kitty + else + update_package_manager + update_flatpak + update_snap + fi + esac ;; *) echo "Usage: $0 {check|monitor|update}" diff --git a/dot_bin/executable_upload b/dot_bin/executable_upload index eab2a11..c46c31a 100644 --- a/dot_bin/executable_upload +++ b/dot_bin/executable_upload @@ -3,7 +3,7 @@ source ~/.bin/utils.zsh if is_wayland; then - clipboard_type=$(wl-paste -l) + clipboard_type=`wl-paste -l` else fi @@ -14,7 +14,7 @@ if [ "$clipboard_type" != "image/png" ]; then fi if is_wayland; then - wl-paste | imgur.sh | head -c -1/ | wl-copy + wl-paste | imgur.sh | wl-copy else fi diff --git a/dot_zprofile b/dot_zprofile index ed244f5..c77ea57 100644 --- a/dot_zprofile +++ b/dot_zprofile @@ -21,7 +21,7 @@ export LANG=en_GB.UTF-8 export PROMPT_EOL_MARK="" # autoupdate -zstyle ':omz:update' mode auto +export UPDATE_ZSH_DAYS=30 ## Linux / MacOS ## machine=$(uname -s) diff --git a/dot_zshrc b/dot_zshrc index 93b9956..12ff3df 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -5,6 +5,7 @@ source ~/.bin/hg_commit.zsh ## OH MY ZSH ## plugins=( fzf + autoupdate zsh-autosuggestions zsh-syntax-highlighting ) @@ -51,6 +52,6 @@ SPACESHIP_RPROMPT_ORDER+=( source $HOME/.oh-my-zsh/oh-my-zsh.sh compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION -if type "eza" >/dev/null; then - alias ls="eza" +if type "exa" >/dev/null; then + alias ls="exa" fi diff --git a/private_dot_config/hypr/exec.conf b/private_dot_config/hypr/exec.conf index 578feb1..5145eeb 100644 --- a/private_dot_config/hypr/exec.conf +++ b/private_dot_config/hypr/exec.conf @@ -10,7 +10,7 @@ exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRE exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 # Tray -exec = pgrep -x "gammastep-indicator" >/dev/null || gammastep-indicator +exec = pgrep -x "redshift-gtk" >/dev/null || redshift-gtk exec-once = nm-applet --indicator exec-once = blueman-applet diff --git a/private_dot_config/kitty/kitty.conf b/private_dot_config/kitty/kitty.conf index d251d74..0e82a89 100644 --- a/private_dot_config/kitty/kitty.conf +++ b/private_dot_config/kitty/kitty.conf @@ -68,3 +68,4 @@ strip_trailing_spaces smart allow_remote_control yes enable_audio_bell no confirm_os_window_close 0 +enabled_layouts all