From cf78a066fe13ec00d3aab32086115628616a1ebf Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Sun, 19 Sep 2021 16:30:33 +0200 Subject: [PATCH] Switch to Gnome --- README.md | 11 +- files/.config/zathura/zathurarc | 2 +- files/.profile | 11 +- files/.zshrc | 135 ++++++++++++++++++++++-- files/linkdots.sh | 28 ----- {files/.config => old}/i3/config | 0 {files/.config => old}/i3status/config | 0 {files => old}/scripts/key_bindings.zsh | 0 {files => old}/scripts/lock.sh | 0 {files => old}/scripts/start_progs.sh | 0 {files => old}/scripts/wallpaper.sh | 0 11 files changed, 134 insertions(+), 53 deletions(-) delete mode 100755 files/linkdots.sh rename {files/.config => old}/i3/config (100%) rename {files/.config => old}/i3status/config (100%) rename {files => old}/scripts/key_bindings.zsh (100%) rename {files => old}/scripts/lock.sh (100%) rename {files => old}/scripts/start_progs.sh (100%) rename {files => old}/scripts/wallpaper.sh (100%) diff --git a/README.md b/README.md index db9cdbc..6fa79f6 100644 --- a/README.md +++ b/README.md @@ -2,25 +2,18 @@ ## System -+ Notifications: dunst ++ DE: Gnome + Shell: zsh + Terminal: alacritty -+ WM: i3 ## Programs -+ Audiocontrol: pasystray -+ Bluetooth-Manager: blueman + Editor: emacs -+ Image-Viewer: sxiv -+ Launcher: [dmenu](https://github.com/crammk/dmenu) -+ Lock: xlock + Mouse-Settings: piper -+ Pdf-Viewer: zathura with mupdf + Screenshots: flameshot ++ pdf: zathura with mupdf ## Other Dependencies -+ fcitx5 + mozc: Japanese Keyboard + fzf: fuzzy file finder + hunspell{-de, en}: spellchecking for emacs diff --git a/files/.config/zathura/zathurarc b/files/.config/zathura/zathurarc index febda8d..f1c507b 100644 --- a/files/.config/zathura/zathurarc +++ b/files/.config/zathura/zathurarc @@ -21,7 +21,7 @@ set completion-fg "#3c3836" # fg set completion-group-bg "#fafafa" # bg1 set completion-group-fg "#928374" # gray set completion-highlight-bg "#689d6a" # aqua -set completion-highlight-fg "#ebdbb2" # bg2 +set completion-highlight-fg "#fafafa gs" # bg2 # Define the color in index mode set index-bg "#fafafa" # bg2 diff --git a/files/.profile b/files/.profile index 73f0c4f..de0444b 100755 --- a/files/.profile +++ b/files/.profile @@ -10,16 +10,13 @@ xmodmap -e "keycode 66 = grave asciitilde" # path export PATH=$PATH:$HOME/scripts:$HOME/.cargo/bin:$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin -# ssh -export SSH_AUTH_SOCK=$HOME/.ssh/mthomas-agent.sock - # editor export EDITOR="vim" export VISIAL=${EDITOR} # fcitx exports -export GTK_IM_MODULE='fcitx' -export QT_IM_MODULE='fcitx' -export SDL_IM_MODULE='fcitx' -export XMODIFIERS='@im=fcitx' +export GTK_IM_MODULE='xim' +export QT_IM_MODULE='ibus' +export SDL_IM_MODULE='ibus' +export XMODIFIERS='@im=ibus' export WINIT_UNIX_BACKEND=x11 diff --git a/files/.zshrc b/files/.zshrc index faf4563..d6ca0da 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -86,13 +86,6 @@ setopt share_history # share command history data inside tmux export HISTFILE="$HOME/.zsh_history" export SAVEHIST=5000 -# ============================== ssh-agent -if ! [ -S $HOME/.ssh/mthomas-agent.sock ]; then - echo "Starting ssh-agent" - ssh-agent -a $HOME/.ssh/mthomas-agent.sock - ssh-add -fi - # ============================== vi-Mode bindkey -v export KEYTIMEOUT=1 @@ -131,7 +124,133 @@ export FZF_DEFAULT_OPTS=' ## fzf Bindings in zsh (C-r and C-t) if [[ -x $(which fzf 2> /dev/null) ]] then - source ~/scripts/key_bindings.zsh + # ____ ____ + # / __/___ / __/ + # / /_/_ / / /_ + # / __/ / /_/ __/ + # /_/ /___/_/ key-bindings.zsh + # + # - $FZF_TMUX_OPTS + # - $FZF_CTRL_T_COMMAND + # - $FZF_CTRL_T_OPTS + # - $FZF_CTRL_R_OPTS + # - $FZF_ALT_C_COMMAND + # - $FZF_ALT_C_OPTS + + # Key bindings + # ------------ + + # The code at the top and the bottom of this file is the same as in completion.zsh. + # Refer to that file for explanation. + if 'zmodload' 'zsh/parameter' 2>'/dev/null' && (( ${+options} )); then + __fzf_key_bindings_options="options=(${(j: :)${(kv)options[@]}})" + else + () { + __fzf_key_bindings_options="setopt" + 'local' '__fzf_opt' + for __fzf_opt in "${(@)${(@f)$(set -o)}%% *}"; do + if [[ -o "$__fzf_opt" ]]; then + __fzf_key_bindings_options+=" -o $__fzf_opt" + else + __fzf_key_bindings_options+=" +o $__fzf_opt" + fi + done + } + fi + + 'emulate' 'zsh' '-o' 'no_aliases' + + { + + [[ -o interactive ]] || return 0 + + # CTRL-T - Paste the selected file path(s) into the command line + __fsel() { + local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type f -print \ + -o -type d -print \ + -o -type l -print 2> /dev/null | cut -b3-"}" + setopt localoptions pipefail no_aliases 2> /dev/null + eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read item; do + echo -n "${(q)item} " + done + local ret=$? + echo + return $ret + } + + __fzfcmd() { + [ -n "$TMUX_PANE" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "$FZF_TMUX_OPTS" ]; } && + echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf" + } + + fzf-file-widget() { + LBUFFER="${LBUFFER}$(__fsel)" + local ret=$? + zle reset-prompt + return $ret + } + zle -N fzf-file-widget + bindkey '^T' fzf-file-widget + + # Ensure precmds are run after cd + fzf-redraw-prompt() { + local precmd + for precmd in $precmd_functions; do + $precmd + done + zle reset-prompt + } + zle -N fzf-redraw-prompt + + # ALT-C - cd into the selected directory + fzf-cd-widget() { + local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ + -o -type d -print 2> /dev/null | cut -b3-"}" + setopt localoptions pipefail no_aliases 2> /dev/null + local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" $(__fzfcmd) +m)" + if [[ -z "$dir" ]]; then + zle redisplay + return 0 + fi + if [ -z "$BUFFER" ]; then + BUFFER="cd ${(q)dir}" + zle accept-line + else + print -sr "cd ${(q)dir}" + cd "$dir" + fi + local ret=$? + unset dir # ensure this doesn't end up appearing in prompt expansion + zle fzf-redraw-prompt + return $ret + } + zle -N fzf-cd-widget + bindkey '\ec' fzf-cd-widget + + # CTRL-R - Paste the selected command from history into the command line + fzf-history-widget() { + local selected num + setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null + selected=( $(fc -rl 1 | perl -ne 'print if !$seen{(/^\s*[0-9]+\**\s+(.*)/, $1)}++' | + FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} $FZF_DEFAULT_OPTS -n2..,.. --tiebreak=index --bind=ctrl-r:toggle-sort $FZF_CTRL_R_OPTS --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) ) + local ret=$? + if [ -n "$selected" ]; then + num=$selected[1] + if [ -n "$num" ]; then + zle vi-fetch-history -n $num + fi + fi + zle reset-prompt + return $ret + } + zle -N fzf-history-widget + bindkey '^R' fzf-history-widget + + } always { + eval $__fzf_key_bindings_options + 'unset' '__fzf_key_bindings_options' + } else bindkey '^R' history-incremental-search-backward fi diff --git a/files/linkdots.sh b/files/linkdots.sh deleted file mode 100755 index 949e45d..0000000 --- a/files/linkdots.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# Make sure the paths are correct -path=$(pwd) - -# --- home --- # -home_files="scripts .zshrc .gitconfig .tmux.conf .vimrc .profile" - -for file in $home_files -do - # rm, so folders also get updated - rm -rf $HOME/$file - ln -sf $path/$file $HOME/$file -done - -# emacs -mkdir -p $HOME/.emacs.d -ln -sf $path/init.el $HOME/.emacs.d/init.el - -# --- .config --- # -conf_files="alacritty zathura i3 i3status" - -for file in $conf_files -do - # rm, so folders also get updated - rm -rf $HOME/.config/$file - ln -sf $path/.config/$file $HOME/.config/$file -done diff --git a/files/.config/i3/config b/old/i3/config similarity index 100% rename from files/.config/i3/config rename to old/i3/config diff --git a/files/.config/i3status/config b/old/i3status/config similarity index 100% rename from files/.config/i3status/config rename to old/i3status/config diff --git a/files/scripts/key_bindings.zsh b/old/scripts/key_bindings.zsh similarity index 100% rename from files/scripts/key_bindings.zsh rename to old/scripts/key_bindings.zsh diff --git a/files/scripts/lock.sh b/old/scripts/lock.sh similarity index 100% rename from files/scripts/lock.sh rename to old/scripts/lock.sh diff --git a/files/scripts/start_progs.sh b/old/scripts/start_progs.sh similarity index 100% rename from files/scripts/start_progs.sh rename to old/scripts/start_progs.sh diff --git a/files/scripts/wallpaper.sh b/old/scripts/wallpaper.sh similarity index 100% rename from files/scripts/wallpaper.sh rename to old/scripts/wallpaper.sh