From 1e267c52240e177f635f8f718099571e24493088 Mon Sep 17 00:00:00 2001 From: Justine Smithies Date: Tue, 17 Dec 2024 18:37:56 +0000 Subject: Converted from bash to sh. --- .config/river/autostart.sh | 16 ++++++++-------- .config/river/init | 28 ++++++++++++++-------------- .local/bin/emoji-menu | 19 ------------------- .local/bin/emoji-menu.sh | 19 +++++++++++++++++++ .local/bin/powermenu | 37 ------------------------------------- .local/bin/powermenu.sh | 37 +++++++++++++++++++++++++++++++++++++ 6 files changed, 78 insertions(+), 78 deletions(-) delete mode 100755 .local/bin/emoji-menu create mode 100755 .local/bin/emoji-menu.sh delete mode 100755 .local/bin/powermenu create mode 100755 .local/bin/powermenu.sh diff --git a/.config/river/autostart.sh b/.config/river/autostart.sh index c2be8d7..ca4a846 100755 --- a/.config/river/autostart.sh +++ b/.config/river/autostart.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # Authentication dialog @@ -25,16 +25,16 @@ pkill -f wlsunset wlsunset -l 57.4 -L -1.9 & # Restore previous brightness -backlight $(grep 'brightness:' ~/.cache/brightness | awk '{print $2}') +backlight "$(grep 'brightness:' ~/.cache/brightness | awk '{print $2}')" # Restore audio volume -mixer vol.volume=$(grep 'vol.volume=' ~/.cache/audio-volume | awk -F ':' '{print $2}') -mixer vol.mute=$(grep 'vol.mute=' ~/.cache/audio-volume | awk -F '=' '{print $2}') +mixer vol.volume="$(grep 'vol.volume=' ~/.cache/audio-volume | awk -F ':' '{print $2}')" +mixer vol.mute="$(grep 'vol.mute=' ~/.cache/audio-volume | awk -F '=' '{print $2}')" -export wallpaper=$( echo $wallpaper) +export wallpaper="$($wallpaper)" pkill -f swayidle swayidle -w \ - timeout 300 'swaylock -f -i $wallpaper' \ - timeout 600 'wlopm --off \*;swaylock -F -i $wallpaper' resume 'wlopm --on \*' \ - before-sleep 'swaylock -f -i $wallpaper' & + timeout 300 "swaylock -f -i $wallpaper" \ + timeout 600 "wlopm --off \*;swaylock -F -i $wallpaper" resume "wlopm --on \*" \ + before-sleep "swaylock -f -i $wallpaper" & diff --git a/.config/river/init b/.config/river/init index 0f776a4..8e55234 100755 --- a/.config/river/init +++ b/.config/river/init @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # See the river(1), riverctl(1), and rivertile(1) man pages for complete # documentation. @@ -41,22 +41,22 @@ riverctl map normal Super+Shift E exit riverctl map normal Super D spawn "fuzzel" # Toggle bar -riverctl map normal Super B spawn "~/.config/eww/scripts/bar-toggle.sh" +riverctl map normal Super B spawn "$HOME/.config/eww/scripts/bar-toggle.sh" # Power Menu -riverctl map normal Control+Super P spawn "~/.local/bin/powermenu" +riverctl map normal Control+Super P spawn "$HOME/.local/bin/powermenu.sh" # Emoji Menu -riverctl map normal Super E spawn "~/.local/bin/emoji-menu" +riverctl map normal Super E spawn "$HOME/.local/bin/emoji-menu.sh" # Take a screenshot of the active output -riverctl map normal None Print spawn '~/.config/river/scripts/screenshot.sh' +riverctl map normal None Print spawn "$HOME/.config/river/scripts/screenshot.sh" # Take a screenshot of the selected region -riverctl map normal Super Print spawn '~/.config/river/scripts/screenshot.sh selected-region' +riverctl map normal Super Print spawn "$HOME/.config/river/scripts/screenshot.sh selected-region" # Take a screenshot and save it to the clipboard -riverctl map normal Super+Shift Print spawn '~/.config/river/scripts/screenshot.sh save-to-clipboard' +riverctl map normal Super+Shift Print spawn "$HOME/.config/river/scripts/screenshot.sh save-to-clipboard" # Super+Space to toggle float riverctl map normal Super Space toggle-float @@ -113,19 +113,19 @@ riverctl map normal Super+Alt+Shift L resize horizontal 100 # Tags for i in $(seq 1 9) do - tags=$((1 << ($i - 1))) + tags=$((1 << (i - 1))) # Super+[1-9] to focus tag [0-8] - riverctl map normal Super $i set-focused-tags $tags + riverctl map normal Super "$i" set-focused-tags "$tags" # Super+Shift+[1-9] to tag focused view with tag [0-8] - riverctl map normal Super+Shift $i set-view-tags $tags + riverctl map normal Super+Shift "$i" set-view-tags "$tags" # Super+Control+[1-9] to toggle focus of tag [0-8] - riverctl map normal Super+Control $i toggle-focused-tags $tags + riverctl map normal Super+Control "$i" toggle-focused-tags "$tags" # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view - riverctl map normal Super+Shift+Control $i toggle-view-tags $tags + riverctl map normal Super+Shift+Control "$i" toggle-view-tags "$tags" done # Super+0 to focus all tags @@ -146,7 +146,7 @@ riverctl map normal Super+Shift P set-view-tags ${scratch_tag} # Set spawn tagmask to ensure new windows don't have the scratchpad tag unless # explicitly set. -all_but_scratch_tag=$(( ((1 << 32) - 1) ^ $scratch_tag )) +all_but_scratch_tag=$(( ((1 << 32) - 1) ^ scratch_tag )) riverctl spawn-tagmask ${all_but_scratch_tag} # Layout @@ -193,7 +193,7 @@ do done # auto starting apps -bash $HOME/.config/river/autostart.sh +sh "$HOME/.config/river/autostart.sh" # Make all views with an app-id that starts with "float" and title "foo" start floating. riverctl rule-add -app-id 'float*' -title 'foo' float diff --git a/.local/bin/emoji-menu b/.local/bin/emoji-menu deleted file mode 100755 index 6b20513..0000000 --- a/.local/bin/emoji-menu +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -eu -# From: https://git.sr.ht/~emersion/dotfiles/tree/6575f89856d012c2c31e9e7d2c807f350c7503d4/item/bin/emoji-menu -# This version uses `fuzzel` instead of `menu`. - -default_cache_home=~/.cache -cache_home="${XDG_CACHE_HOME:-$default_cache_home}" -mkdir -p "$cache_home" -data_file="$cache_home/emoji-menu.json" - -if ! [ -f "$data_file" ]; then - curl -o "$data_file" -L "https://github.com/github/gemoji/raw/master/db/emoji.json" -fi - -filter='.[] | (.emoji + " " + .description + " (" + (.aliases | join(", ")) + ")")' -sel="$(jq -r "$filter" <"$data_file" | fuzzel --no-exit-on-keyboard-focus-loss -d | cut -d ' ' -f 1 | tr -d '\n')" -if [ -n "$sel" ]; then - # wl-ime-type "$sel" - wl-copy "$sel" -fi diff --git a/.local/bin/emoji-menu.sh b/.local/bin/emoji-menu.sh new file mode 100755 index 0000000..6b20513 --- /dev/null +++ b/.local/bin/emoji-menu.sh @@ -0,0 +1,19 @@ +#!/bin/sh -eu +# From: https://git.sr.ht/~emersion/dotfiles/tree/6575f89856d012c2c31e9e7d2c807f350c7503d4/item/bin/emoji-menu +# This version uses `fuzzel` instead of `menu`. + +default_cache_home=~/.cache +cache_home="${XDG_CACHE_HOME:-$default_cache_home}" +mkdir -p "$cache_home" +data_file="$cache_home/emoji-menu.json" + +if ! [ -f "$data_file" ]; then + curl -o "$data_file" -L "https://github.com/github/gemoji/raw/master/db/emoji.json" +fi + +filter='.[] | (.emoji + " " + .description + " (" + (.aliases | join(", ")) + ")")' +sel="$(jq -r "$filter" <"$data_file" | fuzzel --no-exit-on-keyboard-focus-loss -d | cut -d ' ' -f 1 | tr -d '\n')" +if [ -n "$sel" ]; then + # wl-ime-type "$sel" + wl-copy "$sel" +fi diff --git a/.local/bin/powermenu b/.local/bin/powermenu deleted file mode 100755 index e1896b1..0000000 --- a/.local/bin/powermenu +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -read -r wallpaper<~/.cache/wallpaper - -#### Options ### -power_off=" Shutdown" -reboot="󰜉 Reboot" -lock_screen=" Lock Screen" -suspend=" Suspend" -hibernate="󰒲 Hibernate" -log_out="󰍃﫼 Log Out" - -# Options passed to fuzzel -options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen" -lines="$(echo "$options" | grep -oF '\n' | wc -l)" -rofi_command="fuzzel -d -w 14 -l $((lines+1))" -chosen="$(echo -e "$options" | $rofi_command )" -case $chosen in - "$lock_screen") - swaylock -f -i "$wallpaper" - ;; - "$power_off") - doas poweroff - ;; - "$reboot") - doas reboot - ;; - "$suspend") - # $lock && loginctl suspend - ;; - "$hibernate") - # $lock && loginctl hibernate - ;; - "$log_out") - riverctl exit - ;; -esac diff --git a/.local/bin/powermenu.sh b/.local/bin/powermenu.sh new file mode 100755 index 0000000..8d353c2 --- /dev/null +++ b/.local/bin/powermenu.sh @@ -0,0 +1,37 @@ +#!/bin/sh + +read -r wallpaper<~/.cache/wallpaper + +#### Options ### +power_off=" Shutdown" +reboot="󰜉 Reboot" +lock_screen=" Lock Screen" +suspend=" Suspend" +hibernate="󰒲 Hibernate" +log_out="󰍃 Log Out" + +# Options passed to fuzzel +options="$power_off\n$reboot\n$suspend\n$hibernate\n$log_out\n$lock_screen" +lines="$(echo "$options" | grep -oF '\n' | wc -l)" +rofi_command="fuzzel -d -w 14 -l $((lines+1))" +chosen="$(echo -e "$options" | $rofi_command )" +case $chosen in + "$lock_screen") + swaylock -f -i "$wallpaper" + ;; + "$power_off") + doas poweroff + ;; + "$reboot") + doas reboot + ;; + "$suspend") + # $lock && loginctl suspend + ;; + "$hibernate") + # $lock && loginctl hibernate + ;; + "$log_out") + riverctl exit + ;; +esac -- cgit v1.2.3