From ac79b463ca9001dc6b304c7f63314ba958dc8249 Mon Sep 17 00:00:00 2001 From: n Date: Sat, 31 Dec 2022 14:40:47 +0300 Subject: [PATCH 1/4] Update current dotfiles --- configs/sway/config | 6 +++--- configs/sway/themes/catppuccin-macchiato | 2 +- configs/waybar/config | 14 ++++++++++---- configs/waybar/style.css | 2 +- tools/relink.sh | 13 ++++++------- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/configs/sway/config b/configs/sway/config index f947048..98b78d7 100644 --- a/configs/sway/config +++ b/configs/sway/config @@ -28,7 +28,7 @@ default_border pixel 1 gaps inner 8 font "JetBrains Mono" 9 -output * scale 1.5 +output * scale 2 include ~/.config/sway/themes/catppuccin-macchiato @@ -41,8 +41,8 @@ exec swayidle -w timeout 60 '$HOME/.config/sway/lock.sh' # Screenshots set $screenshot_file \"$HOME/Pictures/screenshot-$(date '+%Y-%m-%d_%H-%M-%S').png\" -bindsym $mod+o exec grim -s1 $screenshot_file -bindsym $mod+p exec (slurp | grim -g- -s1 $screenshot_file) +bindsym $mod+o exec grim $screenshot_file +bindsym $mod+p exec (slurp | grim -g- $screenshot_file) # Recordings diff --git a/configs/sway/themes/catppuccin-macchiato b/configs/sway/themes/catppuccin-macchiato index dcb575d..e0b10b8 100644 --- a/configs/sway/themes/catppuccin-macchiato +++ b/configs/sway/themes/catppuccin-macchiato @@ -2,7 +2,7 @@ seat seat0 xcursor_theme "Simp1e-Catppuccin-Macchiato" set $gnome-schema org.gnome.desktop.interface exec_always { - gsettings set $gnome-schema gtk-theme 'Catppuccin-Macchiato' + gsettings set $gnome-schema gtk-theme 'Catppuccin-Macchiato-Standard-Blue-Dark' gsettings set $gnome-schema icon-theme 'Mint-Y-Dark' gsettings set $gnome-schema cursor-theme 'Simp1e-Catppuccin-Macchiato' gsettings set $gnome-schema font-name 'Noto Sans 9' diff --git a/configs/waybar/config b/configs/waybar/config index 244288d..d664bbe 100644 --- a/configs/waybar/config +++ b/configs/waybar/config @@ -2,15 +2,15 @@ "position": "top", "modules-left": ["sway/workspaces", "sway/mode"], "modules-center": [], - "modules-right": ["idle_inhibitor", "cpu", "temperature", "memory", "custom/loadavg", "custom/uptime", "network", "pulseaudio", "battery", "sway/language", "clock", "tray"], + "modules-right": ["idle_inhibitor", "cpu", "memory", "custom/loadavg", "custom/uptime", "network", "pulseaudio", "battery", "sway/language", "custom/absclock", "clock", "tray"], "sway/mode": { "format": "{}" }, "idle_inhibitor": { "format": "{icon}", "format-icons": { - "activated": "0", - "deactivated": "O" + "activated": "No idling", + "deactivated": "Idling" } }, "tray": { @@ -36,6 +36,12 @@ "format": "RAM: {}%", "interval": 1 }, + "custom/absclock": { + "exec": "date +%s", + "return-type": "{}", + "format": "{}", + "interval": 1 + }, "custom/loadavg": { "exec": "cat /proc/loadavg | head -c 14", "return-type": "{}", @@ -63,6 +69,6 @@ "tooltip-format": "{ipaddr}/{cidr}", "format-linked": "Network (No IP) via {ifname}", "format-disconnected": "No network", - "on-click": "iwgtk" + "on-click": "nm-connection-editor" }, } diff --git a/configs/waybar/style.css b/configs/waybar/style.css index b2b7772..c78d067 100644 --- a/configs/waybar/style.css +++ b/configs/waybar/style.css @@ -1,6 +1,6 @@ @import "macchiato.css"; * { - font-family: "JetBrains Mono", "Noto Sans"; + font-family: "Ubuntu", "JetBrains Mono", "Noto Sans"; font-size: 9pt; border: none; border-radius: 0; diff --git a/tools/relink.sh b/tools/relink.sh index 5cb2bf5..c833e01 100755 --- a/tools/relink.sh +++ b/tools/relink.sh @@ -3,13 +3,12 @@ # script that (re)links all dotfiles during the installation or upgrade. # do not run manually -mkdir -p $HOME/.config/nvim $HOME/.config/alacritty $HOME/.config/mako >/dev/null 2>&1 ln -sf $HOME/.dotfiles/configs/.zshrc $HOME/.zshrc ln -sf $HOME/.dotfiles/configs/.profile $HOME/.profile -ln -sF $HOME/.dotfiles/configs/nvim $HOME/.config/ -ln -sF $HOME/.dotfiles/configs/alacritty $HOME/.config/ -ln -sF $HOME/.dotfiles/configs/sway $HOME/.config/ -ln -sF $HOME/.dotfiles/configs/waybar $HOME/.config/ -ln -sF $HOME/.dotfiles/configs/mako $HOME/.config/ -ln -sF $HOME/.dotfiles/configs/qt5ct $HOME/.config/ +ln -sf $HOME/.dotfiles/configs/nvim $HOME/.config/ +ln -sf $HOME/.dotfiles/configs/alacritty $HOME/.config/ +ln -sf $HOME/.dotfiles/configs/sway $HOME/.config/ +ln -sf $HOME/.dotfiles/configs/waybar $HOME/.config/ +ln -sf $HOME/.dotfiles/configs/mako $HOME/.config/ +ln -sf $HOME/.dotfiles/configs/qt5ct $HOME/.config/ echo "Dotfiles linked." From e3abbb56072bda3ed5f792d287fa9e287b1e67c7 Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Tue, 3 Jan 2023 19:05:51 +0300 Subject: [PATCH 2/4] Add quick environment generator --- env/.zshrc | 32 ++++++++++++++++++++ env/nvim/init.vim | 17 +++++++++++ tools/env.sh | 76 +++++++++++++++++++++++++++++++++++++++++++++++ tools/link_env.sh | 11 +++++++ 4 files changed, 136 insertions(+) create mode 100644 env/.zshrc create mode 100644 env/nvim/init.vim create mode 100755 tools/env.sh create mode 100644 tools/link_env.sh diff --git a/env/.zshrc b/env/.zshrc new file mode 100644 index 0000000..68b148e --- /dev/null +++ b/env/.zshrc @@ -0,0 +1,32 @@ + +export ZSH="$HOME/.env/oh-my-zsh" + +ZSH_THEME="ivabus" +ENABLE_CORRECTION="true" +plugins=(git zsh-syntax-highlighting) + +# Function to quickly show stats on systemload, usage of filesystems, usage of ram/swap and uptime +stats () { + AVLD=$(cut -d " " -f1-3 /proc/loadavg) + USEDMEM=$(free -h | grep Mem | awk '{print $3 " / " $2}') + USEDSWAP=$(free -h | grep Swap | awk '{ print $3 " / " $2}') + USEDSTRG=$(df / -h | tail -n 1 | awk '{print $3}') + USEDSTRGPERC=$(df / -h | tail -n 1 | awk '{print $5}') + STRG=$(df / -h | tail -n 1 | awk '{print $2}') + USEDSTRGHOME=$(df /home -h | tail -n 1 | awk '{print $3}') + USEDSTRGPERCHOME=$(df /home -h | tail -n 1 | awk '{print $5}') + STRGHOME=$(df /home -h | tail -n 1 | awk '{print $2}') + UPTIME=$(uptime -p) + printf "\e[0;34msystem load:\e[m\t${AVLD}\n" + printf "\e[0;34musage of /:\e[m\t${USEDSTRGPERC}% (${USEDSTRG}/${STRG})\n" + printf "\e[0;34musage of /home:\e[m\t${USEDSTRGPERCHOME}% (${USEDSTRGHOME}/${STRGHOME})\n" + printf "\e[0;34mmemory usage:\e[m\t${USEDMEM}\n" + printf "\e[0;34mswap usage:\e[m\t${USEDSWAP}\n" + printf "\e[0;34muptime:\e[m\t\t${UPTIME}\n" +} + +source $ZSH/oh-my-zsh.sh +export REPORTTIME=10 +alias vi="nvim" +alias vim="nvim" +alias timestamp='date -u +%FT%TZ' diff --git a/env/nvim/init.vim b/env/nvim/init.vim new file mode 100644 index 0000000..3762d50 --- /dev/null +++ b/env/nvim/init.vim @@ -0,0 +1,17 @@ +filetype plugin indent on +set showmatch +set hlsearch +set incsearch +set autoindent +set expandtab +set tabstop=4 +set shiftwidth=4 +set number +set wildmode=longest, list +set cc=80 +syntax on +set noswapfile +set backupdir=~/.cache/vim +set completeopt=noinsert,menuone,noselect +set cursorline +set relativenumber diff --git a/tools/env.sh b/tools/env.sh new file mode 100755 index 0000000..a18c11d --- /dev/null +++ b/tools/env.sh @@ -0,0 +1,76 @@ +#!/bin/sh + +install_compilers() { + echo "=> Installing rust" + $TEA +rust-lang.org zsh -c "exit" + echo "=> Installing llvm" + $TEA +llvm.org zsh -c "exit" + echo "=> Installing python" + $TEA +python.org zsh -c "exit" +} + +install_tools() { + echo "=> Installing git" + $TEA +git-scm.org zsh -c "exit" + echo "=> Installing GitHub CLI" + $TEA +cli.github.com zsh -c "exit" + echo "=> Installing make & automake & cmake & meson & ninja" + $TEA +gnu.org/make zsh -c "exit" + $TEA +gnu.org/automake zsh -c "exit" + $TEA +cmake.org zsh -c "exit" + $TEA +mesonbuild.com zsh -c "exit" + $TEA +ninja-build.org zsh -c "exit" +} + +echo "=> This script will create small environment" +echo " with dotfiles from ivabus/ivabus-dotfiles" +echo ":: Press enter for continue" +read + +echo "=> Installing env to ~/.env" +mkdir -p ~/.env/bin > /dev/null 2>&1 + +TEA_PREFIX=~/.env/tea +TEA=~/.env/tea/tea.xyz/v0/bin/tea +PATH=$PATH + +echo "=> Installing static zsh" +sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh-bin/master/install)" -q -d ~/.env -e no +PATH="$HOME/.env/bin:$PATH" + +echo "=> Installing tea" +sh <(curl https://tea.xyz) -s +echo "=> Installing neovim" +$TEA +neovim.io zsh -c "exit" +echo "=> Installing htop" +$TEA +htop.dev zsh -c "exit" + + +echo -n ":: Would you like to install compilers/interpretators (LLVM, Rust, Python)? (Y/n): " +read $INSTALL_COMPILERS +if [ "${INSTALL_COMPILERS^^}" = "Y" ]; then + install_compilers +fi + +echo -n ":: Would you like to install development tools (git, github cli, make/cmake/meson/ninja)? (Y/n): " +read $INSTALL_TOOLS +if [ "${INSTALL_TOOLS^^}" = "Y" ]; then + install_tools +fi + +echo "=> Configuring \$PATH" +for i in "tea" "nvim" "clang" "clang++" "lldb" "rustc" "cargo" "htop" "make" "cmake" "automake" "meson" "ninja" "git" "gh" +do + ln -s $TEA ~/.env/bin/$i +done + +echo "=> Installing dotfiles" +git clone https://github.com/ivabus/ivabus-dotfiles ~/.env/dotfiles +sh ~/.env/dotfiles/tools/link_env.sh +ZSH="$HOME/.env/oh-my-zsh" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended > /dev/null 2>&1 +curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.env/oh-my-zsh/custom/themes/ivabus.zsh-theme > /dev/null 2>&1 +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.env/oh-my-zsh/custom/plugins/zsh-syntax-highlighting > /dev/null 2>&1 + +echo "=> Environment installed to ~/.env" +echo " To start environment just type:" +echo " PATH=\"\$HOME/.env/bin:\$PATH\" zsh" diff --git a/tools/link_env.sh b/tools/link_env.sh new file mode 100644 index 0000000..5d18bf8 --- /dev/null +++ b/tools/link_env.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +echo "=> Linking zshrc" +if [ -f ~/.zshrc ]; then + echo "=> Moving old zshrc to ~/.zshrc.old" + mv ~/.zshrc ~/.zshrc.old +fi +ln -s ~/.env/dotfiles/.zshrc ~/.zshrc +echo "=> Linking neovim files" +rm -rf ${XDG_CONFIG_HOME:-$HOME/.config}/nvim +ln -s ~/.env/dotfiles/nvim ${XDG_CONFIG_HOME:-$HOME/.config}/nvim From e079f545810ebc97c88d4c2872359e44a895aa9a Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Tue, 3 Jan 2023 19:06:00 +0300 Subject: [PATCH 3/4] Fix homebrew installation --- tools/mac.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mac.sh b/tools/mac.sh index dc46479..fb9aa68 100755 --- a/tools/mac.sh +++ b/tools/mac.sh @@ -11,7 +11,7 @@ if [ "$(arch)" == "arm64" ] then HOMEBREW_PREFIX="/opt/homebrew" else - HOMEBREW_PREFIX="/usr/local/homebrew" + HOMEBREW_PREFIX="/usr/local" fi echo "eval \"\$($HOMEBREW_PREFIX/bin/brew shellenv)\"" >> $HOME/.zprofile brew install pinentry-mac gpg2 From e6e7300c71831072e56c43d27aea63bf77380c9c Mon Sep 17 00:00:00 2001 From: Ivan Bushchik Date: Tue, 3 Jan 2023 19:07:23 +0300 Subject: [PATCH 4/4] Add env to README.md and edit curl commands --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cd2591b..6038004 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ During the installation you can configure git by embedded configurator: - code signing ```sh -sh -c "$(curl -fsSL https://ivabus.dev/dotfiles)" +sh <(curl ivabus.dev/dotfiles) ``` ### Upgrading dotfiles @@ -29,3 +29,11 @@ Just run `upgrade_dotfiles` in your shell. Script will `git pull`, then relink o #![screenshot-2022-12-08_18-08-29](https://user-images.githubusercontent.com/71599788/206481983-5dac2d62-5aea-4ccf-990a-b9ee6d53422f.png) [Repo Packages](https://ivabus.dev/pkgs), [AUR packages](https://ivabus.dev/aur). + +## Environment + +TODO: description + +```sh +sh <(curl ivabus.dev/env) +``` \ No newline at end of file