mirror of
https://github.com/CoolnsX/hyprdots.git
synced 2025-12-20 15:25:24 +05:30
Feat: New Scripts, new functions
This commit is contained in:
23
hypr/bkmark
23
hypr/bkmark
@@ -2,25 +2,22 @@
|
||||
|
||||
#script for bookmarking selected items and later using it..
|
||||
|
||||
data="$(wl-paste -p | tr '\n' '\`' | sed 's/$/ /g')"
|
||||
data="$(wl-paste -p | tr '\n' '\`' | sed 's/$/ /g' | base64)"
|
||||
|
||||
file="$HOME/.cache/bookmarks"
|
||||
oshi_file="$HOME/.cache/oshi-urls"
|
||||
|
||||
menu() {
|
||||
bemenu --fn 'IBM Plex Sans 15' -i -c -W 0.6 -B 3 -l 30 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
bemenu -R 20 --fn 'IBM Plex Sans 15' -i -c -W 0.6 -B 3 -l 30 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
}
|
||||
|
||||
case $1 in
|
||||
add)
|
||||
if [ -z "$data" ]; then
|
||||
notify-send -e "Please select anything to bookmark"
|
||||
elif grep -q "${data}" "$file"; then
|
||||
notify-send -e -i "bookmark-missing" "Already bookmarked"
|
||||
else
|
||||
printf "%s" "$data" >>"$file"
|
||||
notify-send -e -i "user-bookmarks" "Bookmarked" "$data"
|
||||
fi
|
||||
[ -z "$data" ] && notify-send -e "Please select anything to bookmark" && exit 1
|
||||
grep -q "${data}" "$file" && notify-send -e -i "bookmark-missing" "Already bookmarked" && exit 1
|
||||
label=$(cut -d '|' -f1 .cache/bookmarks | sed '/^$/d' | tr -d ' ' | menu "Enter Label : ")
|
||||
[ -z "$label" ] && notify-send -e "Please enter label for identification" && exit 1
|
||||
printf "%s | %s" "$label" "$data" >>"$file"
|
||||
notify-send -e -i "user-bookmarks" "Bookmarked" "$label | $data"
|
||||
;;
|
||||
rm)
|
||||
data="$(sed '/^$/d' "$file" | nl -n'ln')"
|
||||
@@ -29,12 +26,12 @@ case $1 in
|
||||
[ -z "$del" ] || (sed -i "${del}d" "$file" && notify-send -e -i "bookmark-missing" "Bookmark deleted" -u critical)
|
||||
;;
|
||||
copy)
|
||||
data=$(sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | menu "COPY-bookmark :" | tr '\`' '\n')
|
||||
data=$(sed '/^$/d' "$file" | menu "COPY-bookmark :" | cut -d'|' -f2 | tr -d ' ' | base64 -d | tr '\`' '\n')
|
||||
[ -z "$data" ] && notify-send -e -u critical "No Bookmark selected" && exit 1
|
||||
printf '%s' "$data" | wl-copy && notify-send -e "Copied to clipboard" -i "com.github.davidmhewitt.clipped"
|
||||
;;
|
||||
*)
|
||||
result="$(sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | menu "Put-bookmark :" | tr '\`' '\n')"
|
||||
result="$(sed '/^$/d' "$file" | menu "Put-bookmark :" | cut -d'|' -f2 | tr -d ' ' | base64 -d | tr '\`' '\n')"
|
||||
if printf '%s' "$result" | grep -q 'B>'; then
|
||||
google-chrome-stable "$(printf '%s' "$result" | cut -d'>' -f2- | tr -d '\n ')"
|
||||
else
|
||||
|
||||
@@ -30,7 +30,7 @@ max=$(cat "$root_dir/$backlight_dir/max_brightness")
|
||||
|
||||
#runtime values
|
||||
opr=$1 # [+|-], required
|
||||
increment=${2:-5} # [ default:5, optional] "around 2% brightness"
|
||||
increment=${2:-1296} # [ default:1296, optional] "around 2% brightness"
|
||||
|
||||
#shellcheck disable=SC2004
|
||||
[ "$opr" = "s" ] && printf "%s" "$((${current}00/${max}))" && exit 0
|
||||
|
||||
@@ -46,6 +46,7 @@ input {
|
||||
|
||||
touchpad {
|
||||
natural_scroll = yes
|
||||
drag_lock = 0
|
||||
}
|
||||
|
||||
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
|
||||
@@ -107,15 +108,13 @@ dwindle {
|
||||
|
||||
gestures {
|
||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||
workspace_swipe = true
|
||||
workspace_swipe_fingers = 3
|
||||
gesture = 3, horizontal, workspace
|
||||
#gesture = 3, up, fullscreen,maximize
|
||||
}
|
||||
|
||||
misc {
|
||||
force_default_wallpaper = 0
|
||||
vfr = 1
|
||||
#vrr = 1
|
||||
#no_direct_scanout = false
|
||||
}
|
||||
|
||||
xwayland {
|
||||
@@ -191,6 +190,7 @@ bind = $mainMod SHIFT, Print, exec, $hypr_dir/screenshot 'fullclip'
|
||||
bind = $mainMod,Print, exec, $hypr_dir/screenshot 'fullsave'
|
||||
bind = $mainMod, F12, exec, $hypr_dir/date
|
||||
bind = $mainMod, Delete, exec, $hypr_dir/workspace 'list'
|
||||
bind = $mainMod SHIFT, M, exec, $hypr_dir/pinmpv
|
||||
|
||||
#xf86 keys
|
||||
binde =, XF86AudioLowerVolume, exec, $hypr_dir/volume set-volume -l 1.4 @DEFAULT_SINK@ 2%-
|
||||
@@ -200,8 +200,8 @@ binde =, XF86AudioMicMute, exec, $hypr_dir/volume set-mute @DEFAULT_SOURCE@ togg
|
||||
binde =, XF86AudioPlay, exec, echo cycle pause | socat - "/tmp/yt-music/yt-music-mpvsocket"
|
||||
binde =, XF86AudioPause, exec, echo cycle pause | socat - "/tmp/yt-music/yt-music-mpvsocket"
|
||||
binde = $mainMod, XF86Favorites, exec, $HOME/repos_scripts/yt-music search_play #why not :)
|
||||
binde =, XF86HangupPhone, exec, $HOME/repos_scripts/yt-music play_next
|
||||
binde =, XF86PickupPhone, exec, $HOME/repos_scripts/yt-music play_next menu
|
||||
binde =, XF86HangupPhone, exec, flock -n /tmp/yt-music/play_next.lock $HOME/repos_scripts/yt-music play_next
|
||||
binde =, XF86PickupPhone, exec, flock -n /tmp/yt-music/play_next_menu.lock $HOME/repos_scripts/yt-music play_next menu
|
||||
binde =, XF86MonBrightnessUp, exec, $hypr_dir/brightness '+'
|
||||
binde =, XF86MonBrightnessDown, exec, $hypr_dir/brightness '-'
|
||||
bind = , XF86SelectiveScreenshot, exec, $hypr_dir/screenshot 'selclip'
|
||||
@@ -226,6 +226,7 @@ windowrulev2 = size 640 360, title:(Picture-in-Picture)
|
||||
windowrulev2 = pin, title:^(Picture-in-Picture)$
|
||||
windowrulev2 = move 100%-641 100%-361, title:(Picture-in-Picture)
|
||||
windowrulev2 = float, title:^(Picture-in-Picture)$
|
||||
windowrulev2 = float, class:^(xdg-desktop-portal-gtk)$
|
||||
|
||||
#workspace rules
|
||||
workspace = 1, on-created-empty:$browser
|
||||
@@ -233,11 +234,12 @@ workspace = 2, on-created-empty:foot
|
||||
workspace = special, on-created-empty:[float] foot
|
||||
|
||||
#startup applications
|
||||
exec-once = systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP QT_QPA_PLATFORMTHEME GTK_THEME
|
||||
exec-once = dbus-update-activation-environment --systemd --all
|
||||
exec-once = hypridle
|
||||
exec-once = ssh-agent
|
||||
exec-once = /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
exec-once = swaybg -i $HOME/.config/wall/1.png -m fill
|
||||
exec-once = swaybg -i $HOME/.config/wall/4.jpg -m fill
|
||||
exec-once = $hypr_dir/workspace 'focus'
|
||||
exec-once = $hypr_dir/battery
|
||||
exec-once = $hypr_dir/themes
|
||||
|
||||
21
hypr/pinmpv
Executable file
21
hypr/pinmpv
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# make window floating
|
||||
hyprctl dispatch togglefloating
|
||||
socket_file="/tmp/jellyfin-mpvsocket"
|
||||
|
||||
# use fallback if specified file doesn't exist
|
||||
[ -e "$socket_file" ] || socket_file="/tmp/mpvsocket"
|
||||
|
||||
# dimension to resize the mpv window
|
||||
dimension=$(printf '{ "command": ["get_property", "width"] }\n{ "command": ["get_property", "height"] }\n' | socat - "$socket_file" | sed -nE 's|.*"data":([^,]*),.*|\1|p' | tr '\n' ' ')
|
||||
|
||||
# resize window to match video resolution
|
||||
hyprctl dispatch resizeactive exact $dimension
|
||||
|
||||
# move window to bottom right
|
||||
hyprctl dispatch movewindow r
|
||||
hyprctl dispatch movewindow d
|
||||
|
||||
#pin
|
||||
#hyprctl dispatch pin
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
gamedir="$HOME/games"
|
||||
gamedir="$HOME/Games"
|
||||
|
||||
games=$(find "$gamedir" -maxdepth 5 -type f -name '*.exe' -executable | sed "s|$gamedir/||g;/[U|u]nin.*/d")
|
||||
|
||||
@@ -19,6 +19,6 @@ trap 'wineserver -k' INT HUP
|
||||
|
||||
#DXVK_CONFIG=dxgi.hideAmdGpu=True WINEFSYNC=1 WINEESYNC=1 MANGOHUD=1 gamescope -W 1280 -H 800 -r 60 -- gamemoderun wine "$gamename"
|
||||
|
||||
#hyprctl keyword monitor "eDP-1",'1280x800@120','auto','1'
|
||||
WINEFSYNC=1 WINEESYNC=1 MANGOHUD=1 gamemoderun wine "$gamename" -windowed
|
||||
#hyprctl keyword monitor "eDP-1",highrr,'auto','1.5'
|
||||
#hyprctl keyword monitor "eDP-1",'1280x800@60','auto','1'
|
||||
WINEFSYNC=1 WINEESYNC=1 MANGOHUD=1 env -u DISPLAY gamemoderun wine "$gamename"
|
||||
#hyprctl keyword monitor "eDP-1",highrr,'auto','1'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
gsettings set org.gnome.desktop.interface gtk-theme Materia-dark
|
||||
gsettings set org.gnome.desktop.interface icon-theme ePapirus-Dark
|
||||
gsettings set org.gnome.desktop.interface icon-theme Papirus-Dark
|
||||
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
|
||||
|
||||
@@ -17,7 +17,7 @@ setup_dual_monitor() {
|
||||
|
||||
handle_it() {
|
||||
[ -z "$1" ] || notify-send -e "$1"
|
||||
choice=$(printf "Extend\nMirror" | bemenu --fn 'IBM Plex Sans 15' -i -c -W 0.2 -B 3 -l 20 -p "what to do??: " -m 1 --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
|
||||
choice=$(printf "Extend\nMirror" | bemenu -R 20 --fn 'IBM Plex Sans 15' -i -c -W 0.2 -B 3 -l 20 -p "what to do??: " -m 1 --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT")
|
||||
[ -z "$choice" ] && return 0
|
||||
notify-send -e "${choice}ing screen"
|
||||
if [ "$choice" = "Extend" ]; then
|
||||
@@ -44,7 +44,7 @@ case $1 in
|
||||
printf "%s" "$line" | grep -q "monitoraddedv2" && handle_it "$line"
|
||||
#recent workspace switcher
|
||||
current=$(printf "%s" "$line" | sed -nE 's_^(workspace)v2>>([^,]*),.*_\1 \2_p')
|
||||
notify-send -e -i "lol" "$current" -h "string:x-canonical-private-synchronous:monitor" -t 700 2>/dev/null
|
||||
[ -n "$current" ] && notify-send -e -i "lol" "$current" -h "string:x-canonical-private-synchronous:monitor" -t 700 2>/dev/null
|
||||
done
|
||||
;;
|
||||
toggle)
|
||||
|
||||
Reference in New Issue
Block a user