From 0551cb009e210f35cf93f98a9994e2c96747d11e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20B=C3=A4rtschi?= Date: Sat, 5 Jul 2025 19:11:03 +0200 Subject: [PATCH] configs, configs and even more configs --- .gitignore | 1 + configs/.zshrc | 114 +++++++++++++++ configs/alacritty.toml | 32 +++++ configs/fonts.conf | 23 ++++ configs/hyprpaper.conf | 5 + configs/tmux.conf | 100 ++++++++++++++ configs/waybar/config | 106 ++++++++++++++ configs/waybar/style.css | 289 +++++++++++++++++++++++++++++++++++++++ install.sh | 9 ++ programs/dev.sh | 16 +++ programs/fonts.sh | 11 ++ programs/git.sh | 2 +- programs/hyprland.sh | 41 ++++++ programs/neovim.sh | 10 ++ programs/tmux.sh | 10 ++ programs/yay.sh | 18 +++ programs/zsh.sh | 14 ++ std.sh | 68 ++++++++- 18 files changed, 862 insertions(+), 7 deletions(-) create mode 100644 .gitignore create mode 100644 configs/.zshrc create mode 100644 configs/alacritty.toml create mode 100644 configs/fonts.conf create mode 100644 configs/hyprpaper.conf create mode 100755 configs/tmux.conf create mode 100644 configs/waybar/config create mode 100644 configs/waybar/style.css create mode 100755 programs/dev.sh create mode 100755 programs/fonts.sh create mode 100755 programs/hyprland.sh create mode 100755 programs/neovim.sh create mode 100755 programs/tmux.sh create mode 100755 programs/yay.sh create mode 100755 programs/zsh.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7947b2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +aur-packages/yay diff --git a/configs/.zshrc b/configs/.zshrc new file mode 100644 index 0000000..21fec81 --- /dev/null +++ b/configs/.zshrc @@ -0,0 +1,114 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH + +# Path to your Oh My Zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# 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="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# 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 one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 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. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #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 + +ZOXIDE_CMD_OVERRIDE="cd" +# 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 zoxide sudo fzf) + +source $ZSH/oh-my-zsh.sh + +source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + +export PATH="$HOME/go/bin:$PATH" +export EDITOR=nvim +alias vim=nvim + +# 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='nvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch $(uname -m)" + +# 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 a top-level file in +# the $ZSH_CUSTOM folder, with .zsh extension. Examples: +# - $ZSH_CUSTOM/aliases.zsh +# - $ZSH_CUSTOM/macos.zsh +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +fastfetch diff --git a/configs/alacritty.toml b/configs/alacritty.toml new file mode 100644 index 0000000..b4a5a61 --- /dev/null +++ b/configs/alacritty.toml @@ -0,0 +1,32 @@ +[font.bold] +family = "JetBrainsMono NF" + +[font.bold_italic] +family = "JetBrainsMono NF" + +[font.italic] +family = "JetBrainsMono NF" + +[font.normal] +family = "JetBrainsMono NF" + +# [colors.primary] +# foreground = "#ffffff" +# background = "#000000" +# [colors.cursor] +# cursor = "#ff5fff" +# text = "#ffffff" +# [colors.vi_mode_cursor] +# cursor = "#ff5fff" +# text = "#ffffff" +# [colors.search] +# matches = { foreground = "#ffffff", background = "#5fd7ff" } +# focused_match = { foreground = "#000000", background = "#d78700" } + +[general] +import = ["~/.config/alacritty/themes/tokyonight-night.toml"] + +[keyboard] +bindings = [ + { key = "/", mods = "SHIFT", mode = "Vi|~Search", action = "SearchForward" }, +] diff --git a/configs/fonts.conf b/configs/fonts.conf new file mode 100644 index 0000000..8103d9a --- /dev/null +++ b/configs/fonts.conf @@ -0,0 +1,23 @@ + + + + + + sans-serif + + Noto Sans Cond + + + + serif + + Noto Serif + + + + monospace + + Noto Sans Mono + + + diff --git a/configs/hyprpaper.conf b/configs/hyprpaper.conf new file mode 100644 index 0000000..f6b6902 --- /dev/null +++ b/configs/hyprpaper.conf @@ -0,0 +1,5 @@ +preload = ~/.config/hypr/wallpaper1.png +wallpaper = DP-2,~/.config/hypr/wallpaper1.png +wallpaper = DP-3,~/.config/hypr/wallpaper1.png +wallpaper = Virtual-1,~/.config/hypr/wallpaper1.png + diff --git a/configs/tmux.conf b/configs/tmux.conf new file mode 100755 index 0000000..a577a48 --- /dev/null +++ b/configs/tmux.conf @@ -0,0 +1,100 @@ + +set -g default-terminal "screen" +set -g base-index 1 +setw -g pane-base-index 1 + + + + + +set -g status-keys vi +set -g mode-keys vi + + + +# rebind main key: C-Space +unbind C-b +set -g prefix C-Space +bind -N "Send the prefix key through to the application" \ + C-Space send-prefix + + + + +set -g mouse on +set -g focus-events off +setw -g aggressive-resize off +setw -g clock-mode-style 24 +set -s escape-time 500 +set -g history-limit 2000 + +# ============================================= # +# Load plugins with Home Manager # +# --------------------------------------------- # + +# tmuxplugin-sensible +# --------------------- + +run-shell /nix/store/xccgacyzkbnnf33k016lhsarfb9kpqxp-tmuxplugin-sensible-unstable-2022-08-14/share/tmux-plugins/sensible/sensible.tmux + + +# tmuxplugin-vim-tmux-navigator +# --------------------- + +run-shell /nix/store/bngimwm4lgppc23a4231165w5s8vd3pg-tmuxplugin-vim-tmux-navigator-unstable-2022-08-21/share/tmux-plugins/vim-tmux-navigator/vim-tmux-navigator.tmux + + +# tmuxplugin-yank +# --------------------- + +run-shell /nix/store/rvch7dacrx3pj2jlsyplkjmklw1jf14h-tmuxplugin-yank-unstable-2023-07-19/share/tmux-plugins/yank/yank.tmux + +# ============================================= # + +set-option -a terminal-features 'alacritty:RGB' +bind -n M-H previous-window +bind -n M-L next-window +bind-key -T copy-mode-vi v send-keys -X begin-selection +bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle +bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel +bind '"' split-window -v -c "#{pane_current_path}" +bind % split-window -h -c "#{pane_current_path}" + +#!/usr/bin/env bash + +# TokyoNight colors for Tmux + +set -g mode-style "fg=#7aa2f7,bg=#3b4261" + +set -g message-style "fg=#7aa2f7,bg=#3b4261" +set -g message-command-style "fg=#7aa2f7,bg=#3b4261" + +set -g pane-border-style "fg=#3b4261" +set -g pane-active-border-style "fg=#7aa2f7" + +set -g status "on" +set -g status-justify "left" + +set -g status-style "fg=#7aa2f7,bg=#16161e" + +set -g status-left-length "100" +set -g status-right-length "100" + +set -g status-left-style NONE +set -g status-right-style NONE + +set -g status-left "#[fg=#15161e,bg=#7aa2f7,bold] #S #[fg=#7aa2f7,bg=#16161e,nobold,nounderscore,noitalics]" +set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %I:%M %p #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161e,bg=#7aa2f7,bold] #h " +if-shell '[ "$(tmux show-option -gqv "clock-mode-style")" == "24" ]' { + set -g status-right "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#16161e] #{prefix_highlight} #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261] %Y-%m-%d  %H:%M #[fg=#7aa2f7,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#15161e,bg=#7aa2f7,bold] #h " +} + +setw -g window-status-activity-style "underscore,fg=#a9b1d6,bg=#16161e" +setw -g window-status-separator "" +setw -g window-status-style "NONE,fg=#a9b1d6,bg=#16161e" +setw -g window-status-format "#[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]#[default] #I  #W #F #[fg=#16161e,bg=#16161e,nobold,nounderscore,noitalics]" +setw -g window-status-current-format "#[fg=#16161e,bg=#3b4261,nobold,nounderscore,noitalics]#[fg=#7aa2f7,bg=#3b4261,bold] #I  #W #F #[fg=#3b4261,bg=#16161e,nobold,nounderscore,noitalics]" + +# tmux-plugins/tmux-prefix-highlight support +set -g @prefix_highlight_output_prefix "#[fg=#e0af68]#[bg=#16161e]#[fg=#16161e]#[bg=#e0af68]" +set -g @prefix_highlight_output_suffix "" diff --git a/configs/waybar/config b/configs/waybar/config new file mode 100644 index 0000000..ee1c3ec --- /dev/null +++ b/configs/waybar/config @@ -0,0 +1,106 @@ +{ + "layer": "top", + "height": 30, + "spacing": 4, + "modules-left": ["hyprland/workspaces", "hyprland/submap", "custom/media"], + "modules-center": ["hyprland/window"], + "modules-right": ["idle_inhibitor", "pulseaudio", "network", "cpu", "memory", "temperature", "backlight", "keyboard-state", "hyprland/language", "clock", "tray"], + "keyboard-state": { + "numlock": true, + "capslock": true, + "format": "{name} {icon}", + "format-icons": { + "locked": "", + "unlocked": "" + } + }, + "hyprland/submap": { + "format": "{}" + }, + + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + "timezone": "Europe/Zurich", + "tooltip-format": "{:%Y %B}\n{calendar}", + "format-alt": "{:%Y-%m-%d}" + }, + "cpu": { + "format": "{usage}% ", + // "tooltip": false + }, + "memory": { + "format": "{}% " + }, + "temperature": { + // "thermal-zone": 2, + "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{temperatureC}°C {icon}", + "format-icons": ["", "", ""] + }, + "backlight": { + // "device": "acpi_video1", + "format": "{percent}% {icon}", + "format-icons": ["", "", "", "", "", "", "", "", ""] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon}", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-alt": "{time} {icon}", + // "format-good": "", // An empty format will hide the module + // "format-full": "", + "format-icons": ["", "", "", "", ""] + }, + "battery#bat2": { + "bat": "BAT2" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{volume}% {icon} {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + "format-source": "{volume}% ", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol" + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "󰎆" // 󰥠 + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py", + //"exec": "$HOME/.config/waybar/mediaplayer.py --verbose 2> /dev/null" // Script in resources folder + //"exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + } +} diff --git a/configs/waybar/style.css b/configs/waybar/style.css new file mode 100644 index 0000000..7a47451 --- /dev/null +++ b/configs/waybar/style.css @@ -0,0 +1,289 @@ +* { + /* `otf-font-awesome` is required to be installed for icons */ + font-family: "JetBrainsMono", FontAwesome, Roboto, Helvetica, Arial, sans-serif; + font-size: 13px; +} + +window#waybar { + background-color: rgba(43, 48, 59, 0.5); + border-bottom: 3px solid rgba(100, 114, 125, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; +} + +window#waybar.hidden { + opacity: 0.2; +} + +/* +window#waybar.empty { + background-color: transparent; +} +window#waybar.solo { + background-color: #FFFFFF; +} +*/ + +window#waybar.termite { + background-color: #3F3F3F; +} + +window#waybar.chromium { + background-color: #000000; + border: none; +} + +box.module { + border-radius: 15px; +} + +label.module { + border-radius: 15px; +} + +button { + /* Use box-shadow instead of border so the text isn't offset */ + box-shadow: inset 0 -3px transparent; + /* Avoid rounded borders under each button name */ + border: none; + border-radius: 0; +} + +/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ +button:hover { + background: inherit; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button { + padding: 0 5px; + background-color: transparent; + color: #ffffff; +} + +#workspaces button:hover { + background: rgba(0, 0, 0, 0.2); +} + +#workspaces button.focused { + background-color: #64727D; + box-shadow: inset 0 -3px #ffffff; +} + +#workspaces button.urgent { + background-color: #eb4d4b; +} + +#mode { + background-color: #64727D; + border-bottom: 3px solid #ffffff; +} + +#clock, +#battery, +#cpu, +#memory, +#disk, +#temperature, +#backlight, +#network, +#pulseaudio, +#wireplumber, +#custom-media, +#tray, +#mode, +#idle_inhibitor, +#scratchpad, +#mpd { + padding: 0 10px; + color: #ffffff; +} + +#window, +#workspaces { + margin: 0 4px; +} + +/* If workspaces is the leftmost module, omit left margin */ +.modules-left>widget:first-child>#workspaces { + margin-left: 0; +} + +/* If workspaces is the rightmost module, omit right margin */ +.modules-right>widget:last-child>#workspaces { + margin-right: 0; +} + +#clock { + background-color: #64727D; +} + +#battery { + background-color: #ffffff; + color: #000000; +} + +#battery.charging, +#battery.plugged { + color: #ffffff; + background-color: #26A65B; +} + +@keyframes blink { + to { + background-color: #ffffff; + color: #000000; + } +} + +#battery.critical:not(.charging) { + background-color: #f53c3c; + color: #ffffff; + animation-name: blink; + animation-duration: 0.5s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +label:focus { + background-color: #000000; +} + +#cpu { + background-color: #2ecc71; + color: #000000; +} + +#memory { + background-color: #9b59b6; +} + +#disk { + background-color: #964B00; +} + +#backlight { + background-color: #90b1b1; +} + +#network { + background-color: #2980b9; +} + +#network.disconnected { + background-color: #f53c3c; +} + +#pulseaudio { + background-color: #f1c40f; + color: #000000; +} + +#pulseaudio.muted { + background-color: #90b1b1; + color: #2a5c45; +} + +#wireplumber { + background-color: #fff0f5; + color: #000000; +} + +#wireplumber.muted { + background-color: #f53c3c; +} + +#custom-media { + background-color: #66cc99; + color: #2a5c45; + min-width: 100px; +} + +#custom-media.custom-spotify { + background-color: #66cc99; +} + +#custom-media.custom-vlc { + background-color: #ffa000; +} + +#temperature { + background-color: #f0932b; +} + +#temperature.critical { + background-color: #eb4d4b; +} + +#tray { + background-color: #2980b9; +} + +#tray>.passive { + -gtk-icon-effect: dim; +} + +#tray>.needs-attention { + -gtk-icon-effect: highlight; + background-color: #eb4d4b; +} + +#idle_inhibitor { + background-color: #2d3436; +} + +#idle_inhibitor.activated { + background-color: #ecf0f1; + color: #2d3436; +} + +#mpd { + background-color: #66cc99; + color: #2a5c45; +} + +#mpd.disconnected { + background-color: #f53c3c; +} + +#mpd.stopped { + background-color: #90b1b1; +} + +#mpd.paused { + background-color: #51a37a; +} + +#language { + background: #00b093; + color: #740864; + padding: 0 5px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state { + background: #97e1ad; + color: #000000; + padding: 0 0px; + margin: 0 5px; + min-width: 16px; +} + +#keyboard-state>label { + padding: 0 5px; +} + +#keyboard-state>label.locked { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad { + background: rgba(0, 0, 0, 0.2); +} + +#scratchpad.empty { + background-color: transparent; +} diff --git a/install.sh b/install.sh index e4383c3..7d58017 100755 --- a/install.sh +++ b/install.sh @@ -1,3 +1,12 @@ #!/usr/bin/env bash +set -e + ./programs/git.sh +./programs/dev.sh +./programs/neovim.sh +./programs/yay.sh +./programs/fonts.sh +./programs/hyprland.sh +./programs/tmux.sh +./programs/zsh.sh diff --git a/programs/dev.sh b/programs/dev.sh new file mode 100755 index 0000000..110d1fa --- /dev/null +++ b/programs/dev.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin dev + +pacinstall wget +pacinstall unzip +pacinstall tree-sitter-cli +pacinstall nodejs +pacinstall npm +pacinstall fzf +pacinstall ripgrep +pacinstall fd +pacinstall lazygit + +program_end diff --git a/programs/fonts.sh b/programs/fonts.sh new file mode 100755 index 0000000..c80b944 --- /dev/null +++ b/programs/fonts.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin fonts + +pacinstall ttf-jetbrains-mono-nerd +pacinstall otf-font-awesome +pacinstall noto-fonts +cp -v configs/fonts.conf ~/.config/fontconfig/fonts.conf + +program_end diff --git a/programs/git.sh b/programs/git.sh index 23e7eb0..34dd8f6 100755 --- a/programs/git.sh +++ b/programs/git.sh @@ -8,4 +8,4 @@ git config --global init.defaultBranch main git config --global user.email "robaertschi@proton.me" git config --global user.name "Robin Bärtschi" -program_end git +program_end diff --git a/programs/hyprland.sh b/programs/hyprland.sh new file mode 100755 index 0000000..d8683c8 --- /dev/null +++ b/programs/hyprland.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin hyprland + +pacinstall hyprpaper +pacinstall hyprpolkitagent +pacinstall network-manager-applet +pacinstall waybar +yayinstall kanata +yayinstall bibata-cursor-theme +pacinstall mako +pacinstall hyprland +pacinstall fuzzel +pacinstall cliphist +pacinstall playerctl +pacinstall wireplumber +pacinstall alacritty +pacinstall dolphin +yayinstall bemoji +pacinstall swaylock +user_unit_enable wireplumber +config_from_nixos_config hypr/hyprland.conf +cp -v configs/hyprpaper.conf ~/.config/hypr/hyprpaper.conf +config_from_nixos_config hypr/wallpaper1.png +cp -v configs/alacritty.toml ~/.config/alacritty.toml +config_from_nixos_config alacritty/themes/tokyonight-night.toml +config_from_nixos_config mako/config +config_from_nixos_config config.kbd kanata/config.kbd +config_from_nixos_config fuzzel.ini fuzzel/fuzzel.ini + +pacinstall python-gobject +pacinstall gobject-introspection +# waybar +# config_from_nixos_config waybar/config +mkdir -v -p ~/.config/waybar +cp -v configs/waybar/config ~/.config/waybar/config +cp -v configs/waybar/style.css ~/.config/waybar/style.css +config_from_nixos_config waybar/mediaplayer.py + +program_end diff --git a/programs/neovim.sh b/programs/neovim.sh new file mode 100755 index 0000000..3b37743 --- /dev/null +++ b/programs/neovim.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin neovim + +pacinstall neovim +mkdir -p ~/.config +git clone https://github.com/RoBaertschi/simple-nvim.git ~/.config/nvim + +program_end diff --git a/programs/tmux.sh b/programs/tmux.sh new file mode 100755 index 0000000..b9dda11 --- /dev/null +++ b/programs/tmux.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin tmux + +pacinstall tmux +mkdir -p -v ~/.config/tmux +cp -v "configs/tmux.conf" ~/.config/tmux/tmux.conf + +program_end diff --git a/programs/yay.sh b/programs/yay.sh new file mode 100755 index 0000000..f240742 --- /dev/null +++ b/programs/yay.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin yay + +pacinstall base-devel + +pacman -Q yay-bin > /dev/null + +if [[ "$?" -ne 0 ]]; then + mkdir -p aur-packages + git clone https://aur.archlinux.org/yay-bin.git aur-packages/yay + pushd aur-packages/yay + makepkg -si + popd +fi + +program_end diff --git a/programs/zsh.sh b/programs/zsh.sh new file mode 100755 index 0000000..86bd8aa --- /dev/null +++ b/programs/zsh.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +. "std.sh" +program_begin zsh + +pacinstall zsh +pacinstall zoxide +pacinstall fastfetch +pacinstall zsh-syntax-highlighting +sudo chsh robin -s /usr/bin/zsh &> /dev/null +sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" > /dev/null +cp -v configs/.zshrc ~/.zshrc + +program_end diff --git a/std.sh b/std.sh index 9435827..736cb7e 100755 --- a/std.sh +++ b/std.sh @@ -2,13 +2,18 @@ # Intendet to be sourced +function error() { + echo "ERROR [${PROGRAM}] " $@ + exit 1 +} + function info() { - echo "INFO: " $@ + echo "INFO [${PROGRAM}] " $@ } function verbose() { if [[ -n "${DOTI_VERBOSE}" ]]; then - echo "VERBOSE: " $@ + echo "VERBOSE [${PROGRAM}] " $@ fi } @@ -23,12 +28,63 @@ function pacinstall() { fi } -function program_begin() { +function yayinstall() { local program=$1 - info "Installing and configuring ${program}" + yay -Q ${program} &> /dev/null + if [[ "$?" -ne "0" ]]; then + info "Installing ${program}" + yay -S --noconfirm ${program} + else + verbose "${program} already installed." + fi +} + +# function install_config_file() { +# local file=$1 +# local dir=$1 +# +# mkdir -p "${dir}" +# +# cp -v "configs/${file}" "${dir}/${file}" +# } + +function config_url_install() { + local file=$1 + local url=$2 + local dir=$(dirname "${file}") + + mkdir -v -p "${dir}" + curl -s -o "${file}" -L "${url}" + verbose "${url} -> ${file}" +} + +function config_from_nixos_config() { + local file=$1 + local dir=$2 + if [[ -z "${dir}" ]]; then + dir="${file}" + fi + config_url_install "${HOME}/.config/${dir}" "https://raw.githubusercontent.com/RoBaertschi/nixos-config/refs/heads/master/configs/${file}" +} + +function unit_enable() { + sudo systemctl enable $1 +} + +function user_unit_enable() { + systemctl enable --user $1 +} + +function program_begin() { + if [[ -n "${PROGRAM}" ]]; then + error "${PROGRAM} still on the program stack" + fi + + export PROGRAM=$1 + info "Installing and configuring ${PROGRAM}" } function program_end() { - local program=$1 - verbose "${program} done" + verbose "${PROGRAM} done" + PROGRAM="" }