Update hn, rofi- maim,power,prompt,search

This commit is contained in:
Jeffrey Serio 2024-05-07 06:19:45 -05:00
parent 2148df813e
commit 9440b57d09
5 changed files with 9 additions and 11 deletions

10
hn
View File

@ -22,7 +22,7 @@ if ! test -x "$(command -v gum)"; then
exit 1 exit 1
fi fi
python3 <(cat <<EOF selection=$(python3 <(cat <<EOF
import feedparser import feedparser
HNFeed = feedparser.parse("https://hnrss.org/newest") HNFeed = feedparser.parse("https://hnrss.org/newest")
@ -32,8 +32,8 @@ class bcolors:
ENDC = "\033[0m" ENDC = "\033[0m"
for item in HNFeed.entries: for item in HNFeed.entries:
print(f"{bcolors.HEADER}%s{bcolors.ENDC}" % item.title) print(f"[{item.title}]({item.links[0].href})")
print(item.links[0].href)
print()
EOF EOF
) | gum pager ) | gum format -t "markdown" | gum choose --limit=1)
xdg-open "$(echo "$selection" | grep -o 'http[s]\?://[^ ]\+')" >/dev/null || echo "$selection"

View File

@ -17,7 +17,7 @@ screen=' Screen'
area=' Select area' area=' Select area'
window=' Window' window=' Window'
chosen=$(printf '%s;%s;%s\n' "$screen" "$area" "$window" \ chosen=$(printf '%s;%s;%s' "$screen" "$area" "$window" \
| rofi -theme-str 'window { width: 10em; height: 10em; }' \ | rofi -theme-str 'window { width: 10em; height: 10em; }' \
-P 'Screenshot' \ -P 'Screenshot' \
-dmenu \ -dmenu \
@ -35,6 +35,4 @@ esac
# shellcheck disable=2086 # shellcheck disable=2086
maim --hidecursor --quiet --quality=3 --format='png' $extra_args "$screenshot_path" && { maim --hidecursor --quiet --quality=3 --format='png' $extra_args "$screenshot_path" && {
notify-send --icon=org.xfce.screenshooter "Screenshot saved as $screenshot_path" notify-send --icon=org.xfce.screenshooter "Screenshot saved as $screenshot_path"
xclip -selection clipboard -target 'image/png' -in "$screenshot_path"
} }

View File

@ -37,7 +37,7 @@ lock=' Lock'
suspend='鈴 Suspend' suspend='鈴 Suspend'
log_out=' Log out' log_out=' Log out'
chosen=$(printf '%s;%s;%s;%s;%s\n' "$power_off" "$reboot" "$lock" "$suspend" \ chosen=$(printf '%s;%s;%s;%s;%s' "$power_off" "$reboot" "$lock" "$suspend" \
"$log_out" \ "$log_out" \
| rofi -theme-str 'window { width: 10em; height: 11em; }' \ | rofi -theme-str 'window { width: 10em; height: 11em; }' \
-dmenu -p "Session"\ -dmenu -p "Session"\

View File

@ -54,7 +54,7 @@ while [ $# -ne 0 ]; do
shift shift
done done
chosen=$(printf '%s;%s\n' "$yes" "$no" \ chosen=$(printf '%s;%s' "$yes" "$no" \
| rofi -theme-str 'window { width: 10em; height: 11em; }' \ | rofi -theme-str 'window { width: 10em; height: 11em; }' \
-p "$query" \ -p "$query" \
-dmenu \ -dmenu \

View File

@ -2,4 +2,4 @@
set -euo pipefail set -euo pipefail
rofi -dmenu -p "Search" -theme-str 'window { width: 40em; height: 4em; }' | xargs -I{} xdg-open "https://librey.hyperreal.coffee/search.php?q={}" rofi -dmenu -p "Search" -theme-str 'window { width: 40em; height: 4em; }' | xargs -I{} xdg-open "https://librey.nirn.quest/search.php?q={}"