From 8a58a696d7ee89129985e6bff1e7301ed87d22d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Av=C3=A9?= <email@thomasave.be>
Date: Sat, 19 Nov 2022 15:08:26 +0100
Subject: [PATCH] Icon for calc mode

---
 nvim/lua/telescope_config.lua | 5 +++--
 rofi/show-calculator.sh       | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/nvim/lua/telescope_config.lua b/nvim/lua/telescope_config.lua
index b809ff1..e086df5 100644
--- a/nvim/lua/telescope_config.lua
+++ b/nvim/lua/telescope_config.lua
@@ -6,8 +6,9 @@ M.project_files = function()
     local opts = require('telescope.themes').get_ivy({}) -- define here if you want to define something
     opts["show_untracked"] = true
     opts["layout_config"] = {height=0.2}
-    local ok = pcall(require"telescope.builtin".git_files, opts)
-    if not ok then require"telescope.builtin".find_files(opts) end
+    if not pcall(require"telescope.builtin".git_files, opts) then
+        require"telescope.builtin".find_files(opts)
+    end
 end
 
 M.buffers = function()
diff --git a/rofi/show-calculator.sh b/rofi/show-calculator.sh
index 3704cbb..bad44f8 100755
--- a/rofi/show-calculator.sh
+++ b/rofi/show-calculator.sh
@@ -1,10 +1,10 @@
 #!/bin/bash
 
 if [[ -z "$1" ]]; then
-    echo "Calc Mode"
+    echo -e "Calc Mode\0icon\x1fgnome-calculator"
 
 else
 	killall rofi
     # so rofi doesn't complain "can't launch rofi inside rofi"
-	rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '{result}' | xsel -i"
+	rofi -show calc -modi calc -no-show-match -no-sort -calc-command "echo -n '{result}' | xsel --clipboard"
 fi