Add missing scripts
This commit is contained in:
parent
234214551f
commit
432f6799d9
9 changed files with 99 additions and 22 deletions
|
@ -93,8 +93,8 @@
|
|||
"format": "",
|
||||
"interval": "once",
|
||||
"return-type": "json",
|
||||
"on-click": "swaymsg -q exec '$clipboard'; pkill -RTMIN+9 waybar",
|
||||
"on-click-right": "swaymsg -q exec '$clipboard-del'; pkill -RTMIN+9 waybar",
|
||||
"on-click": "riverctl spawn '/usr/share/river/scripts/clipboard-manager.sh --list'; pkill -RTMIN+9 waybar",
|
||||
"on-click-right": "riverctl spawn '/usr/share/river/scripts/clipboard-manager.sh --del'; pkill -RTMIN+9 waybar",
|
||||
"on-click-middle": "rm -f ~/.cache/cliphist/db; pkill -RTMIN+9 waybar",
|
||||
"exec": "printf '{\"tooltip\":\"%s\"}' $(cliphist list | wc -l)' item(s) in the clipboard\r(Mid click to clear)'",
|
||||
"exec-if": "[ -x \"$(command -v cliphist)\" ] && [ $(cliphist list | wc -l) -gt 0 ]",
|
||||
|
@ -161,10 +161,10 @@
|
|||
},
|
||||
"tooltip-format": "{icon} {volume}% {format_source}",
|
||||
"on-click": "riverctl spawn /usr/share/river/scripts/pulse.sh",
|
||||
"on-click-middle": "exec pulsemixer --toggle-mute && /usr/share/river/scripts/volume-notify.sh",
|
||||
"on-click-middle": "pulsemixer --toggle-mute && /usr/share/river/scripts/volume-notify.sh",
|
||||
"on-click-right": "riverctl spawn pavucontrol",
|
||||
"on-scroll-up": "exec pulsemixer --change-volume +5 && /usr/share/river/scripts/volume-notify.sh",
|
||||
"on-scroll-down": "exec pulsemixer --change-volume -5 && /usr/share/river/scripts/volume-notify.sh"
|
||||
"on-scroll-up": "pulsemixer --change-volume +5 && /usr/share/river/scripts/volume-notify.sh",
|
||||
"on-scroll-down": "pulsemixer --change-volume -5 && /usr/share/river/scripts/volume-notify.sh"
|
||||
},
|
||||
|
||||
"clock": {
|
||||
|
|
|
@ -70,14 +70,12 @@ window#waybar.hidden {
|
|||
#clock,
|
||||
#custom-playerctl,
|
||||
#custom-power,
|
||||
#custom-scratchpad,
|
||||
#custom-wlsunset,
|
||||
#custom-clipboard,
|
||||
#custom-menu,
|
||||
#custom-dunst,
|
||||
#battery,
|
||||
#cpu,
|
||||
#language,
|
||||
#memory,
|
||||
#network,
|
||||
#bluetooth,
|
||||
|
@ -107,10 +105,6 @@ window#waybar.hidden {
|
|||
color: #cad3f5;
|
||||
}
|
||||
|
||||
#custom-scratchpad {
|
||||
color: #f4dbd6;
|
||||
}
|
||||
|
||||
#custom-clipboard {
|
||||
color: #f5a97f;
|
||||
}
|
||||
|
@ -156,10 +150,6 @@ label:focus {
|
|||
color: #eed49f;
|
||||
}
|
||||
|
||||
#language {
|
||||
color: #ee99a0;
|
||||
}
|
||||
|
||||
#memory {
|
||||
color: #a6da95;
|
||||
}
|
||||
|
|
7
usr/share/river/scripts/bluetooth-manager.sh
Executable file
7
usr/share/river/scripts/bluetooth-manager.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)"
|
||||
term_float="alacritty --class floating_shell -e"
|
||||
FLOCK="flock --verbose -n "$HOME/.local/state/${HASH}.lock""
|
||||
$FLOCK $term_float bluetuith
|
||||
|
7
usr/share/river/scripts/btop.sh
Executable file
7
usr/share/river/scripts/btop.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)"
|
||||
term_float="alacritty --class floating_shell -e"
|
||||
FLOCK="flock --verbose -n "$HOME/.local/state/${HASH}.lock""
|
||||
$FLOCK $term_float btop
|
||||
|
7
usr/share/river/scripts/calendar.sh
Executable file
7
usr/share/river/scripts/calendar.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)"
|
||||
term_float="alacritty --class floating_shell -e"
|
||||
FLOCK="flock --verbose -n "$HOME/.local/state/${HASH}.lock""
|
||||
$FLOCK $term_float calcurse
|
||||
|
6
usr/share/river/scripts/clipboard-manager.sh
Executable file
6
usr/share/river/scripts/clipboard-manager.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
case "$1" in
|
||||
--list) cliphist list | fuzzel --dmenu -font -p "Select item to copy:" --lines 10 --width 60 | cliphist decode | wl-copy;;
|
||||
--del) cliphist list | fuzzel --dmenu -font -p "Select item to delete:" --lines 10 --width 60 | cliphist delete;;
|
||||
esac
|
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)"
|
||||
|
||||
mkdir -p "$HOME/.local/state"
|
||||
|
||||
flock --verbose -n "$HOME/.local/state/${HASH}.lock" "$@"
|
|
@ -1,4 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
HASH="$(echo "$@" | shasum | cut -f1 -d" " | cut -c1-7)"
|
||||
term_float="alacritty --class floating_shell -e"
|
||||
$term_float nmtui connect
|
||||
FLOCK="flock --verbose -n "$HOME/.local/state/${HASH}.lock""
|
||||
$FLOCK $term_float nmtui connect
|
||||
|
|
64
usr/share/river/scripts/sunset.sh
Executable file
64
usr/share/river/scripts/sunset.sh
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Startup function
|
||||
function start() {
|
||||
[[ -f "$HOME/.config/wlsunset/config" ]] && source "$HOME/.config/wlsunset/config"
|
||||
temp_low=${temp_low:-"4000"}
|
||||
temp_high=${temp_high:-"6500"}
|
||||
duration=${duration:-"900"}
|
||||
sunrise=${sunrise:-"07:00"}
|
||||
sunset=${sunset:-"19:00"}
|
||||
location=${location:-"on"}
|
||||
fallback_longitude=${fallback_longitude:-"8.7"}
|
||||
fallback_latitude=${fallback_latitude:-"50.1"}
|
||||
|
||||
if [ "${location}" = "on" ]; then
|
||||
if [[ -z ${longitude+x} ]] || [[ -z ${latitude+x} ]]; then
|
||||
GEO_CONTENT=$(curl -sL https://freegeoip.live/json/)
|
||||
fi
|
||||
longitude=${longitude:-$(echo "$GEO_CONTENT" | jq '.longitude // empty')}
|
||||
longitude=${longitude:-$fallback_longitude}
|
||||
latitude=${latitude:-$(echo "$GEO_CONTENT" | jq '.latitude // empty')}
|
||||
latitude=${latitude:-$fallback_latitude}
|
||||
|
||||
echo longitude: "$longitude" latitude: "$latitude"
|
||||
|
||||
wlsunset -l "$latitude" -L "$longitude" -t "$temp_low" -T "$temp_high" -d "$duration" &
|
||||
else
|
||||
wlsunset -t "$temp_low" -T "$temp_high" -d "$duration" -S "$sunrise" -s "$sunset" &
|
||||
fi
|
||||
}
|
||||
|
||||
#Accepts managing parameter
|
||||
case $1'' in
|
||||
'off')
|
||||
pkill wlsunset
|
||||
;;
|
||||
|
||||
'on')
|
||||
start
|
||||
;;
|
||||
|
||||
'toggle')
|
||||
if pkill -0 wlsunset; then
|
||||
pkill wlsunset
|
||||
else
|
||||
start
|
||||
fi
|
||||
;;
|
||||
'check')
|
||||
command -v wlsunset
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
#Returns a string for Waybar
|
||||
if pkill -0 wlsunset; then
|
||||
class="on"
|
||||
tooltip="Night Color mode: enabled"
|
||||
else
|
||||
class="off"
|
||||
tooltip="Night Color mode: disabled"
|
||||
fi
|
||||
|
||||
printf '{"alt":"%s", "tooltip":"%s"}\n' "$class" "$tooltip"
|
Loading…
Add table
Reference in a new issue