diff --git a/emacs/emacs.el b/emacs/emacs.el index 78d5bcd..21d2e90 100644 --- a/emacs/emacs.el +++ b/emacs/emacs.el @@ -1,5 +1,5 @@ ;; Emacs configuration -;; Marcel Kapfer (C) 2016 - 2018 +;; Marcel Kapfer (C) 2016 - 2019 ;; MIT License ;; ----------------------------------------------------------------------------- @@ -366,6 +366,9 @@ (use-package org :mode "\\.org$" :config + ;; Add org modules + (require 'org-habit) + (add-to-list 'org-modules "org-habit") ;; add scrartcl LaTeX class to org (with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes @@ -509,6 +512,10 @@ ;; store link to message if in header view, not to header query (setq org-mu4e-link-query-in-headers-mode nil) + ;; Adjust fontification block length + (setcar (nthcdr 4 org-emphasis-regexp-components) 10) + (org-set-emph-re 'org-emphasis-regexp-components org-emphasis-regexp-components) + :bind (("C-c l" . org-store-link) ("C-c c" . org-capture) @@ -1379,13 +1386,22 @@ signature-file is the path to the file which contains the signature." (use-package rust-mode :mode (("\\.rs\\'" . rust-mode))) +;; nix-mode +(use-package nix-mode + :mode (("\\.nix\\'" . nix-mode))) + +;; haskell-mode +(use-package haskell-mode + :mode (("\\.hs\\'" . haskell-mode))) + ;; all-the-icons ;; A utility package to collect various Icon Fonts and propertized them within Emacs (use-package all-the-icons) ;; spaceline ;; Powerline theme from Spacemacs -(use-package spaceline) +(use-package spaceline + :init (spaceline-emacs-theme)) ;; fancy-battery ;; Fancy battery display @@ -1393,14 +1409,6 @@ signature-file is the path to the file which contains the signature." :after spaceline :init (fancy-battery-mode)) -;; spaceline-all-the-icons -;; A Spaceline Mode Line theme using All The Icons -(use-package spaceline-all-the-icons - :after fancy-battery - :config - (spaceline-all-the-icons-theme) - (spaceline-toggle-all-the-icons-battery-status-on)) - ;; Doom theme ;; https://github.com/hlissner/emacs-doom-themes (use-package doom-themes diff --git a/links.list b/links.list index 0649429..1f20e13 100644 --- a/links.list +++ b/links.list @@ -12,7 +12,7 @@ redshift/redshift .config/redshift.conf screen/screenrc .screenrc shells/bashrc .bashrc shells/zshrc .zshrc -shells/fish/config.fish .config/fish/ +shells/fish/conf.d .config/fish/ shells/fish/functions .config/fish/ stumpwm/stumpwmrc .stumpwmrc x/xinitrc .xinitrc diff --git a/shells/fish/conf.d/00-emacs.fish b/shells/fish/conf.d/00-emacs.fish new file mode 100644 index 0000000..c8735df --- /dev/null +++ b/shells/fish/conf.d/00-emacs.fish @@ -0,0 +1,25 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Run zsh when using emacs +# Current problem with fish seems to be the theme +if test $TERM = "eterm-color" + exec zsh +end diff --git a/shells/fish/conf.d/00-env.fish b/shells/fish/conf.d/00-env.fish new file mode 100644 index 0000000..5024860 --- /dev/null +++ b/shells/fish/conf.d/00-env.fish @@ -0,0 +1,47 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +set -x ARCHFLAGS -arch_x86_64 + +set -e GPG_TTY +set -Ux GPG_TTY (tty) + +set -e EDITOR +set -Ux EDITOR "emacsclient -"t + +if test -z $VISUAL + set -Ux VISUAL emacsclient -t +end + +if test -z $GIT_EDITOR + set -Ux GIT_EDITOR es +end + +if test -z $GOPATH + set -Ux GOPATH ~/.go +end + +if test -z $XDG_CURRENT_DESKTOP + set -Ux XDG_CURRENT_DESKTOP GNOME +end + +if test -z $QT_STYLE_OVERRIDE + set -Ux QT_STYLE_OVERRIDE kvantum +end diff --git a/shells/fish/conf.d/10-abbr.fish b/shells/fish/conf.d/10-abbr.fish new file mode 100644 index 0000000..ce374a8 --- /dev/null +++ b/shells/fish/conf.d/10-abbr.fish @@ -0,0 +1,32 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Fish Abbrevations +# Those are expanded before execution +# See: https://fishshell.com/docs/current/commands.html#abbr + +if status --is-interactive + abbr --add l ls + abbr --add ping ping -c 3 mmk2410.org + abbr --add pingtest ping -c 3 mmk2410.org + abbr --add e eval $EDITOR + abbr --add g git + abbr --add s sudo +end diff --git a/shells/fish/conf.d/10-alias.fish b/shells/fish/conf.d/10-alias.fish new file mode 100644 index 0000000..6aaa659 --- /dev/null +++ b/shells/fish/conf.d/10-alias.fish @@ -0,0 +1,36 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +if status --is-interactive + alias grep='grep --color=auto' + alias df='df -h' + alias du='du -c -h' + alias mkdir='mkdir -p -v' + alias ln='ln -i' + alias chown='chown --preserve-root' + alias chmod='chmod --preserve-root' + alias chgrp='chgrp --preserve-root' + alias ps='ps aux k%cpu' + alias q=' exit' + alias Q=' exit' + alias x=' exit' + alias o='xdg-open' + alias vim="nvim" +end diff --git a/shells/fish/conf.d/40-nix.fish b/shells/fish/conf.d/40-nix.fish new file mode 100644 index 0000000..eac59e9 --- /dev/null +++ b/shells/fish/conf.d/40-nix.fish @@ -0,0 +1,25 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Source the Nix profile, if it exists. +set -l NIX_PROFILE $HOME/.nix-profile/etc/profile.d/nix.fish +if test -e $NIX_PROFILE + source $NIX_PROFILE +end diff --git a/shells/fish/conf.d/60-debian.fish b/shells/fish/conf.d/60-debian.fish new file mode 100644 index 0000000..61b9684 --- /dev/null +++ b/shells/fish/conf.d/60-debian.fish @@ -0,0 +1,37 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Debian Packaging + +# quilt +alias dquilt="quilt --quiltrc=$HOME/.quiltrc-dpkg" + +# Variables +set -x DEBUILD_DPKG_BUILDPACKAGE_OPTS "-i -I -us -uc" +set -x DEBUILD_LINTIAN_OPTS "-i -I --show-overrides" +set -x DEBSIGN_KEYID "9FE01C39F74551D434116394CADE6F0C09F21B09" + +if test -z $DEBFULLNAME + set -Ux DEBFULLNAME "Marcel Kapfer" +end + +if test -z $DEBEMAIL + set -Ux DEBEMAIL "opensource@mmk2410.org" +end diff --git a/shells/fish/conf.d/99-x.fish b/shells/fish/conf.d/99-x.fish new file mode 100644 index 0000000..71cdc4b --- /dev/null +++ b/shells/fish/conf.d/99-x.fish @@ -0,0 +1,32 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +# Automatically start X at login +# source: https://wiki.archlinux.org/index.php/Fish#Start_X_at_login +# This must be at the bottom of this file +if status --is-login + if test -z "$DISPLAY" -a $XDG_VTNR = 1 + # Unlock GPG keyring befor starting X. + # This makes some things easier. + echo "gpg unlock" | gpg -se -r me@mmk2410.org > /dev/null + pulseaudio -D # start pulseaudio before X is started + exec startx -- -keeptty + end +end diff --git a/shells/fish/conf.d/pure.fish b/shells/fish/conf.d/pure.fish new file mode 100644 index 0000000..1bf429e --- /dev/null +++ b/shells/fish/conf.d/pure.fish @@ -0,0 +1,70 @@ +set --universal pure_version 2.1.1 # used for bug report + +# Base colors +_pure_set_default pure_color_primary (set_color blue) +_pure_set_default pure_color_info (set_color cyan) +_pure_set_default pure_color_mute (set_color brblack) +_pure_set_default pure_color_success (set_color magenta) +_pure_set_default pure_color_normal (set_color normal) +_pure_set_default pure_color_danger (set_color red) +_pure_set_default pure_color_light (set_color white) +_pure_set_default pure_color_warning (set_color yellow) +_pure_set_default pure_color_dark (set_color black) + +# Prompt +_pure_set_default pure_symbol_prompt "❯" +_pure_set_default pure_symbol_reverse_prompt "❮" # used for VI mode +_pure_set_default pure_color_prompt_on_error $pure_color_danger +_pure_set_default pure_color_prompt_on_success $pure_color_success + +# Current Working Directory +_pure_set_default pure_color_current_directory $pure_color_primary + +# Git +_pure_set_default pure_symbol_git_unpulled_commits "⇣" +_pure_set_default pure_symbol_git_unpushed_commits "⇡" +_pure_set_default pure_symbol_git_dirty "*" +_pure_set_default pure_color_git_unpulled_commits $pure_color_info +_pure_set_default pure_color_git_unpushed_commits $pure_color_info +_pure_set_default pure_color_git_branch $pure_color_mute +_pure_set_default pure_color_git_dirty $pure_color_mute + +# SSH info +_pure_set_default pure_color_ssh_hostname $pure_color_mute +_pure_set_default pure_color_ssh_separator $pure_color_mute +_pure_set_default pure_color_ssh_user_normal $pure_color_mute +_pure_set_default pure_color_ssh_user_root $pure_color_light + +# Virtualenv for Pyhon +_pure_set_default pure_color_virtualenv $pure_color_mute +# Deactivate the default virtualenv prompt so that we can add our own +set --global --export VIRTUAL_ENV_DISABLE_PROMPT 1 + +# Print current working directory at the beginning of prompt +# true (default): current directory, git, user@hostname (ssh-only), command duration +# false: user@hostname (ssh-only), current directory, git, command duration +_pure_set_default pure_begin_prompt_with_current_directory true + +# Show exit code of last command as a separate prompt character (cf. https://github.com/sindresorhus/pure/wiki#show-exit-code-of-last-command-as-a-separate-prompt-character) +# false - single prompt character, default +# true - separate prompt character +_pure_set_default pure_separate_prompt_on_error false + +# Max execution time of a process before its run time is shown when it exits +_pure_set_default pure_threshold_command_duration 5 +_pure_set_default pure_color_command_duration $pure_color_warning + +# Right Prompt variables +_pure_set_default pure_right_prompt "" +_pure_set_default pure_color_right_prompt $pure_color_normal + +# VI mode indicator +# true (default): indicate a non-insert mode by reversing the prompt symbol (❮) +# false: indicate vi mode with [I], [N], [V] +_pure_set_default pure_reverse_prompt_symbol_in_vimode true + +# Title +_pure_set_default pure_symbol_title_bar_separator "—" + +# Whether or not is a fresh session +set --global _pure_fresh_session true diff --git a/shells/fish/config.fish b/shells/fish/config.fish deleted file mode 100644 index e04a471..0000000 --- a/shells/fish/config.fish +++ /dev/null @@ -1,135 +0,0 @@ -set -x ARCHFLAGS -arch_x86_64 - -set -e GPG_TTY -set -Ux GPG_TTY (tty) - -eval (thefuck --alias | tr '\n' ';') -alias l="ls" -alias diff='colordiff' -alias grep='grep --color=auto' -alias more='less' -alias df='df -h' -alias du='du -c -h' -alias mkdir='mkdir -p -v' -alias nano='nano -w' -alias ping='ping -c 3' -alias pingtest='ping -c 3 marcel-kapfer.de' -alias dmesg='dmesg -HL' -alias da='date "+%A, %B %d, %Y [%T]"' -alias du1='du --max-depth=1' -alias hist='history | grep' # requires an argument -alias openports='ss --all --numeric --processes --ipv4 --ipv6' -alias pgg='ps -Af | grep' # requires an argument -alias ln='ln -i' -alias chown='chown --preserve-root' -alias chmod='chmod --preserve-root' -alias chgrp='chgrp --preserve-root' -alias cls=' echo -ne "\033c"' -alias ps='ps aux k%cpu' -alias new='touch' -alias re='/sbin/reboot' -alias off='/sbin/poweroff' -alias vol='alsamixer' -alias q=' exit' -alias Q=' exit' -alias x=' exit' -alias cd..='cd ..' -alias sbcl='rlwrap sbcl' -alias o='xdg-open' -alias nemo='nemo --no-desktop' - -alias mmk2410='~/.mmk2410' - -# Debian Packaging - -# quilt -alias dquilt="quilt --quiltrc=$HOME/.quiltrc-dpkg" - -# Variables -set -x DEBUILD_DPKG_BUILDPACKAGE_OPTS "-i -I -us -uc" -set -x DEBUILD_LINTIAN_OPTS "-i -I --show-overrides" -set -x DEBSIGN_KEYID "9FE01C39F74551D434116394CADE6F0C09F21B09" - -# if [ -z $SSH_CLIENT ] -# ~/.mmk2410 -# end - -if [ -z $EDITOR ] - set -Ux EDITOR es -end - -if [ -z $VISUAL ] - set -Ux VISUAL es -end - -if [ -z $GIT_EDITOR ] - set -Ux GIT_EDITOR es -end - -if [ -z $GOPATH ] - set -Ux GOPATH ~/.go -end - -if test -z $DEBFULLNAME - set -Ux DEBFULLNAME "Marcel Kapfer" -end - -if test -z $DEBEMAIL - set -Ux DEBEMAIL "opensource@mmk2410.org" -end - -if test -z $XDG_CURRENT_DESKTOP - set -Ux XDG_CURRENT_DESKTOP GNOME -end - -if test -z $QT_STYLE_OVERRIDE - set -Ux QT_STYLE_OVERRIDE kvantum -end - -# Attach the autoscreen screen session if StumpWM is running -# and it's not already in use. -# if test \( -n $DESKTOP_SESSION \) -a \( $DESKTOP_SESSION = "stumpwm" \) -# if screen -list | grep -q "No Sockets" -# screen -dmS autoscreen -# exec screen -r -# else if screen -list | grep -Eq "\.autoscreen.*Detached" -# exec screen -r -# end -# end - -# gpg-agent as SSH agent -# set -e SSH_AGENT_PID -# set -e SSH_AUTH_SOCK -# if test -z $gnupg_SSH_AUTH_SOCK_by -# set gnupg_SSH_AUTH_SOCK_by 0 -# end -# if test $gnupg_SSH_AUTH_SOCK_by -ne %self -# set UID (id -u) -# set -Ux SSH_AUTH_SOCK "/run/user/$UID/gnupg/S.gpg-agent.ssh" -# end -# gpg-connect-agent updatestartuptty /bye > /dev/null - -# Source the Nix profile, if it exists. -set -l NIX_PROFILE $HOME/.nix-profile/etc/profile.d/nix.fish -if test -e $NIX_PROFILE - source $NIX_PROFILE -end - -# Run zsh when using emacs -# Current problem with fish seems to be the theme -if test $TERM = "eterm-color" - exec zsh -end - -# Automatically start X at login -# source: https://wiki.archlinux.org/index.php/Fish#Start_X_at_login -# This must be at the bottom of this file -if status --is-login - if test -z "$DISPLAY" -a $XDG_VTNR = 1 - # Unlock GPG keyring befor starting X. - # This makes some things easier. - echo "gpg unlock" | gpg -se -r me@mmk2410.org > /dev/null - pulseaudio -D # start pulseaudio before X is started - exec startx -- -keeptty - end -end diff --git a/shells/fish/functions/.gitignore b/shells/fish/functions/.gitignore index 49074af..643eb47 100644 --- a/shells/fish/functions/.gitignore +++ b/shells/fish/functions/.gitignore @@ -22,3 +22,13 @@ set_color_custom.fish vcs.name.fish vcs.present.fish fisher.fish +fin.fish +fish_greeting.fish +fish_mode_prompt.fish +host_info.fish +last_job_id.fish +pwd_info.fish +pwd_is_home.fish +_* +fish_prompt.fish +fish_title.fish diff --git a/shells/fish/functions/cdl.fish b/shells/fish/functions/cdl.fish index e529f41..9618302 100644 --- a/shells/fish/functions/cdl.fish +++ b/shells/fish/functions/cdl.fish @@ -1,4 +1,24 @@ -function cdl +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +function cdl --wraps cd --description "Switch directory and show content" cd $argv l end diff --git a/shells/fish/functions/diff.fish b/shells/fish/functions/diff.fish new file mode 100644 index 0000000..eae0167 --- /dev/null +++ b/shells/fish/functions/diff.fish @@ -0,0 +1,27 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +function diff --wraps diff --description "Use colordiff instead of diff, if available" + if type -q colordiff + colordiff $argv + else + diff $argv + end +end diff --git a/shells/fish/functions/fish_prompt.fish b/shells/fish/functions/fish_prompt.fish deleted file mode 120000 index f1f0416..0000000 --- a/shells/fish/functions/fish_prompt.fish +++ /dev/null @@ -1 +0,0 @@ -/home/marcel/.config/fisherman/eco/functions/fish_prompt.fish \ No newline at end of file diff --git a/shells/fish/functions/fish_title.fish b/shells/fish/functions/fish_title.fish deleted file mode 100644 index f1646ed..0000000 --- a/shells/fish/functions/fish_title.fish +++ /dev/null @@ -1,12 +0,0 @@ -# Defined in /tmp/fish.au862c/fish_title.fish @ line 2 -function fish_title - if test -z $EMACS - if test $_ = 'fish' - echo (prompt_pwd) - else - echo $_ - end - else - true - end -end diff --git a/shells/fish/functions/g.fish b/shells/fish/functions/g.fish deleted file mode 100644 index 8abc055..0000000 --- a/shells/fish/functions/g.fish +++ /dev/null @@ -1,27 +0,0 @@ -function g - git $argv -end - -function gst - git status $argv -end - -function gcom - git commit $argv -end - -function gad - git add $argv -end - -function gup - git push $argv -end - -function gdo - git pull $argv -end - -function gdif - git diff $argv -end diff --git a/shells/fish/functions/haha.fish b/shells/fish/functions/haha.fish deleted file mode 100644 index 4c69ff1..0000000 --- a/shells/fish/functions/haha.fish +++ /dev/null @@ -1,5 +0,0 @@ -function haha - for x in (seq 10) - echo hahahahahahahahahahahahahahahahahaha - end -end diff --git a/shells/fish/functions/sbcl.fish b/shells/fish/functions/sbcl.fish new file mode 100644 index 0000000..1724e14 --- /dev/null +++ b/shells/fish/functions/sbcl.fish @@ -0,0 +1,27 @@ +# Copyright © 2019 Marcel Kapfer +# MIT License + +# Permission is hereby granted, free of charge, to any person obtaining a copy of +# this software and associated documentation files (the "Software"), to deal in +# the Software without restriction, including without limitation the rights to +# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +# the Software, and to permit persons to whom the Software is furnished to do so, +# subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +function sbcl --wraps sbcl --description "Wrap SBCL with rlwrap (readline support)" + if type -q rlwrap + rlwrap sbcl $argv + else + sbcl $argv + end +end diff --git a/shells/fish/functions/upgrade.fish b/shells/fish/functions/upgrade.fish deleted file mode 100644 index e714f92..0000000 --- a/shells/fish/functions/upgrade.fish +++ /dev/null @@ -1,8 +0,0 @@ -function upgrade --description "Upgrade the system" - sudo apt update - and sudo apt upgrade - and sudo apt full-upgrade - and sudo apt autoremove - sudo tlmgr update --self --all - sudo npm update -g -end diff --git a/shells/fish/functions/vim.fish b/shells/fish/functions/vim.fish deleted file mode 100644 index f0a542e..0000000 --- a/shells/fish/functions/vim.fish +++ /dev/null @@ -1,3 +0,0 @@ -function vim - nvim $argv -end diff --git a/stumpwm/stumpwmrc b/stumpwm/stumpwmrc index 5d2d7fe..806b02c 100644 --- a/stumpwm/stumpwmrc +++ b/stumpwm/stumpwmrc @@ -3,12 +3,23 @@ ;; StumpWM configuration file ;; ;; -;; 2016 - 2018 (c) Marcel Kapfer +;; 2016 - 2019 (c) Marcel Kapfer ;; MIT License (in-package :stumpwm) -(defparameter *key-layout* "us -variant altgr-intl" "Stores the current key layout") +;; Other parameters +(defparameter *key-layout* "de" "Stores the current key layout") + +;; Default applicatoins +(defparameter *web-browser* "firefox" "Stores the web browser") +(defparameter *editor* "emacsclient -c" "Stores the editor") +(defparameter *terminal* "urxvt" "Stores the terminal emulator") +(defparameter *file-manager* "dolphin" "Stores the terminal emulator") +(defparameter *music-player* "spotify" "Stores the terminal emulator") + +;; set correct module directory +(set-module-dir "~/.stumpwm.d/contrib") ;; creating or rename groups (setf (group-name (first (screen-groups (current-screen)))) "web") @@ -82,25 +93,25 @@ ;;; emacs (defcommand emacs () () "run emacs" - (run-or-raise "es" '(:class "Emacs"))) + (run-or-raise *editor* '(:class "Emacs"))) ;; root keybindings ; ;; browser -(define-key *root-map* (kbd "W") "exec x-www-browser") -(define-key *root-map* (kbd "P") "exec x-www-browser --private-window") +(define-key *root-map* (kbd "W") (concatenate 'string "exec " *web-browser*)) +(define-key *root-map* (kbd "P") (concatenate 'string "exec " *web-browser* " --private-window")) ;;; terminal -(define-key *root-map* (kbd "c") "exec x-terminal-emulator") +(define-key *root-map* (kbd "c") (concatenate 'string "exec " *terminal*)) -;;; es as emacs -(define-key *root-map* (kbd "e") "exec es") +;;; (text) editor +(define-key *root-map* (kbd "e") (concatenate 'string "exec " *editor*)) ;;; ranger -(define-key *root-map* (kbd "C-c") "exec nemo --no-desktop") +(define-key *root-map* (kbd "C-c") (concatenate 'string "exec " *file-manager*)) ;;; spotify -(define-key *root-map* (kbd "m") "exec spotify") +(define-key *root-map* (kbd "m") (concatenate 'string "exec " *music-player*)) ;;; bind keys for changing workspace (define-key *root-map* (kbd "C-1") "change-workspace web") @@ -141,10 +152,10 @@ ;; computer power state keys (defvar *powerstate-frame-bindings* (let ((m (make-sparse-keymap))) - (define-key m (kbd "M-s") "system-suspend") - (define-key m (kbd "M-p") "system-poweroff") - (define-key m (kbd "M-r") "system-restart") - (define-key m (kbd "M-h") "system-hibernate") + (define-key m (kbd "M-s") "systemctl suspend") + (define-key m (kbd "M-p") "systemctl poweroff") + (define-key m (kbd "M-r") "systemctl reboot") + (define-key m (kbd "M-h") "systemctl hibernate") m)) (define-key *root-map* (kbd "C-F12") '*powerstate-frame-bindings*) @@ -166,7 +177,7 @@ (run-shell-command "dunst") ;; nitrogen (wallpaper) -(run-shell-command "nitrogen --restore") +(run-shell-command "~/.fehbg") ;; start compton (compositor) (run-shell-command "compton --config ~/.config/compton.conf") @@ -309,14 +320,14 @@ (defmacro make-web-jump (name prefix) `(defcommand ,(intern name) (search) ((:rest ,(concatenate 'string name " search: "))) (substitute #\+ #\Space search) - (run-shell-command (concatenate 'string ,prefix search)))) + (run-shell-command (concatenate 'string *www-browser* " " ,prefix search)))) -(make-web-jump "google" "x-www-browser http://www.google.com/search?q=") -(make-web-jump "googlede" "x-www-browser http://www.google.de/search?q=") -(make-web-jump "duckduckgo" "x-www-browser https://duckduckgo.com/?q=") -(make-web-jump "packages" "x-www-browser https://packages.debian.org/") -(make-web-jump "wikipedia" "x-www-browser https://en.wikipedia.org/w/index.php?search=") -(make-web-jump "wikipediade" "x-www-browser https://de.wikipedia.org/w/index.php?search=") +(make-web-jump "google" "http://www.google.com/search?q=") +(make-web-jump "googlede" "http://www.google.de/search?q=") +(make-web-jump "duckduckgo" "https://duckduckgo.com/?q=") +(make-web-jump "packages" "https://packages.debian.org/") +(make-web-jump "wikipedia" "https://en.wikipedia.org/w/index.php?search=") +(make-web-jump "wikipediade" "https://de.wikipedia.org/w/index.php?search=") (defun list-screen-layouts () "Return an alist of possible screen layouts. Those are the layouts saved in @@ -380,11 +391,8 @@ script." ;; owncloud (run-shell-command "nextcloud") -;; bwSyncAndShare -(run-shell-command "bwsyncandshare") - -;; firefox -(run-shell-command "x-www-browser") +;; web browser +(run-shell-command *web-browser*) ;; telegram (run-shell-command "telegram-desktop") @@ -392,9 +400,6 @@ script." ;; redshift (run-shell-command "redshift") -;; orage -(run-shell-command "orage") - ;; last settings ;; (stumptray:stumptray)