From b106c6184741409a2fdd697ccd3ff520e1f44046 Mon Sep 17 00:00:00 2001 From: Molly Miller Date: Sun, 17 Jan 2021 21:44:17 +0000 Subject: libkookie: i3: remove tr(1) from i3 workspace scripts, use jq -r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit >From jq(1): o --raw-output / -r: With this option, if the filterĀ“s result is a string then it will be written directly to standard output rather than being formatted as a JSON string with quotes. This can be useful for making jq filters talk to non-JSON-based systems. --- infra/libkookie/modules/workstation/ui/i3/core/tools/i3-move.nix | 4 ++-- infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'infra/libkookie/modules/workstation') diff --git a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-move.nix b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-move.nix index bb724d88bbe0..94f92149adf8 100644 --- a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-move.nix +++ b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-move.nix @@ -7,8 +7,8 @@ { pkgs, ... }: with pkgs; writeShellScript "libkookie-i3-move" '' WS=$(${i3}/bin/i3-msg -t get_workspaces | \ - ${jq}/bin/jq -M '.[] | .name' | tr -d '"' \ - | sort -u | ${dmenu}/bin/dmenu -b -i "$@") + ${jq}/bin/jq -r -M '.[] | .name' | sort -u | \ + ${dmenu}/bin/dmenu -b -i "$@") ${i3}/bin/i3-msg -t command move workspace $WS diff --git a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix index 691e9470db83..4e1cd4dd53af 100644 --- a/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix +++ b/infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix @@ -8,8 +8,8 @@ { pkgs, ... }: with pkgs; writeShellScript "libkookie-i3-switch" '' WS=$(${i3}/bin/i3-msg -t get_workspaces | \ - ${jq}/bin/jq -M '.[] | .name' | tr -d '"' \ - | sort -u | ${dmenu}/bin/dmenu -b -i "$@") + ${jq}/bin/jq -r -M '.[] | .name' | sort -u | \ + ${dmenu}/bin/dmenu -b -i "$@") ${i3}/bin/i3-msg workspace $WS '' -- cgit v1.2.3