From 0739b1f21e59f63aded178b38b961bf27c4002da Mon Sep 17 00:00:00 2001 From: Tine Jozelj Date: Mon, 29 Jan 2024 01:16:37 +0100 Subject: [PATCH] chore: switch to fedora silverblue --- README.md | 14 +++++++++++- bin/.bin | 1 - bin/colorband | 15 ------------ bin/colortest | 27 ---------------------- install.sh | 63 +++++++++++++++++++++++++-------------------------- zsh/zshrc | 40 +------------------------------- 6 files changed, 45 insertions(+), 115 deletions(-) delete mode 120000 bin/.bin delete mode 100755 bin/colorband delete mode 100755 bin/colortest diff --git a/README.md b/README.md index 0723cc2..4897f50 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,15 @@ # My dotfiles configuration -Hi! +Expected configuration: + * Fedora Silverblue as host + * Fedora in Toolbox as development environment + +```sh +# Install on host +./install.sh + +# Enter the prepared fedora development environment +toolbox enter fedora +# Install in development environment +./install.sh +``` diff --git a/bin/.bin b/bin/.bin deleted file mode 120000 index 52f7c69..0000000 --- a/bin/.bin +++ /dev/null @@ -1 +0,0 @@ -/home/tine/projects/workspace/bin \ No newline at end of file diff --git a/bin/colorband b/bin/colorband deleted file mode 100755 index 9315cda..0000000 --- a/bin/colorband +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -awk 'BEGIN{ - s="/\\/\\/\\/\\/\\"; s=s s s s s s s s; - for (colnum = 0; colnum<77; colnum++) { - r = 255-(colnum*255/76); - g = (colnum*510/76); - b = (colnum*255/76); - if (g>255) g = 510-g; - printf "\033[48;2;%d;%d;%dm", r,g,b; - printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; - printf "%s\033[0m", substr(s,colnum+1,1); - } - printf "\n"; -}' diff --git a/bin/colortest b/bin/colortest deleted file mode 100755 index c12581f..0000000 --- a/bin/colortest +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# -# This file echoes a bunch of color codes to the -# terminal to demonstrate what's available. Each -# line is the color code of one forground color, -# out of 17 (default + 16 escapes), followed by a -# test use of that color on all nine background -# colors (default + 8 escapes). -# - -T='gYw' # The test text - -echo -e "\n 40m 41m 42m 43m\ - 44m 45m 46m 47m"; - -for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' \ - '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' \ - ' 36m' '1;36m' ' 37m' '1;37m'; - do FG=${FGs// /} - echo -en " $FGs \033[$FG $T " - for BG in 40m 41m 42m 43m 44m 45m 46m 47m; - do echo -en "$EINS \033[$FG\033[$BG $T \033[0m"; - done - echo; -done -echo - diff --git a/install.sh b/install.sh index 6b8e585..a91a5fb 100755 --- a/install.sh +++ b/install.sh @@ -15,55 +15,59 @@ workspace_link() { ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true } -if cat /etc/lsb-release | grep Manjaro > /dev/null + +if [ ! -n "${TOOLBOX_PATH}" ] then - echo "== manjaro packages" - sudo pacman -Syu - sudo pacman -S \ + echo "==[host] Installing rpm-os tree packages" + rpm-ostree install --idempotent --apply-live --allow-inactive \ git \ - bat \ - difftastic \ + git-lfs \ neovim \ + bat \ zsh \ - tmux \ - nodejs \ ripgrep \ - typos-bin \ - python-libtmux -elif cat /etc/os-release | grep "Ubuntu" > /dev/null -then - echo "== ubuntu packages" - sudo apt update - sudo apt install -y \ + difftastic \ + nodejs + + echo "==[host] Installing flatpaks" + flatpak install --user com.bitwarden.desktop + flatpak install --user md.obsidian.Obsidian + flatpak install --user org.mozilla.firefox + flatpak install --user org.mozilla.Thunderbird + + echo "==[host] Preparing toolbox" + toolbox create fedora || true + toolbox enter fedora +else + echo "==[toolbox] Installing dependencies" + sudo dnf update -y --best --allowerasing + sudo dnf install -y \ git \ bat \ - neovim \ + neovim python3-neovim \ zsh \ tmux \ nodejs \ ripgrep \ snapd \ - cargo - sudo snap install \ + cargo \ difftastic \ - starship \ - cargo install typos-cli -else - echo "Unsupported OS! Skipping execution of dotenv install.sh" - exit 0 + wl-clipboard \ + ripgrep jq fd-find \ + gcc g++ libstdc++-static fi -echo "== zplug" -curl -sL --proto-redir -all,https https://raw.githubusercontent.com/zplug/installer/master/installer.zsh | zsh || true +echo "== Prepare ~/.bin" +mkdir -p $HOME/.bin echo "== starship" if ! starship --help > /dev/null then - sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --yes + sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --bin-dir=$HOME/.bin --yes fi echo "== Switching shell to ZSH" -sudo chsh $USER --shell $(which zsh) +sudo chsh $USER --shell=$(which zsh) echo "== Installing fonts" HOME_FONTS_DIR="${HOME_DIR}/.local/share/fonts" @@ -93,10 +97,6 @@ workspace_link starship/starship.toml .starship.toml workspace_backup .zshrc workspace_link zsh/zshrc .zshrc -# BIN -workspace_backup .bin -workspace_link bin .bin - # KITTY workspace_backup .config/kitty/kitty.conf workspace_link kitty/kitty.conf .config/kitty/kitty.conf @@ -110,7 +110,6 @@ sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' workspace_backup .config/nvim/init.vim workspace_link nvim/init.vim .config/nvim/init.vim - for file in nvim/lua/* do workspace_backup .config/nvim/lua/$(basename $file) diff --git a/zsh/zshrc b/zsh/zshrc index c516c18..530b47d 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -1,27 +1,3 @@ -source ~/.zplug/init.zsh - -# PLUGINS -if ! zplug check; then - zplug install -fi -zplug "plugins/git", from:oh-my-zsh -zplug "plugins/kubectl", from:oh-my-zsh -zplug "lukechilds/zsh-nvm" -zplug "plugins/terraform", from:oh-my-zsh -zplug "plugins/tmux", from:oh-my-zsh -zplug "plugins/common-aliases", from:oh-my-zsh -if ! zplug check --verbose; then - printf "Install? [y/N]: " - if read -q; then - echo; zplug install - fi -fi - -# Do not autostart tmux. -export ZSH_TMUX_AUTOSTART=false - -zplug load - # History improvements export HISTFILE=~/.zsh_history export HISTFILESIZE=1000000000 @@ -41,26 +17,12 @@ alias gic="git checkout" alias difft="difftastic" alias vim="nvim" -alias kssh="kitty +kitten ssh" - # PATH -export PATH=$PATH:$HOME/.bin:$HOME/go/bin:/snap/bin +export PATH=$PATH:$HOME/.bin:$HOME/go/bin # ENV export EDITOR=vim -# Nix fix -export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive - -if [ "${ZSH_TMUX_AUTOSTART}" = "true" ] -then - # Tmux nicer window name - tmux-window-name() { - ($TMUX_PLUGIN_MANAGER_PATH/tmux-window-name/scripts/rename_session_windows.py &) - } - add-zsh-hook chpwd tmux-window-name -fi - # Starship export STARSHIP_CONFIG=~/.starship.toml eval "$(starship init zsh)"