needs more cow bell

This commit is contained in:
coolnsx
2024-05-08 11:29:40 +05:30
parent d61cca5ee6
commit b682387f38
10 changed files with 57 additions and 38 deletions

1
.gitignore vendored
View File

@@ -22,3 +22,4 @@ btop
xpra
psysh
zoom*
.env

View File

@@ -103,7 +103,7 @@
frame_width = 3
# Defines color of the frame around the notification window.
frame_color = "#D81860"
frame_color = "#6FAAFF"
# Size of gap to display between notifications - requires a compositor.
# If value is greater than 0, separator_height will be ignored and a border

11
env.example Normal file
View File

@@ -0,0 +1,11 @@
NTFY_URL=
NTFY_TOKEN=
DISCORD_URL=
DISCORD_TOKEN=
DISCORD_SERVER_ID=
NC_URL=
NC_USER=
NC_TOKEN=
NC_SHARE_PATH=

View File

@@ -4,8 +4,10 @@ datadir="/tmp/yt-music"
case $1 in
songdata)
if [ -f "$datadir/current" ];then
# shellcheck source=/tmp/yt-music/current
. "$datadir/current"
out=$(printf '{ "command": ["get_property", "pause"]}\n' | socat - "$datadir/yt-music-mpvsocket" 2>/dev/null)
printf '{"name":"%s","artist":"%s","cover":"%s","next":"%s","prev":"%s"}' "$(cut -d'>' -f1 < "$datadir/current" | cut -d':' -f2- | sed 's|[^-]*$||g;s|-$||g;s| $||g;s|^ ||g')" "$(cut -d'>' -f1 < "$datadir/current" | sed 's_.* - __;s| $||')" "$datadir/default.jpg" "$(sed -n "/$(cut -d'>' -f2 < "$datadir/current" )/{n;p}" $datadir/next | cut -f1)" "$(sed -n "$(cat $datadir/counter)p" $datadir/next | cut -f1)"
printf '{"name":"%s","artist":"%s","cover":"%s","next":"%s","prev":"%s"}' "$SONG" "$ARTIST" "$datadir/default.jpg" "$(sed -n "/$ID/{n;p}" $datadir/next | cut -f1)" "$(sed -n "$(cat $datadir/counter)p" $datadir/next 2>/dev/null | cut -f1)"
else
printf '{"name":"OFFLINE","artist":"offline","cover":"%s/.config/eww/music.png"}' "$HOME"
fi
@@ -41,6 +43,6 @@ case $1 in
pgrep -f mpvsocket >/dev/null 2>&1 && counter=$(cat "$datadir/counter") && [ "$counter" -gt 0 ] && "$HOME/repos_scripts/yt-music" play "$(sed -n "${counter}p" "$datadir/next")" && printf "%s" "$((counter-1))" > "$datadir/counter" &
;;
seek)
echo "{\"command\" :[\"seek\" ,\"$2\",\"relative-percent\"]}" | socat - "$datadir/yt-music-mpvsocket"
echo '{"command" :["seek" ,"'"$2"'","relative-percent"]}' | socat - "$datadir/yt-music-mpvsocket"
;;
esac

View File

@@ -29,7 +29,9 @@ case $1 in
[ -z "$del" ] || (sed -i "${del}d" "$file" && notify-send -e -i "bookmark-missing" "Bookmark deleted" -u critical)
;;
copy)
sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | menu "COPY-bookmark :" | tr '\`' '\n' | wl-copy && notify-send -e "Copied to clipboard" -i "com.github.davidmhewitt.clipped"
data=$(sed '/^$/d' "$file" "$oshi_file" | sed -E 's/.*DL: ([^|]*).*/\1/g' | menu "COPY-bookmark :" | 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')"

View File

@@ -1,6 +1,6 @@
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,highrr,auto,1.5,bitdepth,10
monitor=HDMI-A-1,3840x2160,auto,2,bitdepth,10
#monitor=HDMI-A-1,3840x2160,auto,2,bitdepth,10
$hypr_dir="$HOME/.config/hypr"
$accent=6FAAFF
@@ -185,42 +185,41 @@ bind = $mainMod, F12, exec, $hypr_dir/date
bind = $mainMod, Delete, exec, $hypr_dir/workspace 'list'
#media keys
binde=, XF86AudioLowerVolume, exec, pamixer --set-limit 140 --allow-boost -d 2 && $hypr_dir/volume
binde=, XF86AudioRaiseVolume, exec, pamixer --set-limit 140 --allow-boost -i 2 && $hypr_dir/volume
binde=, XF86AudioMute, exec, pamixer --set-limit 140 --allow-boost -t && $hypr_dir/volume
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=, XF86Launch2, exec, $HOME/repos_scripts/yt-music search_play #why not :)
binde=, XF86AudioNext, exec, $HOME/repos_scripts/yt-music play_next
binde=, XF86AudioPrev, exec, $HOME/repos_scripts/yt-music play_next menu
binde=, XF86MonBrightnessUp, exec, $hypr_dir/brightness '+'
binde=, XF86MonBrightnessDown, exec, $hypr_dir/brightness '-'
binde =, XF86AudioLowerVolume, exec, pamixer --set-limit 140 --allow-boost -d 2 && $hypr_dir/volume
binde =, XF86AudioRaiseVolume, exec, pamixer --set-limit 140 --allow-boost -i 2 && $hypr_dir/volume
binde =, XF86AudioMute, exec, pamixer --set-limit 140 --allow-boost -t && $hypr_dir/volume
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 =, XF86Launch2, exec, $HOME/repos_scripts/yt-music search_play #why not :)
binde =, XF86AudioNext, exec, $HOME/repos_scripts/yt-music play_next
binde =, XF86AudioPrev, exec, $HOME/repos_scripts/yt-music play_next menu
binde =, XF86MonBrightnessUp, exec, $hypr_dir/brightness '+'
binde =, XF86MonBrightnessDown, exec, $hypr_dir/brightness '-'
#windows rules
windowrulev2=workspace 1,class:^(google-chrome)$
windowrulev2=workspace 1,class:^(firefox)$
windowrulev2=workspace 4,class:^(Google-chrome)$
windowrulev2=workspace 3,class:^(mpv)$
windowrulev2=workspace 3,class:^([c|C]ode)
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(64f2a4FF), xwayland: 1
windowrulev2 = workspace 1,class:^(google-chrome)$
windowrulev2 = workspace 1,class:^(firefox)$
windowrulev2 = workspace 4,class:^(Google-chrome)$
windowrulev2 = workspace 3,class:^(mpv)$
windowrulev2 = workspace 3,class:^([c|C]ode)
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(64f2a4FF), xwayland: 1
#workspace rules
#workspace = 1, on-created-empty:-chrome-stable
workspace = 1, on-created-empty:$browser
workspace = 2, on-created-empty:foot
workspace = special, on-created-empty:[float] foot
#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/3.png -m fill
exec-once=sleep 5 && xrdb -merge $HOME/.config/.Xresource
exec-once=$hypr_dir/workspace 'focus'
exec-once=$hypr_dir/battery
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/3.png -m fill
exec-once = sleep 5 && xrdb -merge $HOME/.config/.Xresource
exec-once = $hypr_dir/workspace 'focus'
exec-once = $hypr_dir/battery
#exec-once=sleep 2 && $hypr_dir/workspace

View File

@@ -5,6 +5,7 @@ top -ibn5 -d1 | while read -r line;do
new_mem=$(printf "%s" "$line" | sed -nE 's_MiB Mem :[[:space:]]*(.*) total,.*,[[:space:]]*(.*) used,.*_\2 MB / \1 MB_p')
cpu=${new_cpu:-$cpu}
mem=${new_mem:-$mem}
[ -f "/tmp/yt-music/current" ] && . /tmp/yt-music/current
if [ -n "$new_mem" ];then
temp=$(cat /sys/class/thermal/thermal_zone0/temp)
@@ -14,6 +15,6 @@ top -ibn5 -d1 | while read -r line;do
charge=$(cat /sys/class/power_supply/BAT0/capacity)
[ "$bat_stats" = "Discharging" ] && { [ "$charge" -lt 20 ] && bat_icon=🪫 || bat_icon=🔋 ;} || bat_icon=🔌
[ "$vol_stats" = "muted" ] && vol_icon=🔇 || vol_icon=🔊
notify-send -e -i "lol" "<----------(STATS)---------->" "🧠 CPU usage : $cpu\n🌡 Cpu Temp : $temp °C\n🔳 RAM : $mem\n$bat_icon Battery : $charge (${bat_stats})\n☀ Brightness : $("$(dirname "$0")"/brightness s)%\n$vol_icon Volume : $vol_stats\n🎵 $(cut -d ">" -f1 /tmp/yt-music/current 2>/dev/null | cut -d":" -f2)" -h "string:x-canonical-private-synchronous:${0##*/}" -t 1500 &
notify-send -e -i "lol" "<----------(STATS)---------->" "🧠 CPU usage : $cpu\n🌡 Cpu Temp : $temp °C\n🔳 RAM : $mem\n$bat_icon Battery : $charge (${bat_stats})\n☀ Brightness : $("$(dirname "$0")"/brightness s)%\n$vol_icon Volume : $vol_stats\n🎵 $SONG - $ARTIST" -h "string:x-canonical-private-synchronous:${0##*/}" -t 1500 &
fi
done

View File

@@ -25,7 +25,7 @@ underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3v\0\0\x4U\0\0\0\0\0\0\0\0\0\0\a\x7f\0\0\x4\x37\0\0\0\0\x2\0\0\0\a\a\0\0\0\0\0\0\0\0\0\0\x3v\0\0\x4U)
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xb3\0\0\x4\xa1\0\0\0\0\0\0\0\0\0\0\x3\xbf\0\0\x4\xaf\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xb3\0\0\x4\xa1)
[Troubleshooting]
force_raster_widgets=1

View File

@@ -25,7 +25,7 @@ underline_shortcut=1
wheel_scroll_lines=3
[SettingsWindow]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\aq\0\0\x4)\0\0\0\0\0\0\0\0\0\0\aq\0\0\x4)\0\0\0\0\0\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\aq\0\0\x4))
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\0\0\0\0\0\0\0\x3\xb3\0\0\x4\xa1\0\0\0\0\0\0\0\0\0\0\x3\xbf\0\0\x4\xaf\0\0\0\0\x2\0\0\0\a\x80\0\0\0\0\0\0\0\0\0\0\x3\xb3\0\0\x4\xa1)
[Troubleshooting]
force_raster_widgets=1

View File

@@ -39,6 +39,7 @@ megamind() {
printf '\n'
unset len
}
gtb() {
[ -z "$*" ] && br=$(git branch -a | fzf --border=rounded --layout=reverse --height=10 | tr -d ' ') || br=$*
[ -z "$br" ] || git checkout $br
@@ -148,7 +149,7 @@ rmpkg() {
paru -Qq | fzf --preview 'paru -Si {} | bat --language=yaml --color=always -pp' --preview-window right:65%:wrap -m | paru -Rcns -
}
# Lines configured by zsh-newuser-install
# Alias and exports
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export TZ="Asia/Kolkata"
alias cat="bat -pp --color=always"
@@ -167,6 +168,7 @@ alias nchh="nvim ~/.config/hypr/hyprland.conf"
alias shfmt="shfmt -ci -d -w"
alias reboot_firmware="systemctl reboot --firmware-setup"
#config
HISTFILE=~/.histfile
HISTSIZE=500
SAVEHIST=500
@@ -180,6 +182,7 @@ autoload -Uz compinit
compinit
zstyle ':completion:*' menu select
eval "$(starship init zsh)"
#plugins
[ -f "/usr/share/nvm/init-nvm.sh" ] && source /usr/share/nvm/init-nvm.sh
[ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] && source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh