From 84b2baf3ef30bfdc3f13bbe1623f34ff72777417 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Fri, 3 Jul 2020 17:31:51 -0500 Subject: [PATCH] a --- common.sh | 4 ++++ dot_config/i3/config | 2 +- run_once_01_cargo_bins.sh | 31 +++++++++++++++++-------------- 3 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 common.sh diff --git a/common.sh b/common.sh new file mode 100644 index 0000000..162f556 --- /dev/null +++ b/common.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Should not be executable, only sourced by other scripts + +command_exists() { command -v ${1} >/dev/null; } diff --git a/dot_config/i3/config b/dot_config/i3/config index fafcf9a..f82f72c 100644 --- a/dot_config/i3/config +++ b/dot_config/i3/config @@ -21,7 +21,7 @@ font pango:Roboto Mono for Powerline 11 #font pango:DejaVu Sans Mono 8 # KEYBOARD SHORTCUTS -bindsym $mod+l exec i3lock-fancy +bindsym $mod+F1 exec i3lock-fancy bindsym Print exec $HOME/.local/scripts/screenshot.sh select bindsym ctrl+Print exec $HOME/.local/scripts/screenshot.sh fullscreen bindsym $mod+p exec $HOME/.local/scripts/passmenu.sh diff --git a/run_once_01_cargo_bins.sh b/run_once_01_cargo_bins.sh index 743f103..c3379f9 100755 --- a/run_once_01_cargo_bins.sh +++ b/run_once_01_cargo_bins.sh @@ -1,18 +1,21 @@ #!/bin/bash -cargo install \ - bat \ - cargo-edit \ - cargo-expand \ - cargo-tree \ - cargo-update \ - cargo-watch \ - fd-find \ - hexyl \ - just \ - ripgrep \ - tectonic \ - tokei \ - topgrade \ +source $(dirname "$0")/common.sh + +command_exists cargo && \ + cargo install \ + bat \ + cargo-edit \ + cargo-expand \ + cargo-tree \ + cargo-update \ + cargo-watch \ + fd-find \ + hexyl \ + just \ + ripgrep \ + tectonic \ + tokei \ + topgrade \ ;