Clipedit command

This commit is contained in:
Filippo Berto 2022-10-08 12:24:38 +02:00
parent 6328f14438
commit d70b3cd44a
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
5 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,12 @@
{ writeShellScriptBin, lib, xclip, coreutils, terminal-command ? "kitty sh -c", editor-command ? "hx" }:
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
writeShellScriptBin "clipedit" ''
PATH=$PATH:"${lib.makeBinPath [ coreutils xclip ]}"
tmp_file=$(mktemp)
xclip -out -selection -clipboard > $tmp_file
${terminal-command} "${editor-command} $tmp_file"
xclip -in -selection clipboard < $tmp_file
rm $tmp_file
''

View file

@ -2,6 +2,7 @@
let
self = with pkgs; {
clipedit = callPackage ./clipedit { };
cocktail-bar-cli = callPackage ./cocktail-bar-cli { };
lockscreen = callPackage ./lockscreen { };
sddm-theme-clairvoyance = callPackage ./sddm-theme-clairvoyance { };

View file

@ -12,7 +12,6 @@
}:
let strPalette = lib.rice.palette.toRGBAHex palette;
in writeScriptBin "lockscreen" ''
#!/bin/sh
# Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \
--insidever-color="${strPalette.normal.green}" \

View file

@ -62,6 +62,8 @@
# Flakes packages
(final: _: {
inherit (tex2nix.packages.${system}) tex2nix;
clipedit = final.callPackage ./custom/clipedit { };
update-background = final.callPackage ./custom/update-background {
backgrounds_directory = "$HOME/Immagini/Sfondi/1080+/1440+";
};

View file

@ -11,6 +11,7 @@
unstable.kitty
update-background
xorg.xbacklight
clipedit
];
services.sxhkd =
let
@ -42,6 +43,7 @@
"super + ctrl + shift + space" = "bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel";
"super + ctrl + space" = "bspc node -p cancel";
"super + e" = fileManager;
"super + shift + p" = "clipedit";
"super + Escape" = "pkill -USR1 -x sxhkd";
"super + g" = "bspc node -s biggest";
"super + {grave,Tab}" = "bspc {node,desktop} -f last";