From 4f2846ea552c8c71c8ebbc4394f625499e823122 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Thu, 20 Jul 2023 13:20:12 +0200 Subject: made aliases.zsh more shell gnostic --- config/essentials/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 83da0f6..2619fed 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -41,7 +41,7 @@ else fi sfiles+=( ~/.config/zsh/functions.zsh - ~/.config/zsh/aliases.zsh + ~/.config/zsh/aliases.sh ) for f in "${sfiles[@]}"; do test -f "$f" && source "$f" -- cgit v1.2.3 From daffc673ca054abd9f2f927c651d782499cf185e Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Wed, 26 Jul 2023 22:52:22 +0200 Subject: use startw script for hyprland --- bin/guiscripts/startw | 5 +++++ config/essentials/zsh/.zshrc | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100755 bin/guiscripts/startw (limited to 'config/essentials/zsh/.zshrc') diff --git a/bin/guiscripts/startw b/bin/guiscripts/startw new file mode 100755 index 0000000..768f401 --- /dev/null +++ b/bin/guiscripts/startw @@ -0,0 +1,5 @@ +#!/bin/sh + +eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg,ssh)" + +Hyprland diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 2619fed..195b64c 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -2,13 +2,10 @@ if [[ "/dev/tty1" = "$TTY" || "/dev/tty2" = "$TTY" ]] && [[ "$(id -u)" -ne 0 ]] then - clear - eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --eval --quiet --agents gpg 3A626DD20A32EB2E5DD9CE71CFD9ABC97158CD5D 2> /dev/null)" - eval "$(keychain --dir "$XDG_CONFIG_HOME/keychain" --noask --eval --quiet --agents ssh 2> /dev/null)" clear if [ "/dev/tty1" = "$TTY" ] then - Hyprland > /dev/null 2>&1 + startw > /dev/null 2>&1 else startx > /dev/null 2>&1 fi -- cgit v1.2.3 From 6a0f7b5bca424d0c3a93239e2aacb130ddad27fc Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sat, 29 Jul 2023 01:30:05 +0200 Subject: cleaned up is a file command --- config/essentials/zsh/.zshrc | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 195b64c..58974ba 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -64,17 +64,14 @@ bindkey "^['" quote-line isTextFile() { - if [ ! -f "$1" ] - then + [ -f "$1" ] && + # will execute the file, I'd rather not have an error message + [ ${1::2} != "./" ] && + [ ${1::1} != "/" ] && + ! type "$1" > /dev/null && + # is text file? + file -b --mime-type "$1" | grep -q "^text/" || return 1 - fi - - file_type=$(file -b --mime-type "$1") - if [[ "$file_type" == text/* ]] - then - return - fi - return 1 } # rehash hook @@ -110,17 +107,13 @@ function osc7 { } add-zsh-hook -Uz chpwd osc7 command_not_found_handler () { - isTextFile "$1" || - echo "zsh: command not found: $1" >&2 -} -# open file with file name -open_file() { - if [ ${1:0:2} != "./" ] && isTextFile "$1" + if [[ -o interactive ]] && isTextFile "$1" then "$EDITOR" "$1" + else + echo "zsh: command not found: $1" >&2 fi } -add-zsh-hook -Uz preexec open_file # prompt PS1=' %B%(#.%F{1}.%F{13})[%n%b%f@%B%F{6}%m]%b%f %3~ ' -- cgit v1.2.3 From f5b7a1a7cd4052b37dfd576d5ca5864a2b969e09 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Sat, 29 Jul 2023 11:51:18 +0200 Subject: added /usr/lib/os-release --- config/essentials/zsh/.zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/essentials/zsh/.zshrc') diff --git a/config/essentials/zsh/.zshrc b/config/essentials/zsh/.zshrc index 58974ba..d8675d4 100644 --- a/config/essentials/zsh/.zshrc +++ b/config/essentials/zsh/.zshrc @@ -25,7 +25,7 @@ zle -N add-surround surround zle -N change-surround surround compinit -if grep -qi "debian\|ubuntu" /etc/os-release 2>/dev/null +if grep -qi "debian\|ubuntu" /usr/lib/os-release /etc/os-release 2>/dev/null then sfiles=( /usr/share/zsh-autosuggestions/zsh-autosuggestions.zsh -- cgit v1.2.3