From b40b957fada012ce10e8d46bcaef490f5342dc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leonardo=20Eug=C3=AAnio?= Date: Mon, 5 Sep 2022 18:43:29 -0300 Subject: [PATCH] add color picker --- user/sway.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/user/sway.nix b/user/sway.nix index b30827b..d29eb4d 100644 --- a/user/sway.nix +++ b/user/sway.nix @@ -1,6 +1,14 @@ { config, pkgs, lib, ... }: let inherit (import ./variables.nix) key theme color accent font; + color_picker = pkgs.writeShellScript "color_picker" '' + grim -g "$(slurp -b aabbcc00 -p)" - | + convert - txt:- | + grep -oE '#[0-9A-Fa-f]{6}' | + wl-copy -n + + notify-send "$(wl-paste)" "Copied to clipboard" + ''; pulse_sink = pkgs.writeShellScriptBin "pulse_sink" '' #!/bin/sh output=$(printf "HDMI\nHeadphones" | wdmenu -i -p "Output:") @@ -275,6 +283,7 @@ in { other_binds = { "${mod}+p" = "exec ${pkgs.wpass}/bin/wpass"; "${mod}+s" = "exec ${menu}"; + "${mod}+c" = "exec ${color_picker}"; "${mod}+Return" = "exec ${terminal}"; "${mod}+Ctrl+Return" = "exec thunar"; "${mod}+x" = "kill";