From f9dc5f87594fba33606090a5f85a5d428d8634f8 Mon Sep 17 00:00:00 2001 From: coolnsx Date: Mon, 1 May 2023 13:50:56 +0530 Subject: [PATCH] All your codebase are belong to us. --- .gitmodules | 3 +++ eww/music-presence.py | 13 +++++++++++++ fzf-tab | 1 + hypr/bkmark | 36 ++++++++++++++++++++++++++++++++++++ mpv/mpv.conf | 1 + 5 files changed, 54 insertions(+) create mode 100644 .gitmodules create mode 100644 eww/music-presence.py create mode 160000 fzf-tab create mode 100755 hypr/bkmark create mode 100644 mpv/mpv.conf diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7421e00 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "fzf-tab"] + path = fzf-tab + url = https://github.com/Aloxaf/fzf-tab diff --git a/eww/music-presence.py b/eww/music-presence.py new file mode 100644 index 0000000..aba2320 --- /dev/null +++ b/eww/music-presence.py @@ -0,0 +1,13 @@ +from pypresence import Presence +import re, json +from time import time + + +RPC = Presence("1086258743823564903") + +RPC.connect() + +with open("/tmp/yt-music/current",'r') as file: + li = re.split(' >|: | - ',file.readline().strip('\n')) + file.close() +RPC.update(large_image=f"https://i.ytimg.com/vi/{li[-1]}/mqdefault.jpg",details=f"{li[1]}",state=li[2],small_image="/home/tanveer/Downloads/kisspng-mpv-logo-computer-software-5b0b2bfe514221.6053513215274588143328.png",start=time.time()) diff --git a/fzf-tab b/fzf-tab new file mode 160000 index 0000000..5a81e13 --- /dev/null +++ b/fzf-tab @@ -0,0 +1 @@ +Subproject commit 5a81e13792a1eed4a03d2083771ee6e5b616b9ab diff --git a/hypr/bkmark b/hypr/bkmark new file mode 100755 index 0000000..8f75ef1 --- /dev/null +++ b/hypr/bkmark @@ -0,0 +1,36 @@ +#!/bin/sh + +#script for bookmarking selected items and later using it.. + +data="$(wl-paste -p | tr '\n' '\`' | sed 's/$/ /g')" + +file="$HOME/.cache/bookmarks" +oshi_file="$HOME/.cache/oshi-urls" + +case $1 in + add) + if [ -z "$data" ];then + notify-send "Please select anything to bookmark" + elif grep -q "${data}" "$file";then + notify-send -i "bookmark-missing" "Already bookmarked" + else + printf "%s" "$data" >> "$file" + notify-send -i "user-bookmarks" "Bookmarked" "$data" + fi + ;; + rm) + data="$(sed '/^$/d' "$file" | nl -n'ln')" + [ -z "$data" ] && notify-send "Bookmark is empty" && exit 0 + del=$(printf "%s" "$data" | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "delete-bookmark :" | cut -f1) + [ -z "$del" ] || (sed -i "${del}d" "$file" && notify-send -i "bookmark-missing" "Bookmark deleted" -u critical) + ;; + copy) + sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "Put-bookmark :" | tr '\`' '\n' | wl-copy && notify-send "Copied to clipboard" -i "com.github.davidmhewitt.clipped" + ;; + *) + wtype -d 10 "$(sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | bemenu --fn 'Roboto 15' -i -c -W 0.6 -B 3 -l 30 -p "Put-bookmark :" | tr '\`' '\n')" + ;; +esac + +sed -i '/^$/d' "$file" +printf "\n" >> "$file" diff --git a/mpv/mpv.conf b/mpv/mpv.conf new file mode 100644 index 0000000..b7edad4 --- /dev/null +++ b/mpv/mpv.conf @@ -0,0 +1 @@ +#hwdec=auto