Add ssh-agent systemd service

This commit is contained in:
Thomas Dehaeze 2019-12-30 17:21:38 +01:00
parent 675d0ac248
commit c53b09bd20
3 changed files with 91 additions and 18 deletions

View File

@ -1,5 +1,41 @@
#+TITLE:Desktop file for the applications #+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 * Neomutt
:PROPERTIES: :PROPERTIES:
:header-args: :tangle ~/.local/share/applications/neomutt.desktop :header-args: :tangle ~/.local/share/applications/neomutt.desktop

View File

@ -21,17 +21,6 @@
bind "set completion-ignore-case on" bind "set completion-ignore-case on"
bind "set show-all-if-ambiguous on" bind "set show-all-if-ambiguous on"
#+END_SRC #+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 ** Use Color
#+BEGIN_SRC bash #+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)\]" 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 #+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 ** Rebind up and down arrow keys to search through bash history
#+BEGIN_SRC bash #+BEGIN_SRC bash
bind '"\e[A": history-search-backward' bind '"\e[A": history-search-backward'
@ -365,8 +364,8 @@ Force prompt to write history after every command. http://superuser.com/question
* Profile * Profile
:PROPERTIES: :PROPERTIES:
:header-args:conf: :tangle ~/.profile :header-args:bash: :tangle ~/.profile
:header-args:conf+: :comments both :mkdirp yes :header-args:bash+: :comments both :mkdirp yes
:END: :END:
** QT And GTK Themes ** 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" export XDG_CONFIG_HOME="$HOME/.config"
#+end_src #+end_src
*** dpi config for Alacritty
#+begin_src bash
export WINIT_HIDPI_FACTOR=1.
#+end_src
*** Better yaourt colors *** Better yaourt colors
#+begin_src bash #+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" 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 export GOPATH=$HOME/go
#+END_SRC #+END_SRC
*** SSH Agent
#+begin_src bash
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/ssh-agent.socket"
#+end_src
** Path ** Path
#+begin_src bash #+begin_src bash
PATH=$HOME/appimages:$PATH PATH=$HOME/appimages:$PATH
PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH PATH=$HOME/.gem/ruby/2.5.0/bin:$PATH
PATH=$GOPATH:$GOPATH/bin:$PATH PATH=$GOPATH:$GOPATH/bin:$PATH
PATH=~/bin:$PATH PATH=~/bin:$PATH
PATH=~/.emacs.d/bin:$PATH
export PATH export PATH
#+END_SRC #+END_SRC

View File

@ -427,3 +427,40 @@
[Install] [Install]
WantedBy=default.target WantedBy=default.target
#+end_src #+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