From 71a1d484a9150fe53be03ba4f56eda4e13398bef Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 26 Feb 2018 17:44:32 +0100 Subject: [PATCH 1/3] move mail password into pass --- mutt/.mutt/creds | 2 +- mutt/.mutt/yorick_pass.gpg | Bin 357 -> 0 bytes 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 mutt/.mutt/yorick_pass.gpg diff --git a/mutt/.mutt/creds b/mutt/.mutt/creds index 605bd62..591949f 100644 --- a/mutt/.mutt/creds +++ b/mutt/.mutt/creds @@ -1,4 +1,4 @@ -set my_pass = "`gpg -q --no-tty --batch -d ~/.mutt/yorick_pass.gpg`"" +set my_pass = "`pass sysadmin/yori.ccMail | head -n1`" set spoolfile = "imaps://yorick:$my_pass@pennyworth.yori.cc/INBOX" set realname = "Yorick van Pelt" set from = "Yorick van Pelt " diff --git a/mutt/.mutt/yorick_pass.gpg b/mutt/.mutt/yorick_pass.gpg deleted file mode 100644 index 6489a66acc4f7179ccf11ed8eff4bd2cfa6ced3c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 357 zcmV-r0h<1W0Sp5H0FIVll>XcS2mex6@LU-b1u4AwMK$|YP$J~Sn&|xCH6~fs(*3`t zjv11(9U1#DTpvqYeF`BFmO2HA%BeNDn|MX#$Y;=*@m?gC2dAG=9b>YB0oCw-T}4Je zcb`z>l8sqM96O^n$(-kBko_?1cPCy2lw`w&eTat=4ne|UF%%o#L1E-t=EQAU5Rp<< zW*+T&)6cd%LE<{&Q(<*Fy&YWWIWczqIgMU1I4pveuBTcU{NOir( zp7n9hp=YBa*tK|3cA-K4sz4T>ZqP~kYhF~TbLuMP;bmSp`v=UBpoI{w_fowLH1B#0 DDG;ii From b129a221b6b9f13785f846367b5f16006db09416 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Mon, 26 Feb 2018 17:46:28 +0100 Subject: [PATCH 2/3] remove pentadactyl config --- .gitmodules | 3 - install.sh | 2 +- pentadactyl/.pentadactylrc | 29 ------- pentadactyl/.stow-local-ignore | 3 - pentadactyl/external/pentadactyl-solarized | 1 - pentadactyl/plugins/launchv.js | 47 ----------- pentadactyl/user.css | 91 ---------------------- 7 files changed, 1 insertion(+), 175 deletions(-) delete mode 100644 pentadactyl/.pentadactylrc delete mode 100644 pentadactyl/.stow-local-ignore delete mode 160000 pentadactyl/external/pentadactyl-solarized delete mode 100644 pentadactyl/plugins/launchv.js delete mode 100644 pentadactyl/user.css diff --git a/.gitmodules b/.gitmodules index 144bf7f..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "pentadactyl/external/pentadactyl-solarized"] - path = pentadactyl/external/pentadactyl-solarized - url = https://github.com/claytron/pentadactyl-solarized diff --git a/install.sh b/install.sh index 3285af3..381374c 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash #!nix-shell -i bash -p stow -$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix git x pentadactyl gtk gpg mutt misc bash stow +$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix git x gtk gpg mutt misc bash stow nix-build -A $(hostname -s) diff --git a/pentadactyl/.pentadactylrc b/pentadactyl/.pentadactylrc deleted file mode 100644 index 5693662..0000000 --- a/pentadactyl/.pentadactylrc +++ /dev/null @@ -1,29 +0,0 @@ -" vim: set ft=pentadactyl:ts=4:sw=4:tw=0: -set runtimepath=~/dotfiles/pentadactyl,~/dotfiles/pentadactyl/external/pentadactyl-solarized -colorscheme solarized-dark - -set go+=N - -source ~/dotfiles/pentadactyl/user.css - -" feedly: -group -description 'Feedly' -locations=feedly.com feedly -nmap -group feedly gm -nmap -group feedly ga -nmap -group feedly gg -nmap -group feedly gl - -set passkeys+=feedly.com:"r/jknpvmxs" - -" github: -set passkeys+=github.com:"r?jks" - -" reddit: -set passkeys+=reddit.com:"jk[]azp?.srfF" - - -com -d "Delete duplicate tabs" tabcloseduplicates,tabclosed -js let seen={},vtabs=tabs.visibleTabs,i=vtabs.length;while(i--){let loc=vtabs[i].linkedBrowser.contentDocument.location.href||"";if(Object.prototype.hasOwnProperty.call(seen, loc)){config.tabbrowser.removeTab(vtabs[i]);}else{seen[loc]=true;}} - - -" Open the current URL as an argument to mpv. -nmap -e :launchv diff --git a/pentadactyl/.stow-local-ignore b/pentadactyl/.stow-local-ignore deleted file mode 100644 index 6be1705..0000000 --- a/pentadactyl/.stow-local-ignore +++ /dev/null @@ -1,3 +0,0 @@ -external -plugins -user.css diff --git a/pentadactyl/external/pentadactyl-solarized b/pentadactyl/external/pentadactyl-solarized deleted file mode 160000 index bf2d2e5..0000000 --- a/pentadactyl/external/pentadactyl-solarized +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bf2d2e5d65cc97a11f0e2ca4c06d8041652c9fef diff --git a/pentadactyl/plugins/launchv.js b/pentadactyl/plugins/launchv.js deleted file mode 100644 index a6303de..0000000 --- a/pentadactyl/plugins/launchv.js +++ /dev/null @@ -1,47 +0,0 @@ -/* ~/.config/pentadactyl/plugins/launchv.js - - From Earnestly. - - Quick function to help reduce duplication in my config, thanks mostly to - holomorph who started pretty much all of this. - - Requires: livestreamer, mpv, youtube-dl. - - Command: - * :launchv Attempts to start the current buffer URL as a video. - - Hint: - * ;q Likewise but for the selected hint. -*/ - -function launchv(target){ - // Escape anything which could be used to inject shell commands before - // passing it to the commands. - var uri = target.replace(/([$`"\\])/g, "\\$1"); - var mpv = "mpv --loop-file --cache-file=TMP"; - - function exec(launcher, uri){ - // If we're using pentadactyl then echo the action as io.system won't. - if(typeof dactyl !== "undefined") - dactyl.echomsg("Executing: " + launcher + " \"" + uri + "\""); - - return io.system(launcher + ' "' + uri + '" &'); - } - - // Filter certain urls to more appropriate programs - if(uri.match(/twitch\.tv\/.*\/[bc]\/[0-9]+/)) - exec(mpv, uri); - - else if(uri.match(/hitbox\.tv\/video\/[0-9]+/)) - exec(mpv, uri); - - else if(uri.match(/(hitbox|twitch)\.tv/)) - exec("livestreamer", uri); - - // For everything else. - else - exec(mpv, uri); -} - -hints.addMode("q", "Launch video from hint", function(elem, loc) launchv(loc)); -commands.add(["launchv", "lv"], "Launches current buffer video", function(args){launchv(buffer.URL);}); diff --git a/pentadactyl/user.css b/pentadactyl/user.css deleted file mode 100644 index 7a22e46..0000000 --- a/pentadactyl/user.css +++ /dev/null @@ -1,91 +0,0 @@ -/*@-moz-document url-prefix(about:blank) {*{background-color:#002b36;}} */ - -@-moz-document url-prefix("http://www.reddit.com/"), url-prefix("https://www.reddit.com/") { - -body { - /*position: relative;*/ - overflow-y: hidden; -} - -html { - overflow-x: hidden; -} -.content { - z-index: -1 !important; -} -.side { - padding-left: 3px; - padding-bottom: 3px; - border-left: 1px solid rgb(230, 230, 230); - border-bottom: 1px solid rgb(230, 230, 230); - border-bottom-left-radius: 6px; - -} - -body>.content, body { - /* This MUST apply to prevent showing stuff through the side bar */ - position: relative !important; -} - -.res-nightmode .side { - border-left-color: rgb(102, 102, 102); - border-bottom-color: rgb(102, 102, 102); - -} - -.side { - margin-left: 0px !important; - - margin-right: -280px !important; - - z-index: 5; - - - - opacity: 0.6; - transition: opacity 0.5s, margin 0.5s; - - transition-delay: 1s; - - transition-timing-function: ease-in-out; - -} - -.side:hover, .side:focus { - transition: opacity 0.2s, margin 0.2s; - /* Apply a negative margin to the left to prevent the content from - being shuffled around by the side bar */ - margin-left: -280px !important; - margin-right: 0px !important; - opacity: 1; - transition-delay: 0s; - -} - -.content { - margin-right: 40px !important; -} - -} - -@-moz-document url-prefix("https://news.ycombinator.com") { - html,#hnmain { - background-color: #002b36 !important; - } - - #hnmain > tbody > tr:first-child > td { - background-color: #073642 !important; - } - - * { - color: #839496 !important; - font-family: "Source Code Pro"; - font-weight: 9pt; - } - - textarea,input { - background-color: #002b36 !important; - color: #839496; - border: 1pt solid #586e75; - } -} From ddd85115398fd47e7eaf76741e2e93582d52c1a1 Mon Sep 17 00:00:00 2001 From: Yorick van Pelt Date: Sat, 10 Mar 2018 17:39:29 +0100 Subject: [PATCH 3/3] update dotfiles --- emacs/emacs.org | 5 + git/.gitconfig | 2 + gpg/.gnupg/gpg-agent.conf | 1 + i3/i3.nix | 4 +- install.sh | 2 +- misc/.ssh/config | 10 ++ nix/.config/nixpkgs/overlays/02-extrapkgs.nix | 11 +- nix/.config/nixpkgs/overlays/05-envs.nix | 21 ++- nix/.config/nixpkgs/pkgs/ftb.nix | 4 +- rofi/.config/rofi/config.rasi | 136 ++++++++++++++++++ rofi/.config/rofi/rofi-pass | 92 ++++++++++++ 11 files changed, 264 insertions(+), 24 deletions(-) create mode 100644 rofi/.config/rofi/config.rasi create mode 100644 rofi/.config/rofi/rofi-pass diff --git a/emacs/emacs.org b/emacs/emacs.org index f890925..ee8902c 100644 --- a/emacs/emacs.org +++ b/emacs/emacs.org @@ -165,6 +165,11 @@ (put 'sfp-page-up 'isearch-scroll t) (put 'sfp-page-up 'CUA 'move) (setq scroll-error-top-bottom t) +#+END_SRC +** fix c-z +#+BEGIN_SRC emacs-lisp +(global-unset-key (kbd "C-z")) + #+END_SRC ** Ivy #+BEGIN_SRC emacs-lisp diff --git a/git/.gitconfig b/git/.gitconfig index 418df8d..fc37b7a 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -23,3 +23,5 @@ signingkey = A36E70F9DC014A15 [help] autocorrect = 5 +[includeIf "gitdir:~/serokell/"] +path=~/serokell/.gitconfig diff --git a/gpg/.gnupg/gpg-agent.conf b/gpg/.gnupg/gpg-agent.conf index 85405bc..5e8a57c 100644 --- a/gpg/.gnupg/gpg-agent.conf +++ b/gpg/.gnupg/gpg-agent.conf @@ -1 +1,2 @@ enable-ssh-support +extra-socket /home/yorick/.gnupg/S.gpg-agent.extra diff --git a/i3/i3.nix b/i3/i3.nix index e2af6ec..b24bbef 100644 --- a/i3/i3.nix +++ b/i3/i3.nix @@ -1,7 +1,7 @@ {writeTextDir, writeScript, lib, rofi, xss-lock, nitrogen, compton-git, i3status, i3-gaps ,i3lock-color, xset, alsaUtils, light, screenshot_public, xorg, libinput-gestures, -haskellPackages, polybar, procps, +haskellPackages, polybar, procps, rofi-pass, with_lock ? true, compton_name ? "default"}: let @@ -185,7 +185,7 @@ bindsym XF86AudioRaiseVolume exec ${alsaUtils}/bin/amixer set Master 1%+ bindsym XF86AudioMute exec ${alsaUtils}/bin/amixer set Master toggle bindsym $mod+Shift+s exec --no-startup-id ${screenshot_public}/bin/screenshot_public bindsym Print exec --no-startup-id ${screenshot_public}/bin/screenshot_public -bindsym $mod+p exec --no-startup-id passmenu +bindsym $mod+p exec --no-startup-id ${rofi-pass}/bin/rofi-pass workspace_auto_back_and_forth yes hide_edge_borders smart diff --git a/install.sh b/install.sh index 381374c..836b31f 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash #!nix-shell -i bash -p stow -$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix git x gtk gpg mutt misc bash stow +$(nix-build '' -A stow --no-out-link)/bin/stow -d `dirname $0` -t ~ nix git x gtk gpg mutt misc bash stow rofi nix-build -A $(hostname -s) diff --git a/misc/.ssh/config b/misc/.ssh/config index d82916b..b47b847 100644 --- a/misc/.ssh/config +++ b/misc/.ssh/config @@ -39,3 +39,13 @@ Host asc_wh hostname 192.168.1.4 ProxyJump yorick@woodhouse.onion +Host skl_deployer + hostname deployer.serokell.team + RemoteForward /home/yorick/.aws/pass-socket /home/yorick/.aws/pass-socket + RemoteForward /home/yorick/.gnupg/S.gpg-agent /home/yorick/.gnupg/S.gpg-agent.extra + ForwardAgent yes +Host skl_deployer_vbox + hostname 192.168.56.101 + ForwardAgent yes + RemoteForward /home/yorick/.aws/pass-socket /home/yorick/.aws/pass-socket + RemoteForward /home/yorick/.gnupg/S.gpg-agent /home/yorick/.gnupg/S.gpg-agent.extra diff --git a/nix/.config/nixpkgs/overlays/02-extrapkgs.nix b/nix/.config/nixpkgs/overlays/02-extrapkgs.nix index 67d317a..fe8de1a 100644 --- a/nix/.config/nixpkgs/overlays/02-extrapkgs.nix +++ b/nix/.config/nixpkgs/overlays/02-extrapkgs.nix @@ -21,18 +21,13 @@ self: super: { ''; }; - weiightminder = super.callPackage (super.fetchgit { + + weiightminder = super.callPackage (builtins.fetchGit { url = https://gist.github.com/yorickvP/229d21a7da13c9c514dbd26147822641; rev = "9749ef4d83c0078bc0248215ee882d7124827cf3"; - sha256 = "0kxi20ss2k22sv3ndplnklc6r7ja0lcgklw6mz43qcj7vmgxxllf"; + #sha256 = "0kxi20ss2k22sv3ndplnklc6r7ja0lcgklw6mz43qcj7vmgxxllf"; }) {}; - node2nix_git = (super.callPackage (super.fetchFromGitHub { - owner = "svanderburg"; - repo = "node2nix"; - rev = "b6545937592e7e54a14a2df315598570480fee9f"; - sha256 = "1y50gs5mk2sdzqx68lr3qb71lh7jp4c38ynybf8ikx7kfkzxvasb"; - }) {}).package; yscripts = super.callPackage /home/yorick/dotfiles/bin {}; } diff --git a/nix/.config/nixpkgs/overlays/05-envs.nix b/nix/.config/nixpkgs/overlays/05-envs.nix index a900ed2..a68adf3 100644 --- a/nix/.config/nixpkgs/overlays/05-envs.nix +++ b/nix/.config/nixpkgs/overlays/05-envs.nix @@ -16,8 +16,7 @@ in { xorg.xrandr pavucontrol light nitrogen - dropbox # really? - # wpa_supplicant_gui + # dropbox # really? xclip siji fira-mono playerctl font-awesome-ttf ]; scripts = mkEnv "y-scripts" [ @@ -26,6 +25,7 @@ in { ]; apps = mkEnv "y-apps" [ + wpa_supplicant_gui gajim neomutt torbrowser @@ -35,14 +35,13 @@ in { tdesktop #hexchat #inkscape - keepassx + #keepassx # libreoffice # skype spotify quasselClient leafpad calibre - wpa_supplicant_gui #py2.plover wireshark meld discord @@ -64,7 +63,7 @@ in { ]; nix = mkEnv "y-nix" [ - patchelf nix nix-prefetch-git nix-repl nixopsUnstable nox + patchelf nixUnstable nix-prefetch-git nixopsUnstable nox ]; c = mkEnv "y-cdev" [ @@ -83,9 +82,9 @@ in { jq jo ]; - code = mkEnv "y-code" [ - python gitAndTools.hub gnumake cloc silver-searcher gitFire gti - ]; + code = mkEnv "y-code" (with gitAndTools; [ + python3 git-crypt hub gnumake cloc silver-searcher gitFire gti gcc + ]); java = openjdk; games = mkEnv "y-games" [ @@ -94,7 +93,7 @@ in { ]; js = mkEnv "y-jsdev" [ - js.jshint nodejs-6_x electron node2nix_git + js.jshint nodejs electron js.node2nix ]; pdf = mkEnv "y-pdf" [ @@ -109,8 +108,8 @@ in { # will remove all your previously installed nix-env stuff # so check with nix-env -q first hosts = with self; with self.envs; { - ascanius = [apps code de games envs.js pdf nix media gcc misc scripts coins]; - jarvis = [apps code de games envs.js pdf nix media gcc misc scripts myEmacs]; + ascanius = [apps code de games envs.js pdf nix media misc scripts coins myEmacs]; + jarvis = [apps code de games envs.js pdf nix media misc scripts myEmacs]; woodhouse = [de media misc kodi chromium spotify]; pennyworth = []; frumar = [bup gitAndTools.git-annex rtorrent pyroscope]; diff --git a/nix/.config/nixpkgs/pkgs/ftb.nix b/nix/.config/nixpkgs/pkgs/ftb.nix index 632f72e..d76f3e6 100644 --- a/nix/.config/nixpkgs/pkgs/ftb.nix +++ b/nix/.config/nixpkgs/pkgs/ftb.nix @@ -9,7 +9,7 @@ in name = "ftb-1.4.14"; src = fetchurl { url = "http://ftb.cursecdn.com/FTB2/launcher/FTB_Launcher.jar"; - sha256 = "1m2kyvq4fknr3ric5wwg55qzjqhpkjaq9zragsvippibg78w9hy4"; + sha256 = "10ga4jgyfsj5dy4rj2rla0fpnfpnxv8r3bmxpqpwn7fsry4il79v"; }; phases = "installPhase"; @@ -32,4 +32,4 @@ in homepage = http://www.feed-the-beast.com; license = stdenv.lib.licenses.unfreeRedistributable; }; -} \ No newline at end of file +} diff --git a/rofi/.config/rofi/config.rasi b/rofi/.config/rofi/config.rasi new file mode 100644 index 0000000..1bd0075 --- /dev/null +++ b/rofi/.config/rofi/config.rasi @@ -0,0 +1,136 @@ +configuration { + modi: "window,run,ssh,drun"; +/* width: 50;*/ +/* lines: 15;*/ +/* columns: 1;*/ + font: "Source Code Pro 12"; +/* bw: 1;*/ +/* location: 0;*/ +/* padding: 5;*/ +/* yoffset: 0;*/ +/* xoffset: 0;*/ +/* fixed-num-lines: true;*/ +/* show-icons: false;*/ +/* terminal: "rofi-sensible-terminal";*/ +/* ssh-client: "ssh";*/ +/* ssh-command: "{terminal} -e {ssh-client} {host}";*/ +/* run-command: "{cmd}";*/ +/* run-list-command: "";*/ +/* run-shell-command: "{terminal} -e {cmd}";*/ +/* window-command: "xkill -id {window}";*/ +/* drun-icon-theme: ;*/ +/* disable-history: false;*/ +/* sort: false;*/ +/* levenshtein-sort: false;*/ +/* case-sensitive: false;*/ +/* cycle: true;*/ +/* sidebar-mode: false;*/ +/* eh: 1;*/ +/* auto-select: false;*/ +/* parse-hosts: false;*/ +/* parse-known-hosts: true;*/ +/* combi-modi: "window,run";*/ +/* matching: "normal";*/ +/* tokenize: true;*/ +/* m: "-5";*/ +/* line-margin: 2;*/ +/* line-padding: 1;*/ +/* filter: ;*/ +/* separator-style: "dash";*/ +/* hide-scrollbar: false;*/ +/* fullscreen: false;*/ +/* fake-transparency: false;*/ + dpi: 109; +/* threads: 0;*/ +/* scrollbar-width: 8;*/ +/* scroll-method: 0;*/ +/* fake-background: "screenshot";*/ +/* window-format: "{w} {i}{c} {t}";*/ +/* click-to-exit: true;*/ +/* show-match: true;*/ + theme: "solarized_alternate"; +/* color-normal: ;*/ +/* color-urgent: ;*/ +/* color-active: ;*/ +/* color-window: ;*/ +/* plugin-path: "/nix/store/21jzqk1r0ni4dwjr6icq5w7kginmg61y-rofi-1.4.2/lib/rofi";*/ +/* pid: "/run/user/1000/rofi.pid";*/ +/* display-window: ;*/ +/* display-windowcd: ;*/ +/* display-run: ;*/ +/* display-ssh: ;*/ +/* display-drun: ;*/ +/* display-combi: ;*/ +/* display-keys: ;*/ +/* kb-primary-paste: "Control+V,Shift+Insert";*/ +/* kb-secondary-paste: "Control+v,Insert";*/ +/* kb-clear-line: "Control+w";*/ +/* kb-move-front: "Control+a";*/ +/* kb-move-end: "Control+e";*/ +/* kb-move-word-back: "Alt+b";*/ +/* kb-move-word-forward: "Alt+f";*/ +/* kb-move-char-back: "Left,Control+b";*/ +/* kb-move-char-forward: "Right,Control+f";*/ +/* kb-remove-word-back: "Control+Alt+h,Control+BackSpace";*/ +/* kb-remove-word-forward: "Control+Alt+d";*/ +/* kb-remove-char-forward: "Delete,Control+d";*/ +/* kb-remove-char-back: "BackSpace,Control+h";*/ +/* kb-remove-to-eol: "Control+k";*/ +/* kb-remove-to-sol: "Control+u";*/ +/* kb-accept-entry: "Control+j,Control+m,Return,KP_Enter";*/ +/* kb-accept-custom: "Control+Return";*/ +/* kb-accept-alt: "Shift+Return";*/ +/* kb-delete-entry: "Shift+Delete";*/ +/* kb-mode-next: "Shift+Right,Control+Tab";*/ +/* kb-mode-previous: "Shift+Left,Control+ISO_Left_Tab";*/ +/* kb-row-left: "Control+Page_Up";*/ +/* kb-row-right: "Control+Page_Down";*/ +/* kb-row-up: "Up,Control+p,ISO_Left_Tab";*/ +/* kb-row-down: "Down,Control+n";*/ +/* kb-row-tab: "Tab";*/ +/* kb-page-prev: "Page_Up";*/ +/* kb-page-next: "Page_Down";*/ +/* kb-row-first: "Home,KP_Home";*/ +/* kb-row-last: "End,KP_End";*/ +/* kb-row-select: "Control+space";*/ +/* kb-screenshot: "Alt+S";*/ +/* kb-toggle-case-sensitivity: "grave,dead_grave";*/ +/* kb-toggle-sort: "Alt+grave";*/ +/* kb-cancel: "Escape,Control+g,Control+bracketleft";*/ +/* kb-custom-1: "Alt+1";*/ +/* kb-custom-2: "Alt+2";*/ +/* kb-custom-3: "Alt+3";*/ +/* kb-custom-4: "Alt+4";*/ +/* kb-custom-5: "Alt+5";*/ +/* kb-custom-6: "Alt+6";*/ +/* kb-custom-7: "Alt+7";*/ +/* kb-custom-8: "Alt+8";*/ +/* kb-custom-9: "Alt+9";*/ +/* kb-custom-10: "Alt+0";*/ +/* kb-custom-11: "Alt+exclam";*/ +/* kb-custom-12: "Alt+at";*/ +/* kb-custom-13: "Alt+numbersign";*/ +/* kb-custom-14: "Alt+dollar";*/ +/* kb-custom-15: "Alt+percent";*/ +/* kb-custom-16: "Alt+dead_circumflex";*/ +/* kb-custom-17: "Alt+ampersand";*/ +/* kb-custom-18: "Alt+asterisk";*/ +/* kb-custom-19: "Alt+parenleft";*/ +/* kb-select-1: "Super+1";*/ +/* kb-select-2: "Super+2";*/ +/* kb-select-3: "Super+3";*/ +/* kb-select-4: "Super+4";*/ +/* kb-select-5: "Super+5";*/ +/* kb-select-6: "Super+6";*/ +/* kb-select-7: "Super+7";*/ +/* kb-select-8: "Super+8";*/ +/* kb-select-9: "Super+9";*/ +/* kb-select-10: "Super+0";*/ +/* ml-row-left: "Mouse6";*/ +/* ml-row-right: "Mouse7";*/ +/* ml-row-up: "Mouse4";*/ +/* ml-row-down: "Mouse5";*/ +/* me-select-entry: "Mouse1";*/ +/* me-accept-entry: "MouseD1";*/ +/* me-accept-custom: "Control+MouseD1";*/ +} diff --git a/rofi/.config/rofi/rofi-pass b/rofi/.config/rofi/rofi-pass new file mode 100644 index 0000000..0794c0f --- /dev/null +++ b/rofi/.config/rofi/rofi-pass @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +set -e +set -o pipefail + +print-passwords() { + prefix=${PASSWORD_STORE_DIR-~/.password-store} + password_files=( "$prefix"/**/*.gpg ) + password_files=( "${password_files[@]#"$prefix"/}" ) + password_files=( "${password_files[@]%.gpg}" ) + printf '%s\n' "${password_files[@]}" +} + +copy-account-field() { + lpass show --clip "--${2}" "$1" >/dev/null 2>/dev/null +} + +open-account-url() { + local url=$(lpass show --url "$1") + if [[ -n $url ]]; then + xdg-open "$url" >/dev/null 2>/dev/null + else + exit 2 + fi +} + +is-actual-url() { + local url="$1" + if [[ -n $url && "$url" != " " && "$url" != "http://" && "$url" != "https://" ]]; then + return 0 + else + return 1 + fi +} + +show-account-options() { + local id="$1" + + echo ">> Copy password [$id]" + echo ">> Copy username [$id]" + + url=$(lpass show --url "$id") + if is-actual-url "$url"; then + echo ">> Open $url [$id]" + echo ">> Copy URL [$id]" + fi + + echo ">> Copy ID [$id]" +} + +is-entry-selected() { + if [[ -n $@ ]]; then + return 0 + else + return 1 + fi +} + +id-in-selection() { + echo "$1" | grep -oE '\[[0-9]+\]$' | tr -d '[]' +} + +debug() { + echo "$@" > /dev/stderr +} + +if is-entry-selected "$1"; then + selected="$1" + + id="$(id-in-selection "$selected")" + + if [[ -n $id ]]; then + case "$selected" in + '>> Copy password'*) + copy-account-field "$id" password ;; + '>> Copy username'*) + copy-account-field "$id" username ;; + '>> Copy URL'*) + copy-account-field "$id" url ;; + '>> Copy ID'*) + copy-account-field "$id" id ;; + '>> Open'*) + open-account-url "$id" ;; + *) + show-account-options "$id" ;; + esac + else + echo "Could not detect the entry ID of \"${selection}\"" + exit 1 + fi +else + print-passwords +fi