diff options
author | Molly Miller <knmcn@m-squa.red> | 2021-01-17 21:44:17 +0000 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2021-01-18 10:47:57 +0100 |
commit | b106c6184741409a2fdd697ccd3ff520e1f44046 (patch) | |
tree | 69884a284081d870c3f5eea80869b772ace8ecb1 | |
parent | 04ef3374afe22446a1da216b75f47ac3eeaf396e (diff) |
libkookie: i3: remove tr(1) from i3 workspace scripts, use jq -r
>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.
-rw-r--r-- | infra/libkookie/modules/workstation/ui/i3/core/tools/i3-move.nix | 4 | ||||
-rw-r--r-- | infra/libkookie/modules/workstation/ui/i3/core/tools/i3-switch.nix | 4 |
2 files changed, 4 insertions, 4 deletions
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 '' |