From 0f3e4b1622ec975c1ec2726e59ae0cf1c9d22ea0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Wed, 6 Jan 2016 09:44:10 -0500 Subject: Remove nyan cat from emacs. --- spacemacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs b/spacemacs index 21848b3..a10746f 100644 --- a/spacemacs +++ b/spacemacs @@ -48,7 +48,7 @@ values." ;; wrapped in a layer. If you need some configuration for these ;; packages then consider to create a layer, you can also put the ;; configuration in `dotspacemacs/config'. - dotspacemacs-additional-packages '(nyan-mode) + dotspacemacs-additional-packages '() ;; A list of packages and/or extensions that will not be install and loaded. dotspacemacs-excluded-packages '(smartparens) ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that -- cgit v1.2.3 From 2719fddaa4b42e45a7d23c196d35d16d7c84a6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Tue, 9 Feb 2016 16:38:59 -0500 Subject: Install magit on the spaceship. --- spacemacs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spacemacs b/spacemacs index a10746f..4f92f27 100644 --- a/spacemacs +++ b/spacemacs @@ -34,7 +34,7 @@ values." javascript markdown haskell - ;; git + git markdown org ;; (shell :variables @@ -42,7 +42,7 @@ values." ;; shell-default-position 'bottom) spell-checking ;; syntax-checking - ;; version-control + version-control ) ;; List of additional packages that will be installed without being ;; wrapped in a layer. If you need some configuration for these @@ -54,7 +54,7 @@ values." ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that ;; are declared in a layer which is not a member of ;; the list `dotspacemacs-configuration-layers'. (default t) - dotspacemacs-delete-orphan-packages t)) + dotspacemacs-delete-orphan-packages nil)) (defun dotspacemacs/init () "Initialization function. @@ -250,4 +250,7 @@ layers configuration. You are free to put any user code." (kj-bindings) (kj-org-config) (load-file "~/.spacemacs.local") + ;; I have been warned about magit stealing my files: + (setq magit-last-seen-setup-instructions "1.4.0") + (setq-default git-magit-status-fullscreen t) ) -- cgit v1.2.3 From 7d227de502e327972d4e5e6455a09bb3f2f68699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Tue, 9 Feb 2016 16:40:16 -0500 Subject: Add nxml to the spaceship. --- spacemacs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacemacs b/spacemacs index 4f92f27..80db1c0 100644 --- a/spacemacs +++ b/spacemacs @@ -48,7 +48,7 @@ values." ;; wrapped in a layer. If you need some configuration for these ;; packages then consider to create a layer, you can also put the ;; configuration in `dotspacemacs/config'. - dotspacemacs-additional-packages '() + dotspacemacs-additional-packages '(nxml) ;; A list of packages and/or extensions that will not be install and loaded. dotspacemacs-excluded-packages '(smartparens) ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that -- cgit v1.2.3 From fdedec1b4ecd17106603c2960f78253625d1d125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Tue, 9 Feb 2016 16:40:49 -0500 Subject: Minor spaceship improvements. --- spacemacs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spacemacs b/spacemacs index 80db1c0..23b3f25 100644 --- a/spacemacs +++ b/spacemacs @@ -222,7 +222,7 @@ user code." (lambda () (interactive) (org-capture nil "t"))) (evil-leader/set-key-for-mode - 'org-mode "mh" 'org-up-element) + 'org-mode "oh" 'org-up-element) ) (defun kj-org-config () @@ -250,6 +250,9 @@ layers configuration. You are free to put any user code." (kj-bindings) (kj-org-config) (load-file "~/.spacemacs.local") + ;; Show 80-column marker + (define-globalized-minor-mode global-fci-mode fci-mode (lambda () (fci-mode 1))) + (global-fci-mode 1) ;; I have been warned about magit stealing my files: (setq magit-last-seen-setup-instructions "1.4.0") (setq-default git-magit-status-fullscreen t) -- cgit v1.2.3 From 6bbdad6463bf5ef2015a78f47f6d780649095dc9 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 10 Feb 2016 03:42:45 +0100 Subject: Add youtube commands. --- bin/play-kj | 2 ++ bin/play-yt | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100755 bin/play-kj create mode 100755 bin/play-yt diff --git a/bin/play-kj b/bin/play-kj new file mode 100755 index 0000000..a74ed96 --- /dev/null +++ b/bin/play-kj @@ -0,0 +1,2 @@ +#!/bin/bash +livestreamer "$(xclip -selection clipboard -out)" best \ No newline at end of file diff --git a/bin/play-yt b/bin/play-yt new file mode 100755 index 0000000..cca0628 --- /dev/null +++ b/bin/play-yt @@ -0,0 +1,6 @@ +#!/bin/bash + +rm /tmp/youtube.* +youtube-dl -o /tmp/youtube "$@" & +sleep 5s && mpv /tmp/youtube.* +rm /tmp/youtube.* -- cgit v1.2.3 From fe5f4ef9e5e24d8f3ca3ec9f12bf3a9f0fe5d6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Thu, 31 Mar 2016 10:04:35 -0400 Subject: Add tagging tool, replaces TAG with an incrementing number. --- bin/tag | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 bin/tag diff --git a/bin/tag b/bin/tag new file mode 100755 index 0000000..067e6e6 --- /dev/null +++ b/bin/tag @@ -0,0 +1,2 @@ +#!/bin/bash +awk '/TAG/ {tag++; sub("TAG", tag);} { print };' -- cgit v1.2.3 From 1220df9269b50a81b0b3eb40b8b292a0f4a138fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Thu, 31 Mar 2016 10:05:42 -0400 Subject: Vi mode in tmux. --- tmux.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tmux.conf b/tmux.conf index 590def5..c5384a7 100644 --- a/tmux.conf +++ b/tmux.conf @@ -2,6 +2,7 @@ unbind C-b set -g prefix ^A bind ^A send-prefix set -g aggressive-resize on +set-window-option -g mode-keys vi set -g default-terminal "screen-256color" @@ -17,6 +18,10 @@ setw -g window-status-current-fg "#b294bb" setw -g window-status-activity-fg "#c5c8c6" setw -g window-status-activity-bg "#1d1f21" +## scrolling +## NOPE +#set -g mode-mouse on + ## pane border and colors set -g pane-active-border-bg default set -g pane-active-border-fg "#373b41" -- cgit v1.2.3 From 0d38d06b605b0f9e1cfb7062f5e8c9733f63ba75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?KJ=20=C3=98rbekk?= Date: Thu, 31 Mar 2016 10:05:56 -0400 Subject: Magit settings in spacemacs. --- spacemacs | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/spacemacs b/spacemacs index 23b3f25..28d943a 100644 --- a/spacemacs +++ b/spacemacs @@ -40,7 +40,7 @@ values." ;; (shell :variables ;; shell-default-height 30 ;; shell-default-position 'bottom) - spell-checking + ;; spell-checking ;; syntax-checking version-control ) @@ -48,9 +48,9 @@ values." ;; wrapped in a layer. If you need some configuration for these ;; packages then consider to create a layer, you can also put the ;; configuration in `dotspacemacs/config'. - dotspacemacs-additional-packages '(nxml) + dotspacemacs-additional-packages '() ;; A list of packages and/or extensions that will not be install and loaded. - dotspacemacs-excluded-packages '(smartparens) + dotspacemacs-excluded-packages '(smartparens flyspell) ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that ;; are declared in a layer which is not a member of ;; the list `dotspacemacs-configuration-layers'. (default t) @@ -209,7 +209,8 @@ user code." (if (region-active-p) (kill-region (region-beginning) (region-end)) (backward-kill-word arg))) - ) + (setq-default git-magit-status-fullscreen t) +) (defun kj-bindings () "Set up my custom bindings." @@ -228,14 +229,21 @@ user code." (defun kj-org-config () "Org configuration." (setq-default + ;; nxml is unbearably slow :( + rng-nxml-auto-validate-flag nil + org-todo-keywords '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")) org-directory "~/org" org-support-shift-select t + ;; org-capture-templates + ;; '(("t" "Todo" entry (file+headline "~/org/in.org" "Tasks") + ;; "* TODO %?\n %i\n %a"))) org-capture-templates '(("t" "Todo" entry (file+headline "~/org/in.org" "Tasks") - "* TODO %?\n %i\n %a"))) + "* TODO %?"))) (eval-after-load "org" '(require 'ox-md nil t)) + (global-git-commit-mode t) ) (defun dotspacemacs/user-config () @@ -255,5 +263,18 @@ layers configuration. You are free to put any user code." (global-fci-mode 1) ;; I have been warned about magit stealing my files: (setq magit-last-seen-setup-instructions "1.4.0") - (setq-default git-magit-status-fullscreen t) ) +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(package-selected-packages + (quote + (xterm-color web-mode web-beautify volatile-highlights toc-org spacemacs-theme spaceline powerline smooth-scrolling shm paradox hydra org-repo-todo org-plus-contrib neotree move-text markdown-toc markdown-mode magit-gitflow leuven-theme js2-refactor multiple-cursors js2-mode helm-projectile helm-make projectile helm-flx helm-ag gitconfig-mode gitattributes-mode git-timemachine evil-visualstar evil-surround evil-mc evil-magit evil-lisp-state smartparens evil-jumper evil-iedit-state evil-escape eshell-prompt-extras cmake-mode auto-compile packed aggressive-indent ace-window ace-jump-helm-line avy haskell-mode git-gutter yasnippet gitignore-mode helm helm-core json-reformat magit magit-popup with-editor async dash s quelpa use-package which-key bind-key bind-map evil ws-butler window-numbering vi-tilde-fringe undo-tree tern tagedit spinner smeargle slim-mode shell-pop scss-mode sass-mode restart-emacs rainbow-delimiters popwin pkg-info persp-mode pcre2el page-break-lines package-build orgit org-present org-pomodoro org-bullets open-junk-file multi-term monokai-theme mmm-mode macrostep lorem-ipsum linum-relative less-css-mode json-mode js-doc jade-mode info+ indent-guide iedit ido-vertical-mode hungry-delete htmlize hl-todo hindent highlight-parentheses highlight-numbers highlight-indentation help-fns+ helm-themes helm-swoop helm-mode-manager helm-gitignore helm-flyspell helm-descbinds helm-css-scss haskell-snippets goto-chg google-translate golden-ratio gnuplot git-messenger git-gutter-fringe git-gutter-fringe+ ghc gh-md flx-ido fill-column-indicator fancy-battery expand-region exec-path-from-shell evil-tutor evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-matchit evil-indent-plus evil-exchange evil-args evil-anzu eval-sexp-fu esh-help emmet-mode elisp-slime-nav disaster diminish diff-hl define-word coffee-mode cmm-mode clean-aindent-mode clang-format buffer-move bracketed-paste auto-highlight-symbol auto-dictionary adaptive-wrap ace-link)))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) -- cgit v1.2.3 From 00e7476c6403405d64bc22ca673b106cb3e3ee04 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Tue, 5 Apr 2016 10:41:04 -0400 Subject: Set up sudo askpass. --- bin/askpass.sh | 2 ++ zshrc | 3 +++ 2 files changed, 5 insertions(+) create mode 100755 bin/askpass.sh diff --git a/bin/askpass.sh b/bin/askpass.sh new file mode 100755 index 0000000..d4b2566 --- /dev/null +++ b/bin/askpass.sh @@ -0,0 +1,2 @@ +#!/bin/bash +pass show machine/$(hostname) diff --git a/zshrc b/zshrc index cbf6bdc..d657782 100755 --- a/zshrc +++ b/zshrc @@ -79,3 +79,6 @@ function get-parent-dir() { } zle -N get-parent-dir bindkey "^[u" get-parent-dir + +alias sudo="sudo -A" +SUDO_ASKPASS="$HOME/bin/askpass.sh" -- cgit v1.2.3 From b742a8f70dc250bd8bfcd8da0fc017cec6de0df3 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 6 Apr 2016 20:00:03 -0400 Subject: Set low escape time in tmux. --- tmux.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tmux.conf b/tmux.conf index c5384a7..4ff85d4 100644 --- a/tmux.conf +++ b/tmux.conf @@ -6,6 +6,9 @@ set-window-option -g mode-keys vi set -g default-terminal "screen-256color" +## supposed to help neovim +set -g escape-time 10 + ## set status bar set -g status-bg "#373b41" set -g status-fg "#81a2be" -- cgit v1.2.3 From 8c428640931c4749f945350188b9504588ff1ddb Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sun, 10 Apr 2016 13:09:49 -0400 Subject: Export askpass variable. --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index d657782..e5de8f5 100755 --- a/zshrc +++ b/zshrc @@ -81,4 +81,4 @@ zle -N get-parent-dir bindkey "^[u" get-parent-dir alias sudo="sudo -A" -SUDO_ASKPASS="$HOME/bin/askpass.sh" +export SUDO_ASKPASS="$HOME/bin/askpass.sh" -- cgit v1.2.3 From e9088e350bee110c4a85e8c5608838bf238f61e5 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sun, 10 Apr 2016 16:17:20 -0400 Subject: Remove custom packages from spacemacs. --- spacemacs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/spacemacs b/spacemacs index 28d943a..fd3d00a 100644 --- a/spacemacs +++ b/spacemacs @@ -264,17 +264,3 @@ layers configuration. You are free to put any user code." ;; I have been warned about magit stealing my files: (setq magit-last-seen-setup-instructions "1.4.0") ) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(package-selected-packages - (quote - (xterm-color web-mode web-beautify volatile-highlights toc-org spacemacs-theme spaceline powerline smooth-scrolling shm paradox hydra org-repo-todo org-plus-contrib neotree move-text markdown-toc markdown-mode magit-gitflow leuven-theme js2-refactor multiple-cursors js2-mode helm-projectile helm-make projectile helm-flx helm-ag gitconfig-mode gitattributes-mode git-timemachine evil-visualstar evil-surround evil-mc evil-magit evil-lisp-state smartparens evil-jumper evil-iedit-state evil-escape eshell-prompt-extras cmake-mode auto-compile packed aggressive-indent ace-window ace-jump-helm-line avy haskell-mode git-gutter yasnippet gitignore-mode helm helm-core json-reformat magit magit-popup with-editor async dash s quelpa use-package which-key bind-key bind-map evil ws-butler window-numbering vi-tilde-fringe undo-tree tern tagedit spinner smeargle slim-mode shell-pop scss-mode sass-mode restart-emacs rainbow-delimiters popwin pkg-info persp-mode pcre2el page-break-lines package-build orgit org-present org-pomodoro org-bullets open-junk-file multi-term monokai-theme mmm-mode macrostep lorem-ipsum linum-relative less-css-mode json-mode js-doc jade-mode info+ indent-guide iedit ido-vertical-mode hungry-delete htmlize hl-todo hindent highlight-parentheses highlight-numbers highlight-indentation help-fns+ helm-themes helm-swoop helm-mode-manager helm-gitignore helm-flyspell helm-descbinds helm-css-scss haskell-snippets goto-chg google-translate golden-ratio gnuplot git-messenger git-gutter-fringe git-gutter-fringe+ ghc gh-md flx-ido fill-column-indicator fancy-battery expand-region exec-path-from-shell evil-tutor evil-search-highlight-persist evil-numbers evil-nerd-commenter evil-matchit evil-indent-plus evil-exchange evil-args evil-anzu eval-sexp-fu esh-help emmet-mode elisp-slime-nav disaster diminish diff-hl define-word coffee-mode cmm-mode clean-aindent-mode clang-format buffer-move bracketed-paste auto-highlight-symbol auto-dictionary adaptive-wrap ace-link)))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) -- cgit v1.2.3 From e7fa97afcd67b6fdd3d78869ffb7f65fab671ffd Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sun, 10 Apr 2016 16:18:02 -0400 Subject: Update zgen. --- zgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zgen b/zgen index 3a0f26e..09f5425 160000 --- a/zgen +++ b/zgen @@ -1 +1 @@ -Subproject commit 3a0f26ed2f2d0b7b2f34fa5bac3c3a58d58cfc59 +Subproject commit 09f542515e20ac655a4aa429cf9604fe698ccf42 -- cgit v1.2.3 From cf5121fe942cb1b50c9bacf594d89ccc0959d5ed Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Mon, 11 Apr 2016 09:04:01 -0400 Subject: Add spacemacs mu4e configuration. --- spacemacs | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/spacemacs b/spacemacs index fd3d00a..4e3ecd2 100644 --- a/spacemacs +++ b/spacemacs @@ -43,6 +43,10 @@ values." ;; spell-checking ;; syntax-checking version-control + gnus + mu4e + (mu4e :variables + mu4e-installation-path "/usr/share/emacs/site-lisp") ) ;; List of additional packages that will be installed without being ;; wrapped in a layer. If you need some configuration for these @@ -50,7 +54,7 @@ values." ;; configuration in `dotspacemacs/config'. dotspacemacs-additional-packages '() ;; A list of packages and/or extensions that will not be install and loaded. - dotspacemacs-excluded-packages '(smartparens flyspell) + dotspacemacs-excluded-packages '(smartparens flyspell evil-jumper) ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that ;; are declared in a layer which is not a member of ;; the list `dotspacemacs-configuration-layers'. (default t) @@ -246,6 +250,39 @@ user code." (global-git-commit-mode t) ) +(defun mu4e-config () + (setq mu4e-drafts-folder "/[Gmail]/.Drafts") + (setq mu4e-sent-folder "/[Gmail]/.Sent Mail") + (setq mu4e-trash-folder "/[Gmail]/.Trash") + (setq mu4e-sent-messages-behavior 'delete) + + (setq mu4e-maildir-shortcuts + '( ("/Inbox" . ?i) + ("/[Gmail]/.Sent Mail" . ?s) + ("/[Gmail]/.Trash" . ?t) + ("/[Gmail]/.All Mail" . ?a))) + + (setq mu4e-get-mail-command "mbsync gmail") + + (setq + user-mail-address "kjetil.orbekk@gmail.com" + user-full-name "Kjetil Ørbekk" + mu4e-compose-signature + (concat "KJ\n")) + + (require 'smtpmail) + (setq message-send-mail-function 'smtpmail-send-it + starttls-use-gnutls t + smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)) + smtpmail-auth-credentials + '(("smtp.gmail.com" 587 "kjetil.orbekk@gmail.com" nil)) + smtpmail-default-smtp-server "smtp.gmail.com" + smtpmail-smtp-server "smtp.gmail.com" + smtpmail-smtp-service 587) + + (setq message-kill-buffer-on-exit t) + ) + (defun dotspacemacs/user-config () "Configuration function for user code. This function is called at the very end of Spacemacs initialization after @@ -263,4 +300,5 @@ layers configuration. You are free to put any user code." (global-fci-mode 1) ;; I have been warned about magit stealing my files: (setq magit-last-seen-setup-instructions "1.4.0") + (mu4e-config) ) -- cgit v1.2.3 From 0bcef45f3b8d5f5e6d3793062095ddbd6cff4a75 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Mon, 11 Apr 2016 09:06:43 -0400 Subject: Add mbsyncrc config file. (Not copied by default) --- mbsyncrc | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 mbsyncrc diff --git a/mbsyncrc b/mbsyncrc new file mode 100644 index 0000000..0edefa8 --- /dev/null +++ b/mbsyncrc @@ -0,0 +1,65 @@ +IMAPAccount gmail +PipelineDepth 200 +Host imap.gmail.com +User kjetil.orbekk@gmail.com +PassCmd "pass show sites/gmail-app-password" +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore gmail-remote +Account gmail + +MaildirStore gmail-local +Path ~/Maildir/ +Inbox ~/Maildir/Inbox + +# Channel sync-gmail-inbox +# Master :gmail-remote:"Inbox" +# Slave :gmail-local:inbox +# Create Slave +# +# Channel sync-gmail-sent +# Master :gmail-remote:"[Gmail]/Sent Mail" +# Slave :gmail-local:sent +# Create Slave +# +# Channel sync-gmail-drafts +# Master :gmail-remote:"[Gmail]/Drafts" +# Slave :gmail-local:drafts +# Create Slave +# +# Channel sync-gmail-trash +# Master :gmail-remote:"[Gmail]/Trash" +# Slave :gmail-local:trash +# Create Slave +# +# Channel sync-gmail-spam +# Master :gmail-remote:"[Gmail]/Spam" +# Slave :gmail-local:spam +# Create Slave +# +# Channel sync-gmail-starred +# Master :gmail-remote:"[Gmail]/Starred" +# Slave :gmail-local:starred +# Create Slave +# +# Channel sync-gmail-archive +# Master :gmail-remote:"[Gmail]/All Mail" +# Slave :gmail-local:archive +# Create Slave +# +# Group gmail +# Channel sync-gmail-inbox +# Channel sync-gmail-sent +# Channel sync-gmail-trash +# Channel sync-gmail-spam +# Channel sync-gmail-starred +# Channel sync-gmail-archive + +Channel gmail +Master :gmail-remote: +Slave :gmail-local: +Patterns INBOX ![Gmail]* "[Gmail]/Sent Mail" "[Gmail]/Starred" "[Gmail]/All Mail" "[Gmail]/Spam" "[Gmail]/Drafts" "[Gmail]/Sent" +Create Both +SyncState * + -- cgit v1.2.3 From 18042c7964935ade45ed8b196f3256df3232b3bf Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Sat, 7 May 2016 10:40:51 -0400 Subject: Update ssh keys --- authorized_keys | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/authorized_keys b/authorized_keys index b730e38..517b71b 100644 --- a/authorized_keys +++ b/authorized_keys @@ -1,15 +1,10 @@ -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA3Y5o6Zm8j7QT2FGAewDCnbHVLR175u1Ze6VMgloH04UOcwBh8a+eXEy1kKpLLzso5ml/NwylrJkmgv4lqv3oRlfSUQHsHSqfg+RkXIy4ZOJGhvCNBYgww5jPvTnsVka2BQvQwvi4QqSi1mDvOaYohmVJRy7cCywuPSoSZcT3RR2XUJN14VEB+AbYFLM/BY9IJEnqLR3Sf2wcGET0z/PMyhGDv9y1f/FjW1+nXsPbfL3vOwLzNME4QS0ZDp0a+snStDSkRAt5Ovhnt/zdr4UbQF7Ejw1PInYYTupmC3xS4BIrq4A83VZuV8edTA1KMlvFZyxqySsQt+BJa6FkPLhlZw== orbekk@52f5e8c3-6815-cce3-9d6d-fffd8d7aa669 -ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCg94vmi4gnHPtRYiyEM66SddH5PHu2XFqob+bY/sD/Zoh7Lw7oWbm8DnztJ8gt8TZci4lgOuVyZxtikoXWlUF7SHUS+9WRs/PK09FOMURsq1d/eXN8Hg6vyOBgMxlWTrJusxG+eDu/52n4Baov47LVn2nkrAH0Z+VvuK4kvtIU0+4Q19Af4tYlQ3B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SuzLg7BVMWSR5gaR3azc3QRCJGWIRp0eWp0dnBGegGbkptogazDKdnL/Gjlb6QFHwxbOqeorg56kWGElRAdGrrtn67zkd91alqqRgXG8pDtqIVtApLrVD+f+C91ePJuTA7khDHVFyv+uf1BaP7wVb6eHPzI7IGpy68PXIA+KeRiJokDTyfxQPYahfF5ELU3D9SvAeaBFJEL4fX/ve8fPcaWBS50JTVObfatopt5aiACWAIyJlz0xWSpP+6trBZjAdq/Ml8aDgPw== orbekk@horisont -ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAuKJClOU52i5NLvGPMs1r4Z5hIqXYe33MGHtH+xenDtM9zL8qEgUF8FtyFSdWnanpUx2KRZUleNLDHz7twn05QJx3iWoTpaZOF9+//JeR7gzJBGVE1m9XjQmsbnKtPgGp1zUcGF9MFyVIo4iMomu6KxnhRWbH/8sh5gu/24WTJMqvYlKemkmOUTFti8on4NdZVB0YTXRK2FKMgtOBrSmZZhccunKRevwiJd3l41CbZGlTqEJocrJVfmeTp7T+LjbagmUxJI47KtBjkmF1zp6yhfeGneesfMHBlAO0iR3xD5nDoT6g1LpTcjmGjuBx/au0gul8AyvOeapSfLa3pUfSiw== orbekk@minecraft ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCy8BTlFTQldQh/mibrVvJUHutDrOObqE5hIdDl79GqI1DDjr5kvAAdlyjpDrxyD55uWt/V3KJAlWdHV7tHMFHOjyRZWdQ6cDox4WYMghJZ1pJMi/1uGgQM4SMWJiEUUqdx/JqDOti4gNDA0giPP/ZWp7/zpzFJV7x1t7HeUr49cIVkAngEftEtzTexbCzeC8BOYWZ1Mln/z+oCVdRDdmhSqfTFD1YuIdZJ7RFNDKktuKBpXmhq7IrccO9L0+vOMVsmf1Se1xb4oDiDod4Ha9CHvRsAYksw6077A68tlFYwCN/EqAcWabSLza4+ynj45K9nDp/4HVtD0RlYLdl205ad orbekk@orbekk2.nyc.corp.google.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABA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W9H9MvSAOePCQFY6fP3S5+0enSPDb9Q4X4NhdLhBvOljH/Q9RhAvSReaeDBu1hEpOj3gwDpPpoC4amP4Geaq5S3bYlslV9HsOCdQHNmvLqLVruX+XhOhq7fUmqoir7jycuuM6UORhP orbekk@sabaki ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqifNkGvOBJcreOBBiwmjdS+ZEwA2P6/wQmhz8+r/7khsy9VtoWBYXCq2Z3fUDL2oqylubH49BlcGi/syE/S75jIg6ab+gGMaTu7Z+DzWestRhkNijFpFZF/NAgL1FvQpW1GdTWhjuWf+kLz8O7WqajwwdoHkktzIe54yrzM5e8B4xHTtcPs4+MsPDAwN3ROwU4Q8/HHUqlqugq7XQr95a5cg4HoGgtZHF9VxkmFLULL2AUvB+lH4SAVJf4dTCYney73eFEcO/PZKjhkAvwcRu3X3vxMMp6goF1rRw6H4EWrnoDwNk596NREtr2HEFxlidinNlSkJLBCodHO0Fz/Rl orbekk@dragon +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC++iDFF7M0kdOzkLpoxodQ/UOq6ez4lQ81jxbxMhRV8OEgqWoM6ONGmrdDXROvcQ0FwiNxTja/UTuxp/wutUOXDlIqi+SxnsyyHYBDBw1dO2IeNI1fVpkA1f5ctVWrgi7ek6MwHYFoAebBlzZpjPezX++i3kspSvtOrV/fDXP4YuIYl1c7rt/qWscNHks5bqbthSmqQZtyEXuy3uA/w4Ji7UZGyxfx2JCAT1tLwKWIuwtggM/aK800Sb2dGgorQpx/iFQXj48Cg3qaUhXaaajilEo4LpRZDuKZa7xlNZtTzuLjF4Rk6HP5T7BiXhhuCsI0Whern+F/kW3RseElHkGt orbekk@aji # Thinkpad X220T -- cgit v1.2.3 From 70b1da4332a9f0b3df3eed63708c6386724a11d1 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 11 May 2016 09:50:06 -0400 Subject: sync-keys: Update managed host list. --- bin/kj-sync-keys.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/kj-sync-keys.sh b/bin/kj-sync-keys.sh index 1a3c455..47426f9 100755 --- a/bin/kj-sync-keys.sh +++ b/bin/kj-sync-keys.sh @@ -12,9 +12,8 @@ declare -r tmpdir=$(mktemp -d /tmp/kj_sync_authorized_keys.XXXXX) targets=( root@orbekk.osl.trygveandre.net - tesuji.6.orbekk.com - sabaki.6.orbekk.com - dragon.6.orbekk.com + sabaki.kk.orbekk.com + dragon.kk.orbekk.com login.pvv.ntnu.no gote.orbekk.com ) -- cgit v1.2.3 From 6f4e3136db7b5fb80f84abff16837d78a0319a01 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 11 May 2016 09:53:07 -0400 Subject: Add new google host. --- authorized_keys | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authorized_keys b/authorized_keys index 517b71b..017726d 100644 --- a/authorized_keys +++ b/authorized_keys @@ -7,4 +7,4 @@ ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSUuOxOtrv60A/jRZhCdfgoB5A1qNy4awBFwNcLTmS ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCve6ZJuqTqRXvqHnYkS6BAilc9Mmdcd8bXHLmI/5T0h59oHGbY35L+OmWLKLJwbkNkMLfsGz5ahCDmW04tf7yQdZ0LCfEpxoeLWHo24j866ZnlsJXnTzj0bjZZcbbr3NqtKPs8YeNAxX9lGB7MyH8j3njBKv+6rTcKJusnueIf/xTScTBLvFbaUPQjVYmQ8trdZtHqElfPAZW9H9MvSAOePCQFY6fP3S5+0enSPDb9Q4X4NhdLhBvOljH/Q9RhAvSReaeDBu1hEpOj3gwDpPpoC4amP4Geaq5S3bYlslV9HsOCdQHNmvLqLVruX+XhOhq7fUmqoir7jycuuM6UORhP orbekk@sabaki ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCqifNkGvOBJcreOBBiwmjdS+ZEwA2P6/wQmhz8+r/7khsy9VtoWBYXCq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bekk.fra.corp.google.com -- cgit v1.2.3 From 6aa10f9bb6e2bebb39ad67ac7a0748b2b923eb8a Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 13 May 2016 13:04:38 -0400 Subject: Add fish configuration. --- bin/kj-setup.sh | 12 ++- config/fish/config.fish | 1 + config/fish/functions/__format_time.fish | 27 ++++++ config/fish/functions/__parse_current_folder.fish | 3 + config/fish/functions/__parse_git_branch.fish | 4 + config/fish/functions/fish_prompt.fish | 110 ++++++++++++++++++++++ config/fish/functions/insert_cmd.fish | 3 + 7 files changed, 155 insertions(+), 5 deletions(-) create mode 100644 config/fish/config.fish create mode 100644 config/fish/functions/__format_time.fish create mode 100644 config/fish/functions/__parse_current_folder.fish create mode 100644 config/fish/functions/__parse_git_branch.fish create mode 100644 config/fish/functions/fish_prompt.fish create mode 100644 config/fish/functions/insert_cmd.fish diff --git a/bin/kj-setup.sh b/bin/kj-setup.sh index a5a91ad..2ce62bf 100755 --- a/bin/kj-setup.sh +++ b/bin/kj-setup.sh @@ -56,11 +56,13 @@ for binary in dotfiles/bin/*; do create_symlink "../dotfiles/bin/${binary}" "bin/${binary}" done -if [[ "${SHELL}" = *zsh* ]]; then - create_symlink dotfiles/zshrc .zshrc -else - printf "${orange}[SKIPPED]${none} shell is not zsh :-(.\n" -fi +mkdir -p .config/fish/functions +create_symlink ../../dotfiles/config/fish/config.fish .config/fish/config.fish +for f in dotfiles/config/fish/functions/*.fish; do + create_symlink ../../../$f .config/fish/functions/$(basename $f) +done + +create_symlink dotfiles/zshrc .zshrc mkdir -p .ssh create_symlink ../dotfiles/ssh/config .ssh/config diff --git a/config/fish/config.fish b/config/fish/config.fish new file mode 100644 index 0000000..a02b905 --- /dev/null +++ b/config/fish/config.fish @@ -0,0 +1 @@ +bind \ec insert_cmd diff --git a/config/fish/functions/__format_time.fish b/config/fish/functions/__format_time.fish new file mode 100644 index 0000000..298e4cb --- /dev/null +++ b/config/fish/functions/__format_time.fish @@ -0,0 +1,27 @@ +function __format_time -d "Format milliseconds to a human readable format" + set -l milliseconds $argv[1] + set -l seconds (math "$milliseconds / 1000 % 60") + set -l minutes (math "$milliseconds / 60000 % 60") + set -l hours (math "$milliseconds / 3600000 % 24") + set -l days (math "$milliseconds / 86400000") + set -l time + set -l threshold 5 + + if test $days -gt 0 + set time (command printf "$time%sd " $days) + end + + if test $hours -gt 0 + set time (command printf "$time%sh " $hours) + end + + if test $minutes -gt 0 + set time (command printf "$time%sm " $minutes) + end + + if test $seconds -gt $threshold + set time (command printf "$time%ss " $seconds) + end + + echo -e $time +end diff --git a/config/fish/functions/__parse_current_folder.fish b/config/fish/functions/__parse_current_folder.fish new file mode 100644 index 0000000..031b53e --- /dev/null +++ b/config/fish/functions/__parse_current_folder.fish @@ -0,0 +1,3 @@ +function __parse_current_folder -d "Replace '$HOME' with '~'" + pwd | sed "s|$HOME|~|" +end diff --git a/config/fish/functions/__parse_git_branch.fish b/config/fish/functions/__parse_git_branch.fish new file mode 100644 index 0000000..42b46fb --- /dev/null +++ b/config/fish/functions/__parse_git_branch.fish @@ -0,0 +1,4 @@ +function __parse_git_branch -d "Parse current Git branch name" + command git symbolic-ref --short HEAD ^/dev/null; + or command git show-ref --head -s --abbrev | head -n1 ^/dev/null +end diff --git a/config/fish/functions/fish_prompt.fish b/config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..c45066c --- /dev/null +++ b/config/fish/functions/fish_prompt.fish @@ -0,0 +1,110 @@ +# vim: set ft=sh: + +# Pure +# by Rafael Rinaldi +# https://github.com/rafaelrinaldi/pure +# MIT License + +# Whether or not is a fresh session +set -g fresh_session 1 + +# Symbols + +set -g symbol_prompt "❯" +set -g symbol_git_down_arrow "⇣" +set -g symbol_git_up_arrow "⇡" +set -g symbol_git_dirty "*" +set -g symbol_horizontal_bar "—" + +# Colors + +set -g color_red (set_color red) +set -g color_green (set_color green) +set -g color_blue (set_color blue) +set -g color_yellow (set_color yellow) +set -g color_cyan (set_color cyan) +set -g color_gray (set_color 93A1A1) +set -g color_normal (set_color normal) + +function fish_prompt + # Save previous exit code + set -l exit_code $status + + # Set default color symbol to green meaning it's all good! + set -l color_symbol $color_green + + # Template + + set -l current_folder (__parse_current_folder) + set -l git_branch_name "" + set -l git_dirty "" + set -l git_arrows "" + set -l command_duration "" + set -l prompt "" + + # Do not add a line break to a brand new session + if test $fresh_session -eq 0 + set prompt $prompt "\n" + end + + # Prompt failed command execution duration + set command_duration (__format_time $CMD_DURATION) + + # Format current folder on prompt output + set prompt $prompt "$color_yellow$command_duration$color_blue$current_folder$color_normal " + + # Handle previous failed command + if test $exit_code -ne 0 + # Symbol color is red when previous command fails + set color_symbol $color_red + + set prompt $prompt "$color_yellow$command_duration$color_normal" + end + + # Exit with code 1 if git is not available + if not which git >/dev/null + return 1 + end + + # Check if is on a Git repository + set -l is_git_repository (command git rev-parse --is-inside-work-tree ^/dev/null) + + if test -n "$is_git_repository" + set git_branch_name (__parse_git_branch) + + # Check if there are files to commit + set -l is_git_dirty (command git status --porcelain --ignore-submodules ^/dev/null) + + if test -n "$is_git_dirty" + set git_dirty $symbol_git_dirty + end + + # Check if there is an upstream configured + command git rev-parse --abbrev-ref '@{upstream}' >/dev/null ^&1; and set -l has_upstream + if set -q has_upstream + set -l git_status (command git rev-list --left-right --count 'HEAD...@{upstream}' | sed "s/[[:blank:]]/ /" ^/dev/null) + + # Resolve Git arrows by treating `git_status` as an array + set -l git_arrow_left (command echo $git_status | cut -c 1 ^/dev/null) + set -l git_arrow_right (command echo $git_status | cut -c 3 ^/dev/null) + + # If arrow is not "0", it means it's dirty + if test $git_arrow_left -ne "0" + set git_arrows $symbol_git_up_arrow + end + + if test $git_arrow_right -ne "0" + set git_arrows $git_arrows$symbol_git_down_arrow + end + end + + # Format Git prompt output + set prompt $prompt "$color_gray$git_branch_name$git_dirty$color_normal\t$color_cyan$git_arrows$color_normal" + end + + set prompt $prompt "\n$color_symbol$symbol_prompt$color_normal " + + echo -e -s $prompt + + set fresh_session 0 +end diff --git a/config/fish/functions/insert_cmd.fish b/config/fish/functions/insert_cmd.fish new file mode 100644 index 0000000..b167734 --- /dev/null +++ b/config/fish/functions/insert_cmd.fish @@ -0,0 +1,3 @@ +function insert_cmd + commandline -i (pwd) +end -- cgit v1.2.3 From 1bbc36cf5f8752250523d131583fb82db5f24e69 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 13 May 2016 17:20:21 +0000 Subject: Change shebang in bash scripts. --- bin/askpass.sh | 2 +- bin/brightness.sh | 2 +- bin/dmenu_run.sh | 2 +- bin/kj-publish.sh | 2 +- bin/kj-setup.sh | 2 +- bin/kj-sync-keys.sh | 2 +- bin/pb | 2 +- bin/play-kj | 2 +- bin/play-yt | 2 +- bin/tag | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/askpass.sh b/bin/askpass.sh index d4b2566..a6727b1 100755 --- a/bin/askpass.sh +++ b/bin/askpass.sh @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash pass show machine/$(hostname) diff --git a/bin/brightness.sh b/bin/brightness.sh index 7a2107d..5cedc62 100755 --- a/bin/brightness.sh +++ b/bin/brightness.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash readonly XBACKLIGHT=xbacklight current_level=$($XBACKLIGHT) diff --git a/bin/dmenu_run.sh b/bin/dmenu_run.sh index 9255d07..affa2af 100755 --- a/bin/dmenu_run.sh +++ b/bin/dmenu_run.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash PATH=$HOME/dotfiles/bin:$HOME/bin:$PATH dmenu_run -fn -*-*-*-*-*-*-20-*-*-*-*-*-*-* "$@" diff --git a/bin/kj-publish.sh b/bin/kj-publish.sh index c3e277b..867f5ba 100755 --- a/bin/kj-publish.sh +++ b/bin/kj-publish.sh @@ -1,3 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash ssh orbekk@tesuji.6.orbekk.com ./build/org-publisher/publish.sh diff --git a/bin/kj-setup.sh b/bin/kj-setup.sh index 2ce62bf..aedc0f9 100755 --- a/bin/kj-setup.sh +++ b/bin/kj-setup.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash red='\e[0;31m' orange='\e[0;33m' diff --git a/bin/kj-sync-keys.sh b/bin/kj-sync-keys.sh index 47426f9..64c3ca9 100755 --- a/bin/kj-sync-keys.sh +++ b/bin/kj-sync-keys.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # # This script syncs authorized keys (found in the $authorized_keys_file below) # to a list of remote hosts. It does not touch existing keys unless overwrite diff --git a/bin/pb b/bin/pb index 2145552..21b9021 100755 --- a/bin/pb +++ b/bin/pb @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash curl -F c=@- https://ptpb.pw/ diff --git a/bin/play-kj b/bin/play-kj index a74ed96..3d3e192 100755 --- a/bin/play-kj +++ b/bin/play-kj @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash livestreamer "$(xclip -selection clipboard -out)" best \ No newline at end of file diff --git a/bin/play-yt b/bin/play-yt index cca0628..2830354 100755 --- a/bin/play-yt +++ b/bin/play-yt @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash rm /tmp/youtube.* youtube-dl -o /tmp/youtube "$@" & diff --git a/bin/tag b/bin/tag index 067e6e6..a95d525 100755 --- a/bin/tag +++ b/bin/tag @@ -1,2 +1,2 @@ -#!/bin/bash +#!/usr/bin/env bash awk '/TAG/ {tag++; sub("TAG", tag);} { print };' -- cgit v1.2.3 From 26e338a9aed83229eb0e18cc597d51f09dd07cf3 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Fri, 13 May 2016 13:27:29 -0400 Subject: Add exports to fish config. --- config/fish/config.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/fish/config.fish b/config/fish/config.fish index a02b905..133c26a 100644 --- a/config/fish/config.fish +++ b/config/fish/config.fish @@ -1 +1,6 @@ bind \ec insert_cmd + +set -x EDITOR vim +set -x TZ 'America/New_York' +set -x PATH "$HOME/bin" $PATH + -- cgit v1.2.3