From 80de39466adc4bea15442eaae7c13b5b0dc5f68b Mon Sep 17 00:00:00 2001 From: coolnsx Date: Thu, 29 Feb 2024 15:17:10 +0530 Subject: [PATCH] Derp, asset redirection in dev mode --- QtProject.conf | 10 ++++---- dunst/dunstrc | 4 +-- eww/eww.yuck | 2 +- foot/foot.ini | 2 +- hypr/battery | 57 +++++++++++++++++++++++++++++++----------- hypr/bkmark | 4 +-- hypr/dmenu_run_history | 10 ++++---- hypr/hyprland.conf | 12 ++++----- hypr/rungame | 15 +++++++++++ hypr/screenshot | 2 +- zsh/zshrc | 4 +-- 11 files changed, 81 insertions(+), 41 deletions(-) create mode 100755 hypr/rungame diff --git a/QtProject.conf b/QtProject.conf index 19dcb71..baae30e 100644 --- a/QtProject.conf +++ b/QtProject.conf @@ -1,10 +1,10 @@ [FileDialog] -history=@Invalid() -lastVisited=file:///dev -qtVersion=5.15.12 +history=file:///opt/zoom +lastVisited=file:///opt/zoom +qtVersion=5.15.15 shortcuts=file:, file:///home/tanveer -sidebarWidth=84 -treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1\xb8\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xe8\0\0\0\x1\0\0\0\0\0\0\0\x36\0\0\0\x1\0\0\0\0\0\0\0:\0\0\0\x1\0\0\0\0\0\0\0`\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff\0\0\0\0) +sidebarWidth=48 +treeViewHeader=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x1\xb8\0\0\0\x4\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x4\0\0\0\xe8\0\0\0\x1\0\0\0\0\0\0\0\x36\0\0\0\x1\0\0\0\0\0\0\0:\0\0\0\x1\0\0\0\0\0\0\0`\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\xff\xff\xff\xff) viewMode=Detail [Qt] diff --git a/dunst/dunstrc b/dunst/dunstrc index 3dab33b..6e983a1 100644 --- a/dunst/dunstrc +++ b/dunst/dunstrc @@ -80,7 +80,7 @@ # Padding between text and separator. padding = 8 - highlight = "#5E88DD" + highlight = "#D81860" # Horizontal padding. horizontal_padding = 8 @@ -93,7 +93,7 @@ frame_width = 3 # Defines color of the frame around the notification window. - frame_color = "#5E88DD" + frame_color = "#D81860" # Size of gap to display between notifications - requires a compositor. # If value is greater than 0, separator_height will be ignored and a border diff --git a/eww/eww.yuck b/eww/eww.yuck index c2b133c..94704e1 100644 --- a/eww/eww.yuck +++ b/eww/eww.yuck @@ -43,7 +43,7 @@ :y "50" :width "30%" :height "40px" - :anchor "top left") + :anchor "bottom left") :stacking "bg" :reserve (struts :distance "10px" :side "bottom") :windowtype "dock" diff --git a/foot/foot.ini b/foot/foot.ini index dee3d39..5ad65ba 100644 --- a/foot/foot.ini +++ b/foot/foot.ini @@ -104,7 +104,7 @@ alpha=0.9 # scrollback-indicator= # black-on-bright-blue # search-box-no-match= # black-on-red # search-box-match= # black-on-yellow -# urls= +#urls=A9DC76 [csd] # preferred=server diff --git a/hypr/battery b/hypr/battery index 97e3193..9261128 100755 --- a/hypr/battery +++ b/hypr/battery @@ -1,20 +1,47 @@ #!/bin/sh -i=10 -dir="/sys/class/power_supply/BAT0/" -icon_dir="/usr/share/icons/Papirus/22x22/panel/" +remind() { + notify-send -i "$icon_dir/battery-010.svg" -h "string:x-canonical-private-synchronous:${0##*/}" "$1 % Battery $2, Please Plugin Charger!!" -u "$2" +} -[ -n "$1" ] && printf "Sleep for %s seconds\n" "$i" +print_sleep() { + [ -n "$4" ] && printf "Status: %s, Charge: %s,Next Check in %s seconds\n" "$3" "$2" "$1" + sleep "$1" +} -while sleep $i; do - capacity_level=$(cat "$dir"/capacity_level) - state=$(cat "$dir"/status) - case $capacity_level in - *ritical) i=10 ;; - *ow) i=60 ;; - *) i=300 ;; - esac - [ -n "$1" ] && printf "Sleep for %s seconds\n" "$i" - [ "$state" = "Discharging" ] || continue - [ "$capacity_level" != "Normal" ] && notify-send -i "$icon_dir/battery-010.svg" -h "string:x-canonical-private-synchronous:${0##*/}" "$(cat "$dir/capacity") Battery $capacity_level, Please Plugin Charger!!" -u "$capacity_level" +#declaration +battery="BAT0" #change accordingly +dir="/sys/class/power_supply/$battery/" +icon_dir="/usr/share/icons/Papirus/22x22/panel/" #change accordingly +i=0 +status="normal" + +#infinite loop +while charge=$(cat "$dir"/capacity); do + if [ "$(cat "$dir"/status)" = "Charging" ]; then + i=300 #default polling time, it's 5 minutes + else + case $charge in + [2-9][0-9] | 100) + i=300 # 5 minutes + status="normal" + ;; + [1-2][0-9]) + i=150 # 2.5 minutes + status="low" + ;; + [5-9]) + i=60 # every minute + status="critical" + ;; + [0-4]) + i=10 # every 10 seconds + status="critical" + ;; + esac + + # remind appropriately + [ "$status" != "normal" ] && remind "$charge" "$status" + fi + print_sleep "$i" "$charge" "$status" "$1" #pass 'log' as argument to print logs done diff --git a/hypr/bkmark b/hypr/bkmark index 0e7964c..38653bf 100755 --- a/hypr/bkmark +++ b/hypr/bkmark @@ -7,7 +7,7 @@ data="$(wl-paste -p | tr '\n' '\`' | sed 's/$/ /g')" file="$HOME/.cache/bookmarks" oshi_file="$HOME/.cache/oshi-urls" -menu(){ +menu() { bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" } @@ -25,7 +25,7 @@ case $1 in rm) data="$(sed '/^$/d' "$file" | nl -n'ln')" [ -z "$data" ] && notify-send "Bookmark is empty" && exit 0 - del=$(printf "%s" "$data" | menu "delete-bookmark :" | cut -f1) + del=$(printf "%s" "$data" | menu "delete-bookmark :" | cut -f1) [ -z "$del" ] || (sed -i "${del}d" "$file" && notify-send -i "bookmark-missing" "Bookmark deleted" -u critical) ;; copy) diff --git a/hypr/dmenu_run_history b/hypr/dmenu_run_history index e4606f5..970959a 100755 --- a/hypr/dmenu_run_history +++ b/hypr/dmenu_run_history @@ -4,10 +4,10 @@ cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} cache=$cachedir/dmenu_run historyfile=$cachedir/dmenu_history -ls /bin > "$cache" +ls /bin >"$cache" -cut -f2 "$historyfile" "$cache" | bemenu --fixed-height --fn 'JetBrainsMono Nerd Font 15' -i -c -W 0.5 -B 3 -p "RUN: " -l 15 -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" \ - | awk -v histfile=$historyfile ' +cut -f2 "$historyfile" "$cache" | bemenu --fixed-height --fn 'JetBrainsMono Nerd Font 15' -i -c -W 0.5 -B 3 -p "RUN: " -l 15 -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT" | + awk -v histfile=$historyfile ' BEGIN { FS=OFS="\t" while ( (getline < histfile) > 0 ) { @@ -29,5 +29,5 @@ cut -f2 "$historyfile" "$cache" | bemenu --fixed-height --fn 'JetBrainsMono Nerd for (f in history) print history[f],f | "sort -t '\t' -k1rn >" histfile } - ' \ - | while read cmd; do ${SHELL:-"/bin/sh"} -c "$cmd" & done + ' | + while read cmd; do ${SHELL:-"/bin/sh"} -c "$cmd" & done diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index b6b9f88..6230fae 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -1,15 +1,12 @@ # See https://wiki.hyprland.org/Configuring/Monitors/ monitor=,highrr,auto,1.6,bitdepth,10 -#monitor=,2880x1800@60.000999,auto,1.6,bitdepth,10 +#monitor=,2880x1800@120,auto,1.6,bitdepth,10 $hypr_dir="$HOME/.config/hypr" -$accent=5E88DD +$accent=D81860 #envs -#env = LIBVA_DRIVER_NAME,nvidia env = XDG_SESSION_TYPE,wayland -#env = GBM_BACKEND,nvidia-drm -#env = __GLX_VENDOR_LIBRARY_NAME,nvidia env = WLR_NO_HARDWARE_CURSORS,1 env = GLOBAL_ACCENT,$accent @@ -142,6 +139,7 @@ bind = $mainMod, F4, exec, $HOME/repos_scripts/ani-new bind = $mainMod, F5, exec, $hypr_dir/wifi bind = $mainMod, return, exec, [workspace 2] foot bind = $mainMod, Q, exec, $hypr_dir/dmenu_run_history +bind = $mainMod, G, exec, $hypr_dir/rungame bind = $mainMod, A, exec, [workspace 1] google-chrome-stable bind = $mainMod, C, exec, [workspace 3] code bind = $mainMod, E, exec, [workspace 3] pcmanfm @@ -181,14 +179,14 @@ windowrulev2=workspace 4,class:^(pavucontrol)$ windowrulev2=workspace 4,class:^(org.freedesktop.Xwayland)$ windowrulev2=fullscreen,class:^(org.freedesktop.Xwayland)$ windowrulev2=workspace 4,class:^(virt-manager)$ -windowrulev2 = bordercolor rgba(D81860FF), xwayland: 1 +windowrulev2 = bordercolor rgba(64f2a4FF), xwayland: 1 #startup applications exec-once=dbus-update-activation-environment --systemd --all exec-once=ssh-agent exec-once=/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 exec-once=node $HOME/github/arrpc/src > /tmp/arrpc-log -exec-once=swaybg -i $HOME/.config/wall/18.png +exec-once=swaybg -i $HOME/.config/wall/9.png exec-once=xrdb -merge $HOME/.config/.Xresource exec-once=$hypr_dir/workspace 'focus' exec-once=$hypr_dir/battery diff --git a/hypr/rungame b/hypr/rungame new file mode 100755 index 0000000..a47c794 --- /dev/null +++ b/hypr/rungame @@ -0,0 +1,15 @@ +#!/bin/sh + +gamedir="$HOME/games" + +game=$(find "$gamedir" -maxdepth 2 -type f -name '*.exe' -executable | sed "s|$gamedir/||g;/unin.*/d" | bemenu --fn 'JetBrainsMono Nerd Font 15' -i -c -W 0.5 -B 3 -p "PLAY GAME: " -l 15 -P ">>" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT") + +[ -z "$game" ] && notify-send -h "string:x-canonical-private-synchronous:${0##*/}" -u critical "No game selected" && exit 1 + +cd "$(dirname "$gamedir"/"$game")" || (notify-send -h "string:x-canonical-private-synchronous:${0##*/}" -u critical "Directory Not found" && exit 1) + +gamename=$(basename "$game") + +notify-send -h "string:x-canonical-private-synchronous:${0##*/}" -i "wine" "Launching $gamename" + +RADV_PERFTEST=gpl DXVK_ASYNC=1 gamemoderun mangohud wine "$gamename" diff --git a/hypr/screenshot b/hypr/screenshot index fcee975..b822e9a 100755 --- a/hypr/screenshot +++ b/hypr/screenshot @@ -3,5 +3,5 @@ icon="/usr/share/icons/Papirus/16x16/apps/applets-screenshooter.svg" killall grim slurp [ "$*" = "fullclip" ] && grim - | wl-copy -t image/png && notify-send -i "$icon" "Screenshot copied to clipboard" -[ "$*" = "fullsave" ] && grim && notify-send -i "$icon" "Screenshot saved" +[ "$*" = "fullsave" ] && grim "$HOME/Pictures/$(date -u "+%Y-%m-%d_%H-%M-%S").png" && notify-send -i "$icon" "Screenshot saved" [ "$*" = "selclip" ] && grim -g "$(slurp)" - | wl-copy -t image/png && notify-send -i "$icon" "Screenshot copied to clipboard" diff --git a/zsh/zshrc b/zsh/zshrc index 5b5c5b4..ab628da 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -51,7 +51,7 @@ b64() { } mkvcinemas() { - local base_url="https://mkvcinemas.zip" + local base_url="https://mkvcinemas.rsvp" local agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" [ -z "$*" ] && printf "Search> " && read -r query || query="$*" @@ -60,7 +60,7 @@ mkvcinemas() { [ -z "$movie" ] && printf "No Movie Found/Selected." && return 1 - local url=$(curl -s "$base_url/$movie" -e "$base_url" -LA "$agent" | sed -nE 's|.*"gdlink" title="([^"]*)" href="([^"]*)".*|\2~\1|p' data | fzf -0 -d'~' --with-nth 2.. --layout=reverse --height=20 --border | cut -d'~' -f1) + local url=$(curl -s "$base_url/$movie" -e "$base_url" -LA "$agent" | sed 's||\n|g' | sed -nE 's|.*title="([^"]*)" href="([^"]*)" target.*[>|;](.*)<.*|\2`[\3] \1|p;' | fzf -0 -d'`' --with-nth 2.. --layout=reverse --height=20 --border | cut -d'`' -f1) [ -z "$url" ] && printf "No Url Selected" && return 1 xdg-open "$url" }