update shell config
This commit is contained in:
@@ -41,7 +41,7 @@ binds {
|
|||||||
Alt+Space repeat=false { spawn-sh "pkill -x rofi || rofi -show drun"; }
|
Alt+Space repeat=false { spawn-sh "pkill -x rofi || rofi -show drun"; }
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
Mod+V repeat=false { spawn-sh "fzfclip-wrap"; }
|
Mod+V repeat=false { spawn "wezterm" "start" "--" "fzfclip-wrap"; }
|
||||||
Mod+Period repeat=false { spawn-sh "pkill -x rofi || rofi-emoji"; }
|
Mod+Period repeat=false { spawn-sh "pkill -x rofi || rofi-emoji"; }
|
||||||
Print repeat=false { screenshot-screen; }
|
Print repeat=false { screenshot-screen; }
|
||||||
Mod+Shift+S repeat=false { screenshot; }
|
Mod+Shift+S repeat=false { screenshot; }
|
||||||
|
|||||||
@@ -1 +1,5 @@
|
|||||||
|
environment {
|
||||||
|
__NV_PRIME_RENDER_OFFLOAD "1"
|
||||||
|
__VK_LAYER_NV_optimus "NVIDIA_only"
|
||||||
|
__GLX_VENDOR_LIBRARY_NAME "nvidia"
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,12 +9,11 @@ gtk-decoration-layout=icon:minimize,maximize,close
|
|||||||
gtk-enable-animations=true
|
gtk-enable-animations=true
|
||||||
gtk-enable-event-sounds=1
|
gtk-enable-event-sounds=1
|
||||||
gtk-enable-input-feedback-sounds=0
|
gtk-enable-input-feedback-sounds=0
|
||||||
gtk-font-name=Noto Sans, 10
|
gtk-font-name=Sarasa UI SC, 10
|
||||||
gtk-icon-theme-name=Papirus
|
gtk-icon-theme-name=Papirus
|
||||||
gtk-menu-images=true
|
gtk-menu-images=true
|
||||||
gtk-modules=colorreload-gtk-module:appmenu-gtk-module
|
gtk-modules=colorreload-gtk-module
|
||||||
gtk-primary-button-warps-slider=true
|
gtk-primary-button-warps-slider=true
|
||||||
gtk-shell-shows-menubar=1
|
|
||||||
gtk-sound-theme-name=ocean
|
gtk-sound-theme-name=ocean
|
||||||
gtk-theme-name=catppuccin-mocha-blue-standard+default
|
gtk-theme-name=catppuccin-mocha-blue-standard+default
|
||||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ gtk-cursor-theme-name=Bibata-Modern-Ice
|
|||||||
gtk-cursor-theme-size=24
|
gtk-cursor-theme-size=24
|
||||||
gtk-decoration-layout=icon:minimize,maximize,close
|
gtk-decoration-layout=icon:minimize,maximize,close
|
||||||
gtk-enable-animations=true
|
gtk-enable-animations=true
|
||||||
gtk-font-name=Noto Sans, 10
|
gtk-font-name=Sarasa UI SC, 10
|
||||||
gtk-icon-theme-name=Papirus
|
gtk-icon-theme-name=Papirus
|
||||||
gtk-primary-button-warps-slider=true
|
gtk-primary-button-warps-slider=true
|
||||||
gtk-sound-theme-name=ocean
|
gtk-sound-theme-name=ocean
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
wezterm start -- fzfclip "$@"
|
lockfile=/tmp/fzfclip.lock
|
||||||
|
exec {LOCK_FD}>"$lockfile"
|
||||||
|
flock -n "$LOCK_FD" || {
|
||||||
|
echo "Another instance is running." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
fzfclip "$@"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
# Constants
|
# Constants
|
||||||
niri_config_file="$HOME/.config/niri/config/misc.kdl"
|
niri_config_file="$HOME/.config/niri/config/misc.kdl"
|
||||||
prefer_order=(intel nvidia)
|
prefer_order=(nvidia intel)
|
||||||
|
|
||||||
# Get vendor and path of each GPU
|
# Get vendor and path of each GPU
|
||||||
default_card_path="$(find /dev/dri/card* 2>/dev/null | head -n 1)"
|
default_card_path="$(find /dev/dri/card* 2>/dev/null | head -n 1)"
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ export XDG_CACHE_HOME="$HOME/.cache"
|
|||||||
# Better than nothing
|
# Better than nothing
|
||||||
if [[ -z "$LANG" ]]; then
|
if [[ -z "$LANG" ]]; then
|
||||||
LANG="en_US.UTF-8"
|
LANG="en_US.UTF-8"
|
||||||
LC_ALL="en_US.UTF-8"
|
export LANG
|
||||||
export LANG LC_ALL
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Paths
|
# Paths
|
||||||
@@ -48,21 +47,21 @@ export PATH
|
|||||||
|
|
||||||
# fnm
|
# fnm
|
||||||
if type fnm &>/dev/null; then
|
if type fnm &>/dev/null; then
|
||||||
eval $(fnm env --shell bash)
|
eval "$(fnm env --shell bash)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# export ENABLE_GPG_AGENT_SSH=1 in .profile to enable GPG agent for SSH
|
# export ENABLE_GPG_AGENT_SSH=1 in .profile to enable GPG agent for SSH
|
||||||
if [ -x "$HOME/.local/scripts/gpg-init" ] && \
|
if [ -x "$HOME/.local/scripts/gpg-init" ] && \
|
||||||
[ -n "$ENABLE_GPG_AGENT_SSH" ] && [ "$ENABLE_GPG_AGENT_SSH" != "0" ] && \
|
[ -n "$ENABLE_GPG_AGENT_SSH" ] && [ "$ENABLE_GPG_AGENT_SSH" = "1" ] && \
|
||||||
type gpgconf &>/dev/null; then
|
type gpgconf &>/dev/null; then
|
||||||
# GPG agent for SSH
|
# GPG agent for SSH
|
||||||
eval "$($HOME/.local/scripts/gpg-init 2>/dev/null)" >/dev/null 2>&1
|
eval "$($HOME/.local/scripts/gpg-init 2>/dev/null)" &>/dev/null
|
||||||
elif [ -x "$HOME/.local/scripts/ssh-init" ] && type ssh-agent &>/dev/null; then
|
elif [ -x "$HOME/.local/scripts/ssh-init" ] && type ssh-agent &>/dev/null; then
|
||||||
# SSH with cross-session ssh-agent
|
# SSH with cross-session ssh-agent
|
||||||
eval "$($HOME/.local/scripts/ssh-init 2>/dev/null)" >/dev/null 2>&1
|
eval "$($HOME/.local/scripts/ssh-init 2>/dev/null)" &>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Triggered in SSH sessions
|
# Triggered in interactive shells (e.g. ssh)
|
||||||
if [[ $- == *i* ]]; then
|
if [[ $- == *i* ]]; then
|
||||||
# Set EDITOR and VISUAL, mainly for sudoedit
|
# Set EDITOR and VISUAL, mainly for sudoedit
|
||||||
for app in nvim helix vim vi nano; do
|
for app in nvim helix vim vi nano; do
|
||||||
@@ -74,9 +73,34 @@ if [[ $- == *i* ]]; then
|
|||||||
done
|
done
|
||||||
export EDITOR VISUAL
|
export EDITOR VISUAL
|
||||||
|
|
||||||
|
# Create shortcut alias for helix
|
||||||
|
if type helix &>/dev/null && ! type hx &>/dev/null; then
|
||||||
|
alias hx="helix"
|
||||||
|
fi
|
||||||
|
|
||||||
# For gpg
|
# For gpg
|
||||||
GPG_TTY=$(tty)
|
if type gpgconf &>/dev/null; then
|
||||||
export GPG_TTY
|
GPG_TTY=$(tty)
|
||||||
|
export GPG_TTY
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -x "$HOME/.local/scripts/gpg-init" ] && \
|
||||||
|
[ -n "$ENABLE_GPG_AGENT_SSH" ] && [ "$ENABLE_GPG_AGENT_SSH" = "1" ] && \
|
||||||
|
type gpgconf &>/dev/null; then
|
||||||
|
true
|
||||||
|
elif [ -x "$HOME/.local/scripts/ssh-init" ] && type ssh-add &>/dev/null; then
|
||||||
|
function sshs() {
|
||||||
|
# test if keys are added to ssh-agent
|
||||||
|
if ! ssh-add -l &>/dev/null; then
|
||||||
|
if [ -n "$ssh_keys" ]; then
|
||||||
|
ssh-add "${ssh_keys[@]}"
|
||||||
|
else
|
||||||
|
ssh-add
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
ssh "$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
# Shortcut alias for launching fish
|
# Shortcut alias for launching fish
|
||||||
if type fish &>/dev/null && ! type f &>/dev/null; then
|
if type fish &>/dev/null && ! type f &>/dev/null; then
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
# PATH
|
# PATH is managed by .bash_profile
|
||||||
fish_add_path $HOME/go/bin
|
|
||||||
fish_add_path $HOME/.cargo/bin
|
|
||||||
fish_add_path $HOME/.local/scripts
|
|
||||||
fish_add_path $HOME/.local/bin
|
|
||||||
fish_add_path $HOME/.local/share/fnm
|
|
||||||
|
|
||||||
# man
|
# man
|
||||||
if type -q bat
|
if type -q bat
|
||||||
@@ -28,11 +23,6 @@ end
|
|||||||
# gpg
|
# gpg
|
||||||
set -x -g GPG_TTY (tty)
|
set -x -g GPG_TTY (tty)
|
||||||
|
|
||||||
# fnm
|
|
||||||
if type -q fnm
|
|
||||||
eval (fnm env --shell fish)
|
|
||||||
end
|
|
||||||
|
|
||||||
# done
|
# done
|
||||||
set -U __done_min_cmd_duration 10000
|
set -U __done_min_cmd_duration 10000
|
||||||
set -U __done_notification_urgency_level low
|
set -U __done_notification_urgency_level low
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
if test -n "$XDG_CURRENT_DESKTOP"; and test "$XDG_CURRENT_DESKTOP" = "niri"
|
|
||||||
set -l env_config "$HOME/.config/niri/config/envs.kdl"
|
|
||||||
|
|
||||||
if test -f "$env_config"
|
|
||||||
while read -la line
|
|
||||||
# Remove comments
|
|
||||||
set line (string replace -r '//.*' '' -- "$line")
|
|
||||||
# Trim whitespace
|
|
||||||
set line (string trim -- "$line")
|
|
||||||
# Skip "environment" block lines
|
|
||||||
if test -z "$line"; or string match -q "environment*" -- "$line"; or test "$line" = "}"
|
|
||||||
continue
|
|
||||||
end
|
|
||||||
# Match lines like: VARIABLE "value" where VARIABLE is alphanumeric/underscore
|
|
||||||
set -l matches (string match -r '^([0-9A-Za-z_]+)\s+"(.*)"$' -- "$line")
|
|
||||||
# If have a matches, set the environment variable
|
|
||||||
if test (count $matches) -eq 3
|
|
||||||
set -xg $matches[2] $matches[3]
|
|
||||||
end
|
|
||||||
end < "$env_config"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# ssh with encrypted private keys
|
|
||||||
# $ssh_keys should be set in advance or left empty to use the default keys
|
|
||||||
|
|
||||||
if set -q ENABLE_GPG_AGENT_SSH; and test $ENABLE_GPG_AGENT_SSH != "0";\
|
|
||||||
and type -q gpg-init; and type -q gpgconf
|
|
||||||
# GPG agent for SSH
|
|
||||||
bass $(gpg-init) > /dev/null 2>&1
|
|
||||||
|
|
||||||
else if type -q ssh-init; and type -q ssh-add
|
|
||||||
# SSH with cross-session ssh-agent
|
|
||||||
bass $(ssh-init) > /dev/null 2>&1
|
|
||||||
|
|
||||||
# avoid entering passphrase every time
|
|
||||||
function sshs
|
|
||||||
# test if keys are added to ssh-agent
|
|
||||||
if not ssh-add -l > /dev/null 2>&1
|
|
||||||
ssh-add $ssh_keys
|
|
||||||
end
|
|
||||||
ssh $argv
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user