diff --git a/.chezmoiignore b/.chezmoiignore new file mode 100644 index 0000000..04de44e --- /dev/null +++ b/.chezmoiignore @@ -0,0 +1 @@ +to_install.txt diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 9b28ba4..0000000 --- a/.gitmodules +++ /dev/null @@ -1,16 +0,0 @@ -[submodule "dotbot"] - path = dotbot - url = https://github.com/anishathalye/dotbot - ignore = dirty -[submodule "oh-my-zsh"] - path = oh-my-zsh - url = https://git.jika.li/Jika/oh-my-zsh -[submodule "ohmyzsh"] - path = ohmyzsh - url = https://git.jika.li/Jika/ohmyzsh -[submodule "omz-custom/plugins/zsh-autosuggestions"] - path = omz-custom/plugins/zsh-autosuggestions - url = https://github.com/zsh-users/zsh-autosuggestions -[submodule "omz-custom/plugins/zsh-syntax-highlighting"] - path = omz-custom/plugins/zsh-syntax-highlighting - url = https://github.com/zsh-users/zsh-syntax-highlighting diff --git a/alacritty/alacritty.toml b/dot_config/alacritty/alacritty.toml similarity index 100% rename from alacritty/alacritty.toml rename to dot_config/alacritty/alacritty.toml diff --git a/alacritty/colors.toml b/dot_config/alacritty/colors.toml similarity index 100% rename from alacritty/colors.toml rename to dot_config/alacritty/colors.toml diff --git a/alacritty/fonts.toml b/dot_config/alacritty/fonts.toml similarity index 100% rename from alacritty/fonts.toml rename to dot_config/alacritty/fonts.toml diff --git a/nvim/.stylua.toml b/dot_config/nvim/.stylua.toml similarity index 100% rename from nvim/.stylua.toml rename to dot_config/nvim/.stylua.toml diff --git a/nvim/LICENSE b/dot_config/nvim/LICENSE similarity index 100% rename from nvim/LICENSE rename to dot_config/nvim/LICENSE diff --git a/nvim/README.md b/dot_config/nvim/README.md similarity index 100% rename from nvim/README.md rename to dot_config/nvim/README.md diff --git a/nvim/init.lua b/dot_config/nvim/init.lua similarity index 100% rename from nvim/init.lua rename to dot_config/nvim/init.lua diff --git a/nvim/lua/chadrc.lua b/dot_config/nvim/lua/chadrc.lua similarity index 100% rename from nvim/lua/chadrc.lua rename to dot_config/nvim/lua/chadrc.lua diff --git a/nvim/lua/configs/conform.lua b/dot_config/nvim/lua/configs/conform.lua similarity index 100% rename from nvim/lua/configs/conform.lua rename to dot_config/nvim/lua/configs/conform.lua diff --git a/nvim/lua/configs/default-lsp.lua b/dot_config/nvim/lua/configs/default-lsp.lua similarity index 100% rename from nvim/lua/configs/default-lsp.lua rename to dot_config/nvim/lua/configs/default-lsp.lua diff --git a/nvim/lua/configs/default-ts.lua b/dot_config/nvim/lua/configs/default-ts.lua similarity index 100% rename from nvim/lua/configs/default-ts.lua rename to dot_config/nvim/lua/configs/default-ts.lua diff --git a/nvim/lua/configs/lazy.lua b/dot_config/nvim/lua/configs/lazy.lua similarity index 100% rename from nvim/lua/configs/lazy.lua rename to dot_config/nvim/lua/configs/lazy.lua diff --git a/nvim/lua/configs/lspconfig.lua b/dot_config/nvim/lua/configs/lspconfig.lua similarity index 100% rename from nvim/lua/configs/lspconfig.lua rename to dot_config/nvim/lua/configs/lspconfig.lua diff --git a/nvim/lua/configs/nvim-tree.lua b/dot_config/nvim/lua/configs/nvim-tree.lua similarity index 100% rename from nvim/lua/configs/nvim-tree.lua rename to dot_config/nvim/lua/configs/nvim-tree.lua diff --git a/nvim/lua/mappings.lua b/dot_config/nvim/lua/mappings.lua similarity index 100% rename from nvim/lua/mappings.lua rename to dot_config/nvim/lua/mappings.lua diff --git a/nvim/lua/options.lua b/dot_config/nvim/lua/options.lua similarity index 100% rename from nvim/lua/options.lua rename to dot_config/nvim/lua/options.lua diff --git a/nvim/lua/plugins/action-preview.lua b/dot_config/nvim/lua/plugins/action-preview.lua similarity index 100% rename from nvim/lua/plugins/action-preview.lua rename to dot_config/nvim/lua/plugins/action-preview.lua diff --git a/nvim/lua/plugins/crates.lua b/dot_config/nvim/lua/plugins/crates.lua similarity index 100% rename from nvim/lua/plugins/crates.lua rename to dot_config/nvim/lua/plugins/crates.lua diff --git a/nvim/lua/plugins/endhints.lua b/dot_config/nvim/lua/plugins/endhints.lua similarity index 100% rename from nvim/lua/plugins/endhints.lua rename to dot_config/nvim/lua/plugins/endhints.lua diff --git a/nvim/lua/plugins/image.lua b/dot_config/nvim/lua/plugins/image.lua similarity index 100% rename from nvim/lua/plugins/image.lua rename to dot_config/nvim/lua/plugins/image.lua diff --git a/nvim/lua/plugins/init.lua b/dot_config/nvim/lua/plugins/init.lua similarity index 100% rename from nvim/lua/plugins/init.lua rename to dot_config/nvim/lua/plugins/init.lua diff --git a/nvim/lua/plugins/jdtls.lua b/dot_config/nvim/lua/plugins/jdtls.lua similarity index 100% rename from nvim/lua/plugins/jdtls.lua rename to dot_config/nvim/lua/plugins/jdtls.lua diff --git a/nvim/lua/plugins/lint.lua b/dot_config/nvim/lua/plugins/lint.lua similarity index 100% rename from nvim/lua/plugins/lint.lua rename to dot_config/nvim/lua/plugins/lint.lua diff --git a/nvim/lua/plugins/markpreview.lua b/dot_config/nvim/lua/plugins/markpreview.lua similarity index 100% rename from nvim/lua/plugins/markpreview.lua rename to dot_config/nvim/lua/plugins/markpreview.lua diff --git a/nvim/lua/plugins/mason-tool-installer.lua b/dot_config/nvim/lua/plugins/mason-tool-installer.lua similarity index 100% rename from nvim/lua/plugins/mason-tool-installer.lua rename to dot_config/nvim/lua/plugins/mason-tool-installer.lua diff --git a/nvim/lua/plugins/noice.lua b/dot_config/nvim/lua/plugins/noice.lua similarity index 100% rename from nvim/lua/plugins/noice.lua rename to dot_config/nvim/lua/plugins/noice.lua diff --git a/nvim/lua/plugins/project.lua b/dot_config/nvim/lua/plugins/project.lua similarity index 100% rename from nvim/lua/plugins/project.lua rename to dot_config/nvim/lua/plugins/project.lua diff --git a/nvim/lua/plugins/rustaceanvim.lua b/dot_config/nvim/lua/plugins/rustaceanvim.lua similarity index 100% rename from nvim/lua/plugins/rustaceanvim.lua rename to dot_config/nvim/lua/plugins/rustaceanvim.lua diff --git a/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua similarity index 100% rename from nvim/lua/plugins/telescope.lua rename to dot_config/nvim/lua/plugins/telescope.lua diff --git a/nvim/lua/plugins/ufo.lua b/dot_config/nvim/lua/plugins/ufo.lua similarity index 100% rename from nvim/lua/plugins/ufo.lua rename to dot_config/nvim/lua/plugins/ufo.lua diff --git a/nvim/lua/plugins/venv.lua b/dot_config/nvim/lua/plugins/venv.lua similarity index 100% rename from nvim/lua/plugins/venv.lua rename to dot_config/nvim/lua/plugins/venv.lua diff --git a/rofi/config.rasi b/dot_config/rofi/config.rasi similarity index 100% rename from rofi/config.rasi rename to dot_config/rofi/config.rasi diff --git a/rofi/launcher b/dot_config/rofi/launcher similarity index 100% rename from rofi/launcher rename to dot_config/rofi/launcher diff --git a/rofi/launcher.rasi b/dot_config/rofi/launcher.rasi similarity index 100% rename from rofi/launcher.rasi rename to dot_config/rofi/launcher.rasi diff --git a/rofi/onedark.rasi b/dot_config/rofi/onedark.rasi similarity index 100% rename from rofi/onedark.rasi rename to dot_config/rofi/onedark.rasi diff --git a/rofi/powermenu.rasi b/dot_config/rofi/powermenu.rasi similarity index 100% rename from rofi/powermenu.rasi rename to dot_config/rofi/powermenu.rasi diff --git a/rofi/powermenu b/dot_config/rofi/powermenu.tmpl similarity index 92% rename from rofi/powermenu rename to dot_config/rofi/powermenu.tmpl index 78c323c..918bced 100755 --- a/rofi/powermenu +++ b/dot_config/rofi/powermenu.tmpl @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# vim: ft=bash ## Author : Aditya Shakya (adi1090x) ## Github : @adi1090x @@ -62,11 +63,19 @@ run_cmd() { selected="$(confirm_exit)" if [[ "$selected" == "$yes" ]]; then if [[ $1 == '--shutdown' ]]; then + {{- if eq .chezmoi.os "linux" }} + shutdown now + {{- else }} shutdown -p now + {{ end }} elif [[ $1 == '--reboot' ]]; then shutdown -r now elif [[ $1 == '--suspend' ]]; then + {{- if eq .chezmoi.os "linux" }} + systemctl suspend + {{- else }} acpiconf -s 3 + {{ end }} elif [[ $1 == '--logout' ]]; then if [[ "$XDG_SESSION_DESKTOP" == 'openbox' ]]; then openbox --exit diff --git a/sway/config b/dot_config/sway/config.tmpl similarity index 97% rename from sway/config rename to dot_config/sway/config.tmpl index d8d4b05..5b17ddd 100644 --- a/sway/config +++ b/dot_config/sway/config.tmpl @@ -1,3 +1,4 @@ +# vim: ft=swayconfig # Read `man 5 sway` for a complete reference. seat seat0 xcursor_theme Breeze-Obsidian 25 @@ -28,12 +29,14 @@ set $menu ~/.config/rofi/launcher ### Output configuration # -# Default wallpaper (more resolutions are available in /usr/local/share/backgrounds/sway/) +# Default wallpaper (more resolutions are available in /usr/local/share/backgrounds/sway/) +{{- if eq .chezmoi.os "linux" }} +output * bg ~/.config/sway/od_arch.png fill +{{- else }} output * bg ~/.config/sway/od_freebsd.png fill +{{ end }} -# Example configuration: -# -output DP-3 resolution 3440x1440@165hz position 1920,0 +include ~/.config/sway/outputs.d/{{ .swayProfile }}.conf # # You can get the names of your outputs by running: swaymsg -t get_outputs diff --git a/dot_config/sway/od_arch.png b/dot_config/sway/od_arch.png new file mode 100644 index 0000000..6cd6310 Binary files /dev/null and b/dot_config/sway/od_arch.png differ diff --git a/sway/od_freebsd.png b/dot_config/sway/od_freebsd.png similarity index 100% rename from sway/od_freebsd.png rename to dot_config/sway/od_freebsd.png diff --git a/dot_config/sway/outputs.d/laptop.conf b/dot_config/sway/outputs.d/laptop.conf new file mode 100644 index 0000000..4a5b418 --- /dev/null +++ b/dot_config/sway/outputs.d/laptop.conf @@ -0,0 +1 @@ +output eDP-1 resolution 2880x1800@120hz diff --git a/dot_config/sway/outputs.d/splitscreen.conf b/dot_config/sway/outputs.d/splitscreen.conf new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/sway/outputs.d/ultrawide.conf b/dot_config/sway/outputs.d/ultrawide.conf new file mode 100644 index 0000000..25aafa2 --- /dev/null +++ b/dot_config/sway/outputs.d/ultrawide.conf @@ -0,0 +1 @@ +output DP-3 resolution 3440x1440@165hz position 1920,0 diff --git a/waybar/config b/dot_config/waybar/config.tmpl similarity index 86% rename from waybar/config rename to dot_config/waybar/config.tmpl index 5b1b8f0..f85b498 100755 --- a/waybar/config +++ b/dot_config/waybar/config.tmpl @@ -1,31 +1,27 @@ +// vim: ft=json5 +{{- $hasBattery := false -}} +{{- if eq .chezmoi.os "linux" -}} + {{- if (glob "/sys/class/power_supply/BAT*") -}} + {{- $hasBattery = true -}} + {{- end -}} +{{- end -}} + { + "include": ["~/.config/waybar/media.json"], "layer": "top", - "output": ["DP-3"], - // "mode": "dock", + {{ include (printf "dot_config/waybar/outputs.d/%s.conf" .swayProfile) }} "gtk-layer-shell": "true", - //"exclusive": "false", - //"passthrough": "true", "spacing": 0, "margin-top": 0, "margin-bottom": 2, "height": 32, "modules-left": ["custom/launcher","sway/workspaces","cpu","memory","disk","sway/window"], "modules-center": ["custom/media"], - "modules-right": ["custom/update_audio","sway/mode","custom/kernel","custom/network","pulseaudio","tray","clock","custom/power"], + "modules-right": ["custom/update_audio","sway/mode","custom/kernel",{{- if eq .chezmoi.os "linux" -}}"network"{{- else }} "custom/network"{{ end}},"pulseaudio","tray","clock",{{- if $hasBattery -}} +"battery", +{{- end -}}"custom/power"], + -"custom/media": { - "format": " {} {icon}", - "return-type": "json", - "format-icons": { - "Playing": " ", - "Paused": " ", - "Stopped": " ", - }, - "max-length":70, - "exec": "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}'", - "on-click": "playerctl play-pause", - "interval": 1, -}, "keyboard-state": { "numlock": true, "capslock": true, @@ -68,7 +64,6 @@ "active": "", "focused": "" }, - "on-click": "activate", "window-rewrite": {} // "sort-by-coordinates": true }, @@ -142,14 +137,22 @@ "on-click" : "", }, "network": { - // "interface": "wlp2*", // (Optional) To force the use of this interface - "format-wifi": "", + // "interface": "wlan0", // (Optional) To force the use of this interface + "format-wifi": " {bandwidthDownBytes}", "format-ethernet": " {ifname}: {ipaddr}/{cidr}", "format-linked": "{ifname} (No IP) ", "format-disconnected": "睊 Not connected", "format-alt": "{ifname}: {ipaddr}/{cidr}", "tooltip-format": "{essid} {signalStrength}%" }, + "battery": { + "format": "{icon} {capacity}%", + "states": { + "warning": 30, + "critical": 15 + }, + "format-icons": ["", "", "", "", ""] + }, "pulseaudio": { "format": "{icon} {volume}%", "format-bluetooth": "{icon} {volume}% {format_source}", @@ -192,7 +195,11 @@ "tooltip": false }, "custom/launcher": { + {{ if eq .chezmoi.os "linux" -}} + "format": "󰣇", + {{ else -}} "format": "", + {{ end -}} "on-click": "~/.config/rofi/launcher", "on-click-right": "killall -9 rofi", "tooltip": false @@ -240,9 +247,14 @@ "on-click" : "", }, "custom/kernel": { + {{ if eq .chezmoi.os "linux" -}} + "format": "󰣇 {}", + "exec": "uname -rn | cut -d '-' -f1", + {{ else -}} "format": " {}", - "interval": 7200, "exec": "uname -v | cut -d '-' -f1", + {{ end -}} + "interval": 7200, "on-click" : "", }, "custom/eix": { diff --git a/dot_config/waybar/media.json b/dot_config/waybar/media.json new file mode 100644 index 0000000..90f7118 --- /dev/null +++ b/dot_config/waybar/media.json @@ -0,0 +1,13 @@ +{"custom/media": { + "format": " {} {icon}", + "return-type": "json", + "format-icons": { + "Playing": " ", + "Paused": " ", + "Stopped": " ", + }, + "max-length":70, + "exec": "playerctl -a metadata --format '{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}'", + "on-click": "playerctl play-pause", + "interval": 1, +}, diff --git a/dot_config/waybar/outputs.d/laptop.conf b/dot_config/waybar/outputs.d/laptop.conf new file mode 100644 index 0000000..290e059 --- /dev/null +++ b/dot_config/waybar/outputs.d/laptop.conf @@ -0,0 +1 @@ +"output": ["eDP-1"], diff --git a/dot_config/waybar/outputs.d/splitscreen.conf b/dot_config/waybar/outputs.d/splitscreen.conf new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/waybar/outputs.d/ultrawide.conf b/dot_config/waybar/outputs.d/ultrawide.conf new file mode 100644 index 0000000..e0a2156 --- /dev/null +++ b/dot_config/waybar/outputs.d/ultrawide.conf @@ -0,0 +1 @@ + "output": ["DP-3"], diff --git a/waybar/style.css b/dot_config/waybar/style.css similarity index 87% rename from waybar/style.css rename to dot_config/waybar/style.css index 04f2061..4ec3173 100755 --- a/waybar/style.css +++ b/dot_config/waybar/style.css @@ -53,6 +53,7 @@ tooltip { #custom-update, #custom-media, #disk, +#battery, #tray { background-color: #1e222a; padding: 0 6px; @@ -62,14 +63,13 @@ tooltip { background-clip: padding-box; } -#pulseaudio { - color: #efbd5d; -} - +#custom-power, #pulseaudio.muted { background-color: #e06c75; } +#clock, +#custom-kernel, #custom-gputmp { color: #41a7fc; } @@ -78,19 +78,19 @@ tooltip { color: #c75ae8; } +#battery, #memory { color: #8bcd5b; } +#pulseaudio, #cpu { color: #efbd5d; } -#custom-uptime { - color: #34bfd0; -} - -#temperature { +#temperature, +#custom-network, +#network { color: #c75ae8; } @@ -99,23 +99,14 @@ tooltip { color: #1f1f1f; } -#custom-kernel { - color: #41a7fc; -} - -#custom-weather { - color: #34bfd0; -} - +#mode, +#custom-uptime, +#custom-weather, #custom-media, #disk { color: #34bfd0; } -#custom-network { - color: #e06c75; -} - #workspaces{ } @@ -142,38 +133,22 @@ tooltip { color: #e06c75; } -#clock { - color: #41a7fc; -} -#mode { - color: #34bfd0; -} #window { color: #abb2bf; } -#custom-power { - color: #e06c75; -} - #custom-launcher { font-size: 13px; color: #ADA8D0; } -#custom-eix { - color: #2ec27e; -} +#custom-eix, #custom-update { color: #2ec27e; } -#network { - color: #c75ae8; -} - #network.disconnected { color: #1f1f1f; background-color: #e06c75; diff --git a/yazi/package.toml b/dot_config/yazi/package.toml similarity index 100% rename from yazi/package.toml rename to dot_config/yazi/package.toml diff --git a/yazi/yazi.toml b/dot_config/yazi/yazi.toml similarity index 100% rename from yazi/yazi.toml rename to dot_config/yazi/yazi.toml diff --git a/omz-custom/themes/archcraft.zsh-theme b/dot_oh-my-zsh/custom/themes/archcraft.zsh-theme similarity index 100% rename from omz-custom/themes/archcraft.zsh-theme rename to dot_oh-my-zsh/custom/themes/archcraft.zsh-theme diff --git a/dot_zshrc b/dot_zshrc new file mode 100644 index 0000000..9460052 --- /dev/null +++ b/dot_zshrc @@ -0,0 +1,59 @@ +# Path to your oh-my-zsh installation. +export ZSH=$HOME/.oh-my-zsh +export PATH="/home/jika/Scripts/:/home/jika/.cargo/bin:$PATH" +export PATH="/home/jika/.local/bin:/home/jika/.deno/bin:$PATH" +export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock +export EDITOR="/usr/bin/nvim" +ZSH_THEME="archcraft" +plugins=(git zsh-autosuggestions zsh-syntax-highlighting) + +source $ZSH/oh-my-zsh.sh + +# Aliases +alias ip='ip -c' +alias sshh='fast-ssh' +alias gitui='eval `ssh-agent -s` && ssh-add && gitui' +alias open='~/.local/bin/open.sh' +alias ytdlv='yt-dlp -vU -S "res:1080,fps"' +alias ytdlm='yt-dlp --embed-thumbnail --embed-metada -x --audio-format best' +alias mpv4='mpv --ytdl-raw-options=force-ipv4=' + +# omz +alias zshconfig="vim ~/.zshrc" +alias ohmyzsh="cd ~/.oh-my-zsh" + +# cli replacement +alias cat='bat' +alias grep='rg' +alias du='dust' +alias df='dysk' + +# ls +alias ls='eza --icons=always --git' +alias l='ls -lb' +alias l1='ls -1' +alias ll='ls -lab' +alias lb='ls -lb --reverse --sort=size' +alias lr='ls -R' +alias lt='ls -T' +alias lg='ls -l --group-directories-first' + +# git +alias gcl='git clone --depth 1' +alias gi='git init' +alias ga='git add' +alias gc='git commit -m' +alias gp='git push origin master' + +#cd +alias cd..='cd ..' + +# yazi +function y() { + local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd + yazi "$@" --cwd-file="$tmp" + if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then + builtin cd -- "$cwd" + fi + rm -f -- "$tmp" +} diff --git a/dotbot b/dotbot deleted file mode 160000 index 7202065..0000000 --- a/dotbot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 720206578a8daf1e7167200e73e314fc4b8af52e diff --git a/install b/install deleted file mode 100755 index 5a7e72c..0000000 --- a/install +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CONFIG="install.conf.yaml" -DOTBOT_DIR="dotbot" - -DOTBOT_BIN="bin/dotbot" -BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -cd "${BASEDIR}" -git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive -git submodule update --init --recursive "${DOTBOT_DIR}" - -"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}" diff --git a/install.conf.yaml b/install.conf.yaml deleted file mode 100644 index dd80992..0000000 --- a/install.conf.yaml +++ /dev/null @@ -1,24 +0,0 @@ -- defaults: - create: true - link: - relink: true - -- clean: ['~'] - -- link: - ~/.config/alacritty: - ~/.config/sway: - ~/.config/waybar: - ~/.config/rofi: - ~/.config/yazi: - ~/.config/nvim: - ~/.zshrc: - ~/.oh-my-zsh: - path: ohmyzsh - create: true - ~/.local/bin/open.sh: - -- shell: - - [git submodule update --init --recursive, Installing submodules] - - [cp -r omz-custom/* ohmyzsh/custom] - - [cat to_install.txt] diff --git a/ohmyzsh b/ohmyzsh deleted file mode 160000 index c68ff8a..0000000 --- a/ohmyzsh +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c68ff8aeedc2b779ae42d745457ecd443e22e212 diff --git a/omz-custom/plugins/zsh-autosuggestions b/omz-custom/plugins/zsh-autosuggestions deleted file mode 160000 index a411ef3..0000000 --- a/omz-custom/plugins/zsh-autosuggestions +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a411ef3e0992d4839f0732ebeb9823024afaaaa8 diff --git a/omz-custom/plugins/zsh-syntax-highlighting b/omz-custom/plugins/zsh-syntax-highlighting deleted file mode 160000 index caa749d..0000000 --- a/omz-custom/plugins/zsh-syntax-highlighting +++ /dev/null @@ -1 +0,0 @@ -Subproject commit caa749d030d22168445c4cb97befd406d2828db0 diff --git a/open.sh b/open.sh deleted file mode 100755 index af0f212..0000000 --- a/open.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -if [[ -n $1 ]] ; then - xdg-open $1 & - disown %xdg-open -else - exit 1 -fi diff --git a/run_once_before_install_omz.sh b/run_once_before_install_omz.sh new file mode 100755 index 0000000..07d063c --- /dev/null +++ b/run_once_before_install_omz.sh @@ -0,0 +1,37 @@ +#!/bin/sh +set -eu + +OMZ_DIR="${ZSH:-$HOME/.oh-my-zsh}" +OMZ_CUSTOM="${ZSH_CUSTOM:-$OMZ_DIR/custom}" +PLUGINS_DIR="$OMZ_CUSTOM/plugins" + +clone_or_update_plugin() { + name="$1" + url="$2" + dest="$PLUGINS_DIR/$name" + + if [ -d "$dest/.git" ]; then + # update existing plugin repo + git -C "$dest" pull --ff-only + elif [ -e "$dest" ]; then + # path exists but isn't a git repo (avoid clobbering) + echo "Skip: $dest exists but is not a git repo" >&2 + else + git clone "$url" "$dest" + fi +} + +# 1) Oh My Zsh: clone only if missing +if [ -d "$OMZ_DIR/.git" ]; then + : # OMZ already installed, do nothing +elif [ -e "$OMZ_DIR" ]; then + echo "Skip: $OMZ_DIR exists but is not a git repo" >&2 +else + git clone https://github.com/ohmyzsh/ohmyzsh.git "$OMZ_DIR" +fi + +# 2) Plugins: if present pull, else clone (requires OMZ dirs) +mkdir -p "$PLUGINS_DIR" + +clone_or_update_plugin "zsh-autosuggestions" "https://github.com/zsh-users/zsh-autosuggestions" +clone_or_update_plugin "zsh-syntax-highlighting" "https://github.com/zsh-users/zsh-syntax-highlighting" diff --git a/zshrc b/zshrc deleted file mode 100644 index 36df6c3..0000000 --- a/zshrc +++ /dev/null @@ -1,155 +0,0 @@ -#If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH - -# Path to your oh-my-zsh installation. -export ZSH=$HOME/.oh-my-zsh -export PATH="/home/jika/Scripts/:/home/jika/.cargo/bin:$PATH" -export PATH="/home/jika/.local/bin:/home/jika/.deno/bin:$PATH" -export RR_STATION="teo" -export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock -export EDITOR="/usr/bin/nvim" -# Set name of the theme to load --- if set to "random", it will -# load a random theme each time oh-my-zsh is loaded, in which case, -# to know which specific one was loaded, run: echo $RANDOM_THEME -# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes -ZSH_THEME="archcraft" - -# Set list of themes to pick from when loading at random -# Setting this variable when ZSH_THEME="archcraft" -# a theme from this variable instead of looking in $ZSH/themes/ -# If set to an empty array, this variable will have no effect. -# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) - -# Uncomment the following line to use case-sensitive completion. -# CASE_SENSITIVE="true" - -# Uncomment the following line to use hyphen-insensitive completion. -# Case-sensitive completion must be off. _ and - will be interchangeable. -# HYPHEN_INSENSITIVE="true" - -# Uncomment the following line to disable bi-weekly auto-update checks. -# DISABLE_AUTO_UPDATE="true" - -# Uncomment the following line to automatically update without prompting. -# DISABLE_UPDATE_PROMPT="true" - -# Uncomment the following line to change how often to auto-update (in days). -# export UPDATE_ZSH_DAYS=13 - -# Uncomment the following line if pasting URLs and other text is messed up. -# DISABLE_MAGIC_FUNCTIONS="true" - -# Uncomment the following line to disable colors in ls. -# DISABLE_LS_COLORS="true" - -# Uncomment the following line to disable auto-setting terminal title. -# DISABLE_AUTO_TITLE="true" - -# Uncomment the following line to enable command auto-correction. -# ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) -# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# You can set one of the optional three formats: -# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# or set a custom format using the strftime function format specifications, -# see 'man strftime' for details. -# HIST_STAMPS="mm/dd/yyyy" - -# Would you like to use another custom folder than $ZSH/custom? -# ZSH_CUSTOM=/path/to/new-custom-folder - -# Which plugins would you like to load? -# Standard plugins can be found in $ZSH/plugins/ -# Custom plugins may be added to $ZSH_CUSTOM/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. -plugins=(git zsh-autosuggestions zsh-syntax-highlighting) - -source $ZSH/oh-my-zsh.sh - -# User configuration - -# export MANPATH="/usr/local/man:$MANPATH" - -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor for local and remote sessions -# if [[ -n $SSH_CONNECTION ]]; then -# export EDITOR='vim' -# else -# export EDITOR='mvim' -# fi - -# Compilation flags -# export ARCHFLAGS="-arch x86_64" - -# - - -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. -# -# Aliases -alias ip='ip -c' -alias sshh='fast-ssh' -alias gitui='eval `ssh-agent -s` && ssh-add && gitui' -# alias zshconfig="mate ~/.zshrc" -# alias ohmyzsh="mate ~/.oh-my-zsh" -alias open='~/.local/bin/open.sh' -alias ytdlv='yt-dlp -vU -S "res:1080,fps"' -alias ytdlm='yt-dlp --embed-thumbnail --embed-metada -x --audio-format best' -alias mpv4='mpv --ytdl-raw-options=force-ipv4=' - -# omz -alias zshconfig="vim ~/.zshrc" -alias ohmyzsh="cd ~/.oh-my-zsh" - -# cli replacement -alias cat='bat' -alias grep='rg' -alias du='dust' -alias df='dysk' - -# ls -alias ls='eza --icons=always --git' -alias l='ls -lb' -alias l1='ls -1' -alias ll='ls -lab' -alias lb='ls -lb --reverse --sort=size' -alias lr='ls -R' -alias lt='ls -T' -alias lg='ls -l --group-directories-first' - -# git -alias gcl='git clone --depth 1' -alias gi='git init' -alias ga='git add' -alias gc='git commit -m' -alias gp='git push origin master' - -#cd -alias cd..='cd ..' - -# yazi -function y() { - local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd - yazi "$@" --cwd-file="$tmp" - if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then - builtin cd -- "$cwd" - fi - rm -f -- "$tmp" -}