From c53b09bd20a89cd2155148e66811d17a5b846c7e Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Mon, 30 Dec 2019 17:21:38 +0100 Subject: [PATCH] Add ssh-agent systemd service --- dotfiles/applications.org | 36 ++++++++++++++++++++++++++++++++++++ dotfiles/bash.org | 36 ++++++++++++++++++------------------ dotfiles/systemd.org | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 18 deletions(-) diff --git a/dotfiles/applications.org b/dotfiles/applications.org index 5e323be..9d6329d 100644 --- a/dotfiles/applications.org +++ b/dotfiles/applications.org @@ -1,5 +1,41 @@ #+TITLE:Desktop file for the applications +* Mime Applications +:PROPERTIES: +:header-args: :tangle ~/.config/mimeapps.list +:header-args+: :comments both :mkdirp yes +:END: + +#+BEGIN_SRC conf + [Default Applications] + text/plain=nvim.desktop + x-scheme-handler/magnet=torrent.desktop; + text/x-shellscript=nvim.desktop; + image/png=img.desktop; + image/jpeg=img.desktop; + image/gif=img.desktop; + application/rss+xml=rss.desktop + x-scheme-handler/mailto=neomutt.desktop + message/rfc822=neomutt.desktop + application/x-bittorrent=deluge.desktop + application/pdf=zathura.desktop + x-scheme-handler/http=qutebrowser.desktop + x-scheme-handler/https=qutebrowser.desktop + x-scheme-handler/ftp=qutebrowser.desktop + x-scheme-handler/chrome=qutebrowser.desktop + text/html=qutebrowser.desktop + application/x-extension-htm=qutebrowser.desktop + application/x-extension-html=qutebrowser.desktop + application/x-extension-shtml=qutebrowser.desktop + application/xhtml+xml=qutebrowser.desktop + application/x-extension-xhtml=qutebrowser.desktop + application/x-extension-xht=qutebrowser.desktop + + [Added Associations] + text/plain=mousepad.desktop; + application/x-bittorrent=deluge.desktop; +#+END_SRC + * Neomutt :PROPERTIES: :header-args: :tangle ~/.local/share/applications/neomutt.desktop diff --git a/dotfiles/bash.org b/dotfiles/bash.org index ee3417b..823b3fc 100644 --- a/dotfiles/bash.org +++ b/dotfiles/bash.org @@ -21,17 +21,6 @@ bind "set completion-ignore-case on" bind "set show-all-if-ambiguous on" #+END_SRC -** Change the window title of X terminals -#+BEGIN_SRC bash -case ${TERM} in - xterm*|rxvt*|Eterm*|aterm|kterm|gnome*|interix|konsole*) - PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"' - ;; - screen*) - PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"' - ;; -esac -#+END_SRC ** Use Color #+BEGIN_SRC bash @@ -104,6 +93,16 @@ shopt -s histappend export PS1="\[$(tput bold)\]\[$(tput setaf 1)\][\[$(tput setaf 3)\]\u\[$(tput setaf 2)\]@\[$(tput setaf 4)\]\h \[$(tput setaf 5)\]\W\[$(tput setaf 1)\]]\[$(tput setaf 7)\]\\$ \[$(tput sgr0)\]" #+END_SRC +** SSH Agent +#+begin_src bash +# if ! pgrep -u "$USER" ssh-agent > /dev/null; then +# ssh-agent > "$XDG_RUNTIME_DIR/ssh-agent.env" +# fi +# if [[ ! "$SSH_AUTH_SOCK" ]]; then +# eval "$(<"$XDG_RUNTIME_DIR/ssh-agent.env")" +# fi +#+end_src + ** Rebind up and down arrow keys to search through bash history #+BEGIN_SRC bash bind '"\e[A": history-search-backward' @@ -365,8 +364,8 @@ Force prompt to write history after every command. http://superuser.com/question * Profile :PROPERTIES: -:header-args:conf: :tangle ~/.profile -:header-args:conf+: :comments both :mkdirp yes +:header-args:bash: :tangle ~/.profile +:header-args:bash+: :comments both :mkdirp yes :END: ** QT And GTK Themes @@ -399,11 +398,6 @@ Force prompt to write history after every command. http://superuser.com/question export XDG_CONFIG_HOME="$HOME/.config" #+end_src -*** dpi config for Alacritty -#+begin_src bash - export WINIT_HIDPI_FACTOR=1. -#+end_src - *** Better yaourt colors #+begin_src bash export YAOURT_COLORS="nb=1:pkg=1:ver=1;32:lver=1;45:installed=1;42:grp=1;34:od=1;41;5:votes=1;44:dsc=0:other=1;35" @@ -420,11 +414,17 @@ Force prompt to write history after every command. http://superuser.com/question export GOPATH=$HOME/go #+END_SRC +*** SSH Agent +#+begin_src bash + export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket" +#+end_src + ** Path #+begin_src bash PATH=$HOME/appimages:$PATH PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH PATH=$GOPATH:$GOPATH/bin:$PATH PATH=~/bin:$PATH + PATH=~/.emacs.d/bin:$PATH export PATH #+END_SRC diff --git a/dotfiles/systemd.org b/dotfiles/systemd.org index 33dd23e..09ec5cc 100644 --- a/dotfiles/systemd.org +++ b/dotfiles/systemd.org @@ -427,3 +427,40 @@ [Install] WantedBy=default.target #+end_src +* SSH Agent +:PROPERTIES: +:header-args: :tangle ~/.config/systemd/user/ssh-agent.service +:header-args+: :comments both :mkdirp yes +:END: + +#+begin_src conf +[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 +#+end_src +* Mopidy +:PROPERTIES: +:header-args: :tangle ~/.config/systemd/user/mopidy.service +:header-args+: :comments both :mkdirp yes +:END: + +#+begin_src conf +[Unit] +Description=mopidy +After=network.target + +[Service] +Type=simple +# User=mopidy # this should be removed +ExecStart=/usr/bin/mopidy + +[Install] +WantedBy=multi-user.target +#+end_src