Compare commits
17 Commits
4f65f2d998
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 3ec45a7082 | |||
| 0fe2b5ab9a | |||
| fdeb6d6505 | |||
| 24563a3b5f | |||
| 9bd69ac6fa | |||
| fa601f903f | |||
| 45362b9d05 | |||
| a88c12b85d | |||
| df671a927f | |||
| ffe9c7e236 | |||
| 1e1a3f3f74 | |||
| 5bcba412bf | |||
| b0e7701a27 | |||
| 0d2e5ef264 | |||
| 67907b8ab6 | |||
| 7519fe3840 | |||
| 6986e3c8d2 |
20
README.md
20
README.md
@@ -10,7 +10,7 @@ Use ./stow.sh --unstow <folder_name> to remove configuration
|
||||
|
||||
## Quirks
|
||||
- Install based on Ubuntu Desktop
|
||||
- Font: [BlexMono Nerd Font](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/IBMPlexMono.zip)
|
||||
- Font: [Iosevka Nerd Font](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/Iosevka.tar.xz)
|
||||
- Keyboard Layout: EurKey (enable extended in gnome-tweaks)
|
||||
- Environment Vairables exported using systemd in [envvars.conf](files/environment/.config/environment.d/envvars.conf)
|
||||
- LibreWolf from flatpak needs devices=all to read yubikeys
|
||||
@@ -28,18 +28,29 @@ Use ./stow.sh --unstow <folder_name> to remove configuration
|
||||
- allow microphone in steam: `sudo snap connect steam:audio-record :audio-record`
|
||||
- gamemode configuration:
|
||||
- renice=10
|
||||
|
||||
- ssh-agent:
|
||||
- agent-location: `cd $HOME/.oh-my-zsh/ && git apply $HOME/.dots/patches/ssh-agent-location.patch`
|
||||
- remove keys on lock: `ln -sSf $HOME/.dots/scripts/remove-ssh.service $HOME/.config/systemd/user/remove-ssh.service && systemctl --user start remove-ssh && systemctl --user enable remove-ssh`
|
||||
|
||||
## Software
|
||||
|
||||
### Basics
|
||||
```
|
||||
sudo apt install \
|
||||
kitty tmux \
|
||||
kitty tmux zsh \
|
||||
git ripgrep fd-find fzf stow
|
||||
```
|
||||
|
||||
```
|
||||
git clone https://github.com/ohmyzsh/ohmyzsh/ $HOME/.oh-my-zsh && cd $HOME/.oh-my-zsh && git apply $HOME/.dots/patches/prompt.patch
|
||||
```
|
||||
|
||||
### Extended
|
||||
|
||||
```
|
||||
cargo install --locked zellij
|
||||
```
|
||||
|
||||
```
|
||||
sudo apt install \
|
||||
pympress \
|
||||
@@ -78,7 +89,6 @@ sudo snap install \
|
||||
$ mkdir -p ~/.config/nix/
|
||||
$ echo "experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
|
||||
```
|
||||
- [woverlay](https://codeberg.org/rtx/woverlay)
|
||||
|
||||
## Extensions
|
||||
|
||||
@@ -91,6 +101,8 @@ sudo snap install \
|
||||
- quick-settings-audio-panel
|
||||
- quicksettings-audio-devices-hider (hide unused devices)
|
||||
- gamemodeshellextensions@trsnaqe.com
|
||||
- status-area-horizontal-spacing@mathematical.coffee.gmail.com
|
||||
- blur-my-shell@aunetx (custom panel, slightly darker with custom pipeline)
|
||||
|
||||
### Pre-installed
|
||||
- disable desktop icons
|
||||
|
||||
@@ -2,7 +2,6 @@ PATH=$HOME/.dots/scripts:$HOME/.cargo/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$HOM
|
||||
EDITOR=hx
|
||||
VISUAL=hx
|
||||
_JAVA_AWT_WM_NONREPARENTING=1
|
||||
SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||
|
||||
# support jp input in gnome
|
||||
GTK_IM_MODULE=ibus
|
||||
|
||||
@@ -6,16 +6,19 @@
|
||||
[alias]
|
||||
a = add
|
||||
aa = add .
|
||||
b = branch
|
||||
bl = blame
|
||||
c = commit -v
|
||||
ca = commit -v --amend
|
||||
co = checkout
|
||||
cp = cherry-pick
|
||||
d = diff
|
||||
nuke = clean -df
|
||||
lg = log --oneline --decorate --graph
|
||||
nuke = clean -df
|
||||
pl = pull --rebase
|
||||
ps = push
|
||||
r = rebase -i
|
||||
rc = rebase --continue
|
||||
sh = show
|
||||
st = status -s
|
||||
wt = worktree
|
||||
|
||||
@@ -2,15 +2,14 @@ theme = "everforest_light_modded"
|
||||
|
||||
[editor]
|
||||
line-number = "relative"
|
||||
cursorline = true
|
||||
cursor-shape.insert = "bar"
|
||||
insert-final-newline = false
|
||||
# rulers = [80, 100]
|
||||
true-color = true
|
||||
text-width = 100
|
||||
|
||||
[editor.whitespace.render]
|
||||
tab = "all"
|
||||
# space = "all"
|
||||
|
||||
[editor.indent-guides]
|
||||
render = true
|
||||
@@ -29,6 +28,9 @@ display-inlay-hints = true
|
||||
[keys.normal.g]
|
||||
"b" = ":sh git show %sh{git blame -L %{cursor_line},+1 %{buffer_name} | awk '{print $1}'}"
|
||||
|
||||
[keys.normal.space]
|
||||
"t" = ':lsp-workspace-command tinymist.pinMain "%sh{realpath %{buffer_name}}"'
|
||||
|
||||
[keys.normal.z]
|
||||
s = ":set soft-wrap.enable true"
|
||||
S = ":set soft-wrap.enable false"
|
||||
|
||||
@@ -8,9 +8,9 @@ clipboard_control write-clipboard write-primary no-append
|
||||
|
||||
include current-theme.conf
|
||||
|
||||
font_family BlexMono Nerd Font Mono Text
|
||||
italic_font BlexMono Nerd Font Mono
|
||||
bold_font BlexMono Nerd Font Mono
|
||||
font_family Iosevka Nerd Font
|
||||
# italic_font BlexMono Nerd Font Mono
|
||||
# bold_font BlexMono Nerd Font Mono
|
||||
|
||||
font_size 12
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ git_branch() {
|
||||
|
||||
nix_env() {
|
||||
if $(echo $PATH | grep "/nix/store" > /dev/null 2>&1); then
|
||||
echo "(nix)"
|
||||
echo "nix@"
|
||||
fi
|
||||
}
|
||||
|
||||
HOST="\[\033[0;33m\]\h\[\033[m\]"
|
||||
GIT_NIX="\[\033[0;31m\]\$(git_branch)\$(nix_env)\[\033[m\]"
|
||||
GIT_NIX="\[\033[0;31m\]\$(nix_env)\$(git_branch)\[\033[m\]"
|
||||
DIR="\[\033[0;34m\]\w\[\033[m\]"
|
||||
NEWLINE=$'\n'
|
||||
|
||||
@@ -38,13 +38,13 @@ __prompt_command() {
|
||||
export PROMPT_DIRTRIM=0
|
||||
fi
|
||||
|
||||
export PS1="${HOST} ${DIR} ${GIT_NIX}${NEWLINE}"
|
||||
export PS1="${HOST} :: ${DIR} ${GIT_NIX}"
|
||||
|
||||
if [ $EXIT != 0 ]
|
||||
then
|
||||
PS1+='\[\033[0;31m\]$\[\033[00m\] '
|
||||
PS1+='\[\033[0;31m\]>\[\033[00m\] '
|
||||
else
|
||||
PS1+='\[\033[0;32m\]$\[\033[00m\] '
|
||||
PS1+='> '
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,12 @@ t() {
|
||||
tmux new-session -A -s ${1:-tmux}
|
||||
}
|
||||
z() {
|
||||
zellij a ${1:-dev} 2> /dev/null || zellij -s ${1:-dev}
|
||||
# if remote, link agent so a stale zellij env doesn't hurt agent
|
||||
if [[ $SSH_AUTH_SOCK =~ ^"/tmp/ssh-" ]]; then
|
||||
ln -sf $SSH_AUTH_SOCK /tmp/agent.sock
|
||||
export SSH_AUTH_SOCK=/tmp/agent.sock
|
||||
fi
|
||||
zellij attach ${1:-$HOST} 2> /dev/null || zellij -s ${1:-$HOST}
|
||||
}
|
||||
|
||||
# password hash (sed needed when using in docker-compose)
|
||||
|
||||
32
files/shell/.zshrc
Normal file
32
files/shell/.zshrc
Normal file
@@ -0,0 +1,32 @@
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
|
||||
ZSH_THEME="afowler"
|
||||
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
plugins=(git colored-man-pages rust ssh-agent)
|
||||
|
||||
zstyle :omz:plugins:ssh-agent helper sshaskpass
|
||||
zstyle :omz:update mode disabled
|
||||
|
||||
bindkey ^F forward-word
|
||||
bindkey ^B backward-word
|
||||
|
||||
setopt globdots
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
[ -f ~/.shellrc.alias ] && source ~/.shellrc.alias
|
||||
[ -f ~/.shellrc.local ] && source ~/.shellrc.local
|
||||
|
||||
function set_zellij_tab_to_working_dir() {
|
||||
local current_dir=$PWD
|
||||
if [[ $current_dir == $HOME ]]; then
|
||||
current_dir="~"
|
||||
else
|
||||
current_dir=${current_dir##*/}
|
||||
fi
|
||||
command nohup zellij action rename-tab $current_dir >/dev/null 2>&1
|
||||
}
|
||||
|
||||
[[ -n $ZELLIJ ]] && add-zsh-hook precmd set_zellij_tab_to_working_dir
|
||||
@@ -178,29 +178,26 @@ keybinds clear-defaults=true {
|
||||
shared_except "locked" {
|
||||
bind "Alt p" { TogglePaneInGroup; }
|
||||
}
|
||||
shared_except "locked" "entersearch" "renametab" "renamepane" "move" "prompt" "tmux" {
|
||||
shared_except "locked" "entersearch" "renametab" "renamepane" "move" "prompt" {
|
||||
bind "Alt Shift m" { SwitchToMode "move"; }
|
||||
}
|
||||
shared_except "locked" "entersearch" "renametab" "renamepane" "prompt" "tmux" {
|
||||
shared_except "locked" "entersearch" "renametab" "renamepane" "prompt" {
|
||||
bind "Alt Shift g" { SwitchToMode "locked"; }
|
||||
bind "Alt Shift q" { Quit; }
|
||||
}
|
||||
shared_except "locked" "entersearch" "renametab" "renamepane" "session" "prompt" "tmux" {
|
||||
shared_except "locked" "entersearch" "renametab" "renamepane" "session" "prompt" {
|
||||
bind "Alt Shift o" { SwitchToMode "session"; }
|
||||
}
|
||||
shared_except "locked" "scroll" "search" "tmux" {
|
||||
bind "Ctrl b" { SwitchToMode "tmux"; }
|
||||
}
|
||||
shared_except "locked" "scroll" "entersearch" "renametab" "renamepane" "prompt" "tmux" {
|
||||
shared_except "locked" "scroll" "entersearch" "renametab" "renamepane" "prompt" {
|
||||
bind "Alt Shift s" { SwitchToMode "scroll"; }
|
||||
}
|
||||
shared_except "locked" "tab" "entersearch" "renametab" "renamepane" "prompt" "tmux" {
|
||||
shared_except "locked" "tab" "entersearch" "renametab" "renamepane" "prompt" {
|
||||
bind "Alt Shift t" { SwitchToMode "tab"; }
|
||||
}
|
||||
shared_except "locked" "pane" "entersearch" "renametab" "renamepane" "prompt" "tmux" {
|
||||
shared_except "locked" "pane" "entersearch" "renametab" "renamepane" "prompt" {
|
||||
bind "Alt Shift p" { SwitchToMode "pane"; }
|
||||
}
|
||||
shared_except "locked" "resize" "entersearch" "renametab" "renamepane" "prompt" "tmux" {
|
||||
shared_except "locked" "resize" "entersearch" "renametab" "renamepane" "prompt" {
|
||||
bind "Alt Shift r" { SwitchToMode "resize"; }
|
||||
}
|
||||
shared_except "normal" "locked" "entersearch" {
|
||||
@@ -209,7 +206,7 @@ keybinds clear-defaults=true {
|
||||
shared_except "normal" "locked" "entersearch" "renametab" "renamepane" {
|
||||
bind "esc" { SwitchToMode "normal"; }
|
||||
}
|
||||
shared_among "pane" "tmux" {
|
||||
shared_among "pane" {
|
||||
bind "x" { CloseFocus; SwitchToMode "normal"; }
|
||||
}
|
||||
shared_among "scroll" "search" {
|
||||
@@ -234,7 +231,7 @@ keybinds clear-defaults=true {
|
||||
bind "esc" { SwitchToMode "scroll"; }
|
||||
bind "enter" { SwitchToMode "search"; }
|
||||
}
|
||||
shared_among "entersearch" "renametab" "renamepane" "prompt" "tmux" {
|
||||
shared_among "entersearch" "renametab" "renamepane" "prompt" {
|
||||
bind "Ctrl g" { SwitchToMode "locked"; }
|
||||
bind "Ctrl m" { SwitchToMode "move"; }
|
||||
bind "Ctrl r" { SwitchToMode "resize"; }
|
||||
@@ -254,30 +251,9 @@ keybinds clear-defaults=true {
|
||||
renamepane {
|
||||
bind "esc" { UndoRenamePane; SwitchToMode "pane"; }
|
||||
}
|
||||
shared_among "session" "tmux" {
|
||||
shared_among "session" {
|
||||
bind "d" { Detach; }
|
||||
}
|
||||
tmux {
|
||||
bind "left" { MoveFocus "left"; SwitchToMode "normal"; }
|
||||
bind "down" { MoveFocus "down"; SwitchToMode "normal"; }
|
||||
bind "up" { MoveFocus "up"; SwitchToMode "normal"; }
|
||||
bind "right" { MoveFocus "right"; SwitchToMode "normal"; }
|
||||
bind "space" { NextSwapLayout; }
|
||||
bind "\"" { NewPane "down"; SwitchToMode "normal"; }
|
||||
bind "%" { NewPane "right"; SwitchToMode "normal"; }
|
||||
bind "," { SwitchToMode "renametab"; }
|
||||
bind "[" { SwitchToMode "scroll"; }
|
||||
bind "Ctrl b" { Write 2; SwitchToMode "normal"; }
|
||||
bind "c" { NewTab; SwitchToMode "normal"; }
|
||||
bind "h" { MoveFocus "left"; SwitchToMode "normal"; }
|
||||
bind "j" { MoveFocus "down"; SwitchToMode "normal"; }
|
||||
bind "k" { MoveFocus "up"; SwitchToMode "normal"; }
|
||||
bind "l" { MoveFocus "right"; SwitchToMode "normal"; }
|
||||
bind "n" { GoToNextTab; SwitchToMode "normal"; }
|
||||
bind "o" { FocusNextPane; }
|
||||
bind "p" { GoToPreviousTab; SwitchToMode "normal"; }
|
||||
bind "z" { ToggleFocusFullscreen; SwitchToMode "normal"; }
|
||||
}
|
||||
}
|
||||
|
||||
// Plugin aliases - can be used to change the implementation of Zellij
|
||||
@@ -345,7 +321,7 @@ theme "everforest-light"
|
||||
// The name of the default layout to load on startup
|
||||
// Default: "default"
|
||||
//
|
||||
// default_layout "compact"
|
||||
default_layout "compact"
|
||||
|
||||
// The folder in which Zellij will look for layouts
|
||||
// (Requires restart)
|
||||
@@ -427,7 +403,7 @@ theme "everforest-light"
|
||||
|
||||
// Path to the default editor to use to edit pane scrollbuffer
|
||||
// Default: $EDITOR or $VISUAL
|
||||
// scrollback_editor "/usr/bin/vim"
|
||||
scrollback_editor "hx"
|
||||
|
||||
// A fixed name to always give the Zellij session.
|
||||
// Consider also setting `attach_to_session true,`
|
||||
@@ -547,7 +523,7 @@ theme "everforest-light"
|
||||
// Whether to show tips on startup
|
||||
// Default: true
|
||||
//
|
||||
// show_startup_tips false
|
||||
show_startup_tips false
|
||||
|
||||
// Whether to show release notes on first version run
|
||||
// Default: true
|
||||
|
||||
4
lock.sh
4
lock.sh
@@ -1,4 +0,0 @@
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
|
||||
|
||||
ssh-add -D
|
||||
dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
|
||||
33
patches/prompt.patch
Normal file
33
patches/prompt.patch
Normal file
@@ -0,0 +1,33 @@
|
||||
diff --git a/lib/git.zsh b/lib/git.zsh
|
||||
index 8d38f326..32c55ead 100644
|
||||
--- a/lib/git.zsh
|
||||
+++ b/lib/git.zsh
|
||||
@@ -36,7 +36,13 @@ function _omz_git_prompt_info() {
|
||||
&& upstream=" -> ${upstream}"
|
||||
fi
|
||||
|
||||
- echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
+ local is_nix
|
||||
+ if $(echo $PATH | grep "/nix/store" > /dev/null 2>&1); then
|
||||
+ is_nix="nix@"
|
||||
+ fi
|
||||
+
|
||||
+
|
||||
+ echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${is_nix}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}"
|
||||
}
|
||||
|
||||
function _omz_git_prompt_status() {
|
||||
diff --git a/themes/afowler.zsh-theme b/themes/afowler.zsh-theme
|
||||
index f6d3ef82..c1e59b4f 100644
|
||||
--- a/themes/afowler.zsh-theme
|
||||
+++ b/themes/afowler.zsh-theme
|
||||
@@ -1,7 +1,7 @@
|
||||
-PROMPT='%m %B%F{blue}:: %b%F{green}%3~ $(hg_prompt_info)$(git_prompt_info)%B%(!.%F{red}.%F{blue})»%f%b '
|
||||
+PROMPT='%b%F{yellow}%m %B%F{black}:: %b%F{blue}%3~ $(hg_prompt_info)$(git_prompt_info)%B%(!.%F{red}.%F{black})»%f%b '
|
||||
RPS1='%(?..%F{red}%? ↵%f)'
|
||||
|
||||
-ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
||||
+ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[red]%}‹"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
|
||||
|
||||
ZSH_THEME_HG_PROMPT_PREFIX="%{$fg[magenta]%}hg:‹%{$fg[yellow]%}"
|
||||
23
patches/ssh-agent-location.patch
Normal file
23
patches/ssh-agent-location.patch
Normal file
@@ -0,0 +1,23 @@
|
||||
diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh
|
||||
index 83548648..42ec378f 100644
|
||||
--- a/plugins/ssh-agent/ssh-agent.plugin.zsh
|
||||
+++ b/plugins/ssh-agent/ssh-agent.plugin.zsh
|
||||
@@ -24,7 +24,7 @@ function _start_agent() {
|
||||
|
||||
# start ssh-agent and setup environment
|
||||
zstyle -t :omz:plugins:ssh-agent quiet || echo >&2 "Starting ssh-agent ..."
|
||||
- ssh-agent -s ${lifetime:+-t} ${lifetime} | sed '/^echo/d' >! "$ssh_env_cache"
|
||||
+ ssh-agent -a /tmp/agent.sock -s ${lifetime:+-t} ${lifetime} | sed '/^echo/d' >! "$ssh_env_cache"
|
||||
chmod 600 "$ssh_env_cache"
|
||||
. "$ssh_env_cache" > /dev/null
|
||||
}
|
||||
@@ -107,7 +107,8 @@ if zstyle -t :omz:plugins:ssh-agent agent-forwarding \
|
||||
fi
|
||||
fi
|
||||
else
|
||||
- _start_agent
|
||||
+ # Don't start new one, if ssh-agent is forwarded
|
||||
+ [[ $SSH_AUTH_SOCK =~ ^"/tmp/ssh-" ]] || _start_agent
|
||||
fi
|
||||
|
||||
# Don't add identities if lazy-loading is enabled
|
||||
8
scripts/remove-ssh.bash
Executable file
8
scripts/remove-ssh.bash
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" |
|
||||
while read x; do
|
||||
case "$x" in
|
||||
*"boolean true"*) echo SCREEN_LOCKED; ssh-add -D;;
|
||||
*"boolean false"*) echo SCREEN_UNLOCKED;;
|
||||
esac
|
||||
done
|
||||
10
scripts/remove-ssh.service
Normal file
10
scripts/remove-ssh.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Remove SSH keys on lock
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=SSH_AUTH_SOCK=/tmp/agent.sock
|
||||
ExecStart=%h/.dots/scripts/remove-ssh.bash
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
@@ -1,10 +0,0 @@
|
||||
[Unit]
|
||||
Description=SSH key agent
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
|
||||
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user