aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-09 17:34:31 -0500
committerMohammad Reza Karimi <m.r.karimi.j@gmail.com>2026-01-09 17:34:31 -0500
commit5e83a094476f28eb77508c8b470efe3dfd56de83 (patch)
treef0f39b694fcad8e408c2a41f3d3240dfce44c504 /bash
parent6c17d2c74ea4daeb9dbf2c2b7aafeb86111b7f65 (diff)
some big changes
Diffstat (limited to 'bash')
-rw-r--r--bash/dot-bashrc19
-rw-r--r--bash/dot-config/bash/functions.bash13
-rw-r--r--bash/dot-config/bash/gentoo-color.bash6
-rw-r--r--bash/dot-config/bash/notes.bash18
-rw-r--r--bash/dot-config/shellshort/bm-files5
-rw-r--r--bash/dot-config/shellshort/shortcutrc5
-rw-r--r--bash/dot-profile40
7 files changed, 52 insertions, 54 deletions
diff --git a/bash/dot-bashrc b/bash/dot-bashrc
index cc9c324..0c0c2a2 100644
--- a/bash/dot-bashrc
+++ b/bash/dot-bashrc
@@ -5,7 +5,6 @@
[[ $- != *i* ]] && return
export HISTCONTROL='ignoredups'
-export HISTIGNORE='ls *':'history':'cd':'sudo -i':'yay':'lf':'cd ..':'nvim':'v':'cvim'
export HISTFILESIZE=100000
export HISTSIZE=10000
@@ -35,30 +34,18 @@ alias p='sudo pacman'
alias SS='sudo systemctl'
alias Su='systemctl --user'
alias v='nvim'
-alias vn='NVIM_APPNAME=nvim-final nvim'
alias vv='uv run nvim'
-alias z='setsid runapp -- zathura'
-alias todo='nvim ~/system-notes.md'
+alias todo='nvim ~/notes.md'
alias neofetch='fastfetch -c examples/13'
+alias cvim='nvim -c "cd ~/.config/nvim" -c "Ex"'
# source: https://wiki.archlinux.org/title/GnuPG#Configure_pinentry_to_use_the_correct_TTY
GPG_TTY="$(tty)"
export GPG_TTY
gpg-connect-agent updatestartuptty /bye >/dev/null
-# cp and mv but with rsync
-# source: https://wiki.archlinux.org/title/Rsync#As_cp/mv_alternative
-cpr()
-{
- rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 "$@"
-}
-
-mvr()
-{
- rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files "$@"
-}
-
source "${XDG_CONFIG_HOME:-$HOME/.config}"/bash/functions.bash
+source "${XDG_CONFIG_HOME:-$HOME/.config}"/bash/notes.bash
bind '"\C-o":"\C-ulf\C-m"'
diff --git a/bash/dot-config/bash/functions.bash b/bash/dot-config/bash/functions.bash
index a2a96ba..33bfd67 100644
--- a/bash/dot-config/bash/functions.bash
+++ b/bash/dot-config/bash/functions.bash
@@ -46,3 +46,16 @@ yayS()
{
yay -Slq | fzf --multi --preview 'yay -Si {1}' | xargs -ro yay -S
}
+
+# cp and mv but with rsync
+# source: https://wiki.archlinux.org/title/Rsync#As_cp/mv_alternative
+cpr()
+{
+ rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 "$@"
+}
+
+mvr()
+{
+ rsync --archive -hh --partial --info=stats1,progress2 --modify-window=1 --remove-source-files "$@"
+}
+
diff --git a/bash/dot-config/bash/gentoo-color.bash b/bash/dot-config/bash/gentoo-color.bash
index a9abef8..4ca33c9 100644
--- a/bash/dot-config/bash/gentoo-color.bash
+++ b/bash/dot-config/bash/gentoo-color.bash
@@ -47,13 +47,13 @@ fi
# For direxpand to be missing indicates that bash is lacking readline support.
if (( gentoo_color <= 0 )) || ( ! shopt -u direxpand 2>/dev/null ); then
# Define a prompt without color.
- PS1='\u@\h \w \$ '
+ PS1='[\u@\h \W]\$ '
elif (( EUID == 0 )); then
# If root, omit the username and print the hostname in red.
- PS1='\[\e[01;31m\]\h\[\e[01;34m\] \w \$\[\e[00m\] '
+ PS1='[\[\e[01;31m\]\h\[\e[01;34m\] \W\[\e[00m\]]\$ '
else
# Otherwise, print the username and hostname in green.
- PS1='\[\e[01;32m\]\u@\h\[\e[01;34m\] \w \$\[\e[00m\] '
+ PS1='[\[\e[32m\]\u@\h\[\e[34m\] \W\[\e[00m\]]\$ '
fi
if (( gentoo_color > 0 )); then
diff --git a/bash/dot-config/bash/notes.bash b/bash/dot-config/bash/notes.bash
new file mode 100644
index 0000000..82ed521
--- /dev/null
+++ b/bash/dot-config/bash/notes.bash
@@ -0,0 +1,18 @@
+note() {
+ if (($# == 0)); then
+ tmpfile=$(mktemp --tmpdir --suffix=.md note.XXXXXXXXXXX)
+ echo "- [ ] $(date +'%m-%d-%Y %H:%M') " >> "$tmpfile"
+ nvim "$tmpfile"
+ cat "$tmpfile" >> ~/pkm/0_inbox.md
+ else
+ echo "- [ ] $(date +'%m-%d-%Y %H:%M') $*" >> ~/pkm/0_inbox.md
+ fi
+}
+
+todos() {
+ printf $'\e[01;33mINBOX\e[0m\n'
+ bat -P -p ~/pkm/0_inbox.md
+ echo
+ printf $'\e[01;33mALL\e[0m\n'
+ rg --color=always --no-line-number --no-heading --smart-case --glob "!.git" --glob "!0_inbox.md" --hyperlink-format='file://{path}' -- "-\\s\\[\\s\\]" ~/pkm/
+}
diff --git a/bash/dot-config/shellshort/bm-files b/bash/dot-config/shellshort/bm-files
index 4e2b76d..fd99fa2 100644
--- a/bash/dot-config/shellshort/bm-files
+++ b/bash/dot-config/shellshort/bm-files
@@ -1,5 +1,2 @@
cala $XDG_CONFIG_HOME/alacritty/alacritty.toml
-cgho $XDG_CONFIG_HOME/ghostty/config
-cvim $XDG_CONFIG_HOME/nvim/init.lua
-chy $XDG_CONFIG_HOME/hypr/hyprland.conf
-cway $XDG_CONFIG_HOME/waybar/config.jsonc
+cnir $XDG_CONFIG_HOME/niri/config.kdl
diff --git a/bash/dot-config/shellshort/shortcutrc b/bash/dot-config/shellshort/shortcutrc
index 1eebef3..e701151 100644
--- a/bash/dot-config/shellshort/shortcutrc
+++ b/bash/dot-config/shellshort/shortcutrc
@@ -1,6 +1,3 @@
# vim: filetype=sh
alias cala="$EDITOR /home/moreka/.config/alacritty/alacritty.toml" \
-cgho="$EDITOR /home/moreka/.config/ghostty/config" \
-cvim="$EDITOR /home/moreka/.config/nvim/init.lua" \
-chy="$EDITOR /home/moreka/.config/hypr/hyprland.conf" \
-cway="$EDITOR /home/moreka/.config/waybar/config.jsonc" \
+cnir="$EDITOR /home/moreka/.config/niri/config.kdl" \
diff --git a/bash/dot-profile b/bash/dot-profile
index cd3f5cd..072595b 100644
--- a/bash/dot-profile
+++ b/bash/dot-profile
@@ -4,7 +4,7 @@ export EDITOR=nvim
export SUDO_EDITOR=$EDITOR
export BAT_THEME=ansi
-export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat -p -lman'"
+export MANPAGER="sh -c 'sed -u -e \"s/\\x1B\[[0-9;]*m//g; s/.\\x08//g\" | bat --paging always -p -lman'"
export XDG_CONFIG_HOME="$HOME"/.config
export XDG_CACHE_HOME="$HOME"/.cache
@@ -12,9 +12,8 @@ export XDG_DATA_HOME="$HOME"/.local/share
export XDG_STATE_HOME="$HOME"/.local/state
export XDG_BIN_HOME="$HOME"/.local/bin
-source "$XDG_CONFIG_HOME"/bash/path.bash
-
-path_add "$XDG_BIN_HOME"
+PATH="${PATH}:${XDG_BIN_HOME}"
+export PATH
export LESSHISTFILE="$XDG_CACHE_HOME"/lesshst
export CARGO_HOME="$XDG_DATA_HOME"/cargo
@@ -25,32 +24,19 @@ export GOPATH="$XDG_DATA_HOME"/go
export GTK2_RC_FILES="$XDG_CONFIG_HOME"/gtk-2.0/gtkrc-2.0
export PASSWORD_STORE_DIR="$XDG_DATA_HOME"/pass
export NOTMUCH_CONFIG="$XDG_CONFIG_HOME"/notmuch/default/config
-export GEM_HOME="$(gem env user_gemhome 2>/dev/null)"
-
-[ -n "$GEM_HOME" ] && path_add "$GEM_HOME/bin"
-
-# [ -d "$HOME/.nix-profile" ] && export XDG_DATA_DIRS="$HOME"/.nix-profile/share:"$XDG_DATA_DIRS"
-# [ -d "$HOME/.nix-profile" ] && . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
unset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
- SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
- export SSH_AUTH_SOCK
+ SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
+ export SSH_AUTH_SOCK
fi
-# disable accessibility
-export NO_AT_BRIDGE=1
-export GTK_A11Y=none
-
-path_clean
-
-# if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ] && [ -z "$NIRI_LOADED" ]; then
-# export NIRI_LOADED=1
-# exec niri-session
-# fi
-
-if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ] ; then
- if uwsm check may-start; then
- exec systemd-cat -t uwsm_start uwsm start hyprland.desktop
- fi
+if [ -z "$WAYLAND_DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq 1 ]; then
+ # NOTE: if the first argument of niri-session is not -l, then niri-session will
+ # exec a new "login shell" with `exec -l bash -c 'niri-session -l'`.
+ # This means that environment variables set here are going to be duplicated
+ # (such as PATH).
+ # See
+ # https://github.com/YaLTeR/niri/blob/10df9f4717cbd4efd20ae796eb6b0aa400127bdc/resources/niri-session#L17-L21
+ niri-session -l
fi