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 \ ;