mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-05 02:53:38 -08:00
Compare commits
3 Commits
099d5e8ba6
...
3fc0b32a9d
| Author | SHA1 | Date | |
|---|---|---|---|
|
3fc0b32a9d
|
|||
|
4005e4650e
|
|||
|
3b87c06731
|
@@ -23,7 +23,7 @@ monitorv2 {
|
||||
mode = 3440x1440@240
|
||||
position = 0x0
|
||||
scale = 1
|
||||
vrr = 3
|
||||
vrr = 2
|
||||
}
|
||||
|
||||
source = ~/.config/hypr/keybindings.conf
|
||||
@@ -263,7 +263,6 @@ windowrule = float on, match:class mpv
|
||||
windowrule = float on, match:class steam
|
||||
windowrule = float on, match:class anki
|
||||
windowrule = float on, match:class python, match:title Import
|
||||
windowrule = match:float 1, center on
|
||||
windowrule = workspace 10 silent, match:class discord
|
||||
windowrule = workspace 9 silent, match:class steam
|
||||
windowrule = workspace 8 silent, match:class anki
|
||||
@@ -281,6 +280,7 @@ windowrule = opacity 1.0 override, match:class anki
|
||||
windowrule = suppress_event maximize, match:class .*
|
||||
# Fix some dragging issues with XWayland
|
||||
windowrule = no_focus on,match:class ^$,match:title ^$,match:xwayland 1,match:float 1,match:fullscreen 0,match:pin 0
|
||||
windowrule = match:float 1, center on
|
||||
|
||||
# {{{ Screen sharing workaround: https://wiki.hyprland.org/Useful-Utilities/Screen-Sharing/#xwayland
|
||||
windowrule = opacity 0.0 override, match:class ^(xwaylandvideobridge)$
|
||||
|
||||
@@ -1,20 +1,68 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
BROWSER=/usr/bin/zen-browser
|
||||
URLS=(
|
||||
OPTIONS=(
|
||||
"Arch Linux (btw)"
|
||||
"Hyprland"
|
||||
)
|
||||
ARCH=(
|
||||
"Archlinux Wiki|https://wiki.archlinux.org/title/Main_page"
|
||||
)
|
||||
HYPRLAND=(
|
||||
"Hyprland Docs|https://wiki.hypr.land/"
|
||||
"Hyprland Window Rules|https://wiki.hypr.land/Configuring/Window-Rules/"
|
||||
)
|
||||
|
||||
DISPLAY_URLS=()
|
||||
declare -A URL_MAP
|
||||
for url in "${URLS[@]}"; do
|
||||
DISPLAY_URLS+=("${url%%|*}")
|
||||
get_url() {
|
||||
urls=("$@")
|
||||
display_urls=()
|
||||
declare -A url_map
|
||||
for url in "${urls[@]}"; do
|
||||
display_urls+=("${url%%|*}")
|
||||
label="${url%%|*}"
|
||||
URL_MAP["$label"]="${url##*|}"
|
||||
done
|
||||
url_map["$label"]="${url##*|}"
|
||||
done
|
||||
display_urls+=("Back")
|
||||
url_map["Back"]="Back"
|
||||
|
||||
SELECTION="$(printf "%s\n" "${DISPLAY_URLS[@]}" | rofi -theme-str 'window {width: 25%;} listview {columns: 1; lines: 10;}' -theme ~/.config/rofi/launchers/type-2/style-2.rasi -dmenu -l 5 -i -p "Select Documentation")"
|
||||
URL="${URL_MAP[$SELECTION]}"
|
||||
$BROWSER "$URL" &>/dev/null &
|
||||
selection="$(printf "%s\n" "${display_urls[@]}" | rofi -theme-str 'window {width: 25%;} listview {columns: 1; lines: 10;}' -theme ~/.config/rofi/launchers/type-2/style-2.rasi -dmenu -l 5 -i -p "Select Documentation")"
|
||||
url="${url_map[$selection]}"
|
||||
|
||||
if [ -z "$url" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
printf "%s\n" "$url"
|
||||
}
|
||||
|
||||
get_docs_list() {
|
||||
selection="$(printf "%s\n" "${OPTIONS[@]}" | rofi -theme-str 'window {width: 25%;} listview {columns: 1; lines: 10;}' -theme ~/.config/rofi/launchers/type-2/style-2.rasi -dmenu -l 5 -i -p "Select Documentation Group")"
|
||||
case "$selection" in
|
||||
"Arch Linux (btw)")
|
||||
urls=("${ARCH[@]}")
|
||||
;;
|
||||
"Hyprland")
|
||||
urls=("${HYPRLAND[@]}")
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
|
||||
printf "%s\n" "${urls[@]}"
|
||||
}
|
||||
|
||||
main() {
|
||||
urls=("$(get_docs_list)")
|
||||
url="$(get_url "${urls[@]}")"
|
||||
if [ -z "$url" ]; then
|
||||
printf "No URL selected.\n"
|
||||
exit 0
|
||||
elif [ "$url" == "Back" ]; then
|
||||
main
|
||||
exit 0
|
||||
fi
|
||||
$BROWSER "$url" &>/dev/null &
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
@@ -7,5 +7,7 @@ DIR="$HOME/Pictures/wallpapers/favorites"
|
||||
SELECTED_WALL=$(cd "$DIR" && for a in *.jpg *.png; do echo -en "$a\0icon\x1f$a\n"; done | rofi -dmenu -i -no-custom -theme "$THEME" -p "Select a wallpaper" -theme-str 'configuration {icon-size: 128; dpi: 96;} window {width: 45%; height: 45%;}')
|
||||
PTH="$(printf "%s" "$DIR/$SELECTED_WALL" | tr -s '/')"
|
||||
notify-send -a "rofi-wallpaper" "Wallpaper set to" -i "$PTH" "$PTH"
|
||||
hyprctl hyprpaper preload "$PTH"
|
||||
hyprctl hyprpaper wallpaper "DP-1,$PTH"
|
||||
hyprctl hyprpaper unload "$(cat "$HOME/.wallpaper")"
|
||||
echo "$PTH" >"$HOME/.wallpaper"
|
||||
hyprctl hyprpaper reload , "$PTH"
|
||||
|
||||
@@ -175,7 +175,7 @@ func downloadRandomWallpaper(wallpaperPath string, r *rand.Rand, topics []string
|
||||
fmt.Fprintf(os.Stderr, "Searching for wallpapers related to: %s\n", displayName)
|
||||
|
||||
// Get wallpapers from Wallhaven API
|
||||
resp, err := http.Get(fmt.Sprintf("%s/search?q=%s&purity=100&categories=110&sorting=random", wallhavenAPI, query))
|
||||
resp, err := http.Get(fmt.Sprintf("%s/search?q=%s&purity=100&categories=110&sorting=random&atleast=3440x1440", wallhavenAPI, query))
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error fetching from Wallhaven: %v\n", err)
|
||||
return "", ""
|
||||
|
||||
Reference in New Issue
Block a user