diff --git a/.config/eww/eww.scss b/.config/eww/eww.scss new file mode 100644 index 0000000..6777aea --- /dev/null +++ b/.config/eww/eww.scss @@ -0,0 +1,14 @@ +@import '../theming/library/entry.scss' + +.background { + background: none; +} + +.widget { + box-shadow: $box-shadow-inner-less; + background: $background; + border-radius: $border-radius; + border: 1px solid $border-color; +} + +@import "./widgets/media/style.scss" diff --git a/.config/eww/eww.yuck b/.config/eww/eww.yuck new file mode 100644 index 0000000..c220bc5 --- /dev/null +++ b/.config/eww/eww.yuck @@ -0,0 +1 @@ +(include "./widgets/media/media.yuck") diff --git a/.config/eww/widgets/media/media.yuck b/.config/eww/widgets/media/media.yuck new file mode 100644 index 0000000..7406540 --- /dev/null +++ b/.config/eww/widgets/media/media.yuck @@ -0,0 +1,97 @@ +(deflisten media-info :initial '{}' `~/.config/scripts/playerctl-metadata-json.sh`) +(deflisten media-status :initial 'stopped' 'playerctl status --follow') +(defpoll media-playback-info :interval '1s' :initial '0' `playerctl position`) + +(defvar statusIcons '{"Playing": "player_play", "Paused": "player_pause"}') + +(defvar media-close-time 0) + +(defwidget icon-button [icon onclick] + (button + :onclick {onclick} + :vexpand false + + (image :icon {icon}) + ) +) + +(defwidget media-label [text ?class] + (label :text {text} :xalign "0" :class {class}) +) + +(defwidget media-texts [] + (box + :orientation "vertical" + :hexpand true + :valign "center" + :halign "start" + :space-evenly false + (media-label :class "header" :text {media-info["xesam:title"]}) + (media-label :text {media-info["xesam:artist"]}) + (media-label :text {media-info["xesam:album"]}) + ) +) + +(defwidget media-control [] + (box + :visible {EWW_TIME < media-close-time} + :class "widget" + :width 512 + :space-evenly false + :orientation "v" + + (box + :class "data-display" + :valign "center" + :halign "start" + :space-evenly false + :spacing 20 + (box + :width {512 - 128} + + :space-evenly false + :orientation "vertical" + :spacing 10 + (media-texts) + (box + :hexpand true + :vexpand true + :spacing 10 + (icon-button + :icon "player_rew" + :onclick "~/.config/scripts/media.sh previous" + ) + + (icon-button + :icon {statusIcons[media-status] ?: "player_stop"} + :onclick "~/.config/scripts/media.sh play-pause" + ) + (icon-button + :icon "player_fwd" + :onclick "~/.config/scripts/media.sh next" + ) + ) + ) + + (image + :path {substring(media-info["mpris:artUrl"], 7, 8000)} + :image-width 128 + ) + ) + (progress + :height 1 + :value {jq(media-playback-info, "tonumber(.)") / (jq(media-info["mpris:length"] ?: 1000, "tonumber(.)") / 1000000) * 100} + ) + ) +) +(defwindow media + :monitor 1 + :geometry (geometry + :x "10px" + :y "50px" + :width "512px" + :height "10%" + :anchor "top right") + :stacking "fg" + (media-control) + ) diff --git a/.config/eww/widgets/media/style.scss b/.config/eww/widgets/media/style.scss new file mode 100644 index 0000000..1372ac9 --- /dev/null +++ b/.config/eww/widgets/media/style.scss @@ -0,0 +1,25 @@ +.media { + transition: opacity 0.2s ease-in-out; + opacity: 1; + + .closed { + opacity: 0; + } + + .data-display { + padding: 1rem; + } + + label { + font-size: 1.5rem; + &.header { + font-size: 2rem; + font-weight: bolder; + } + } + + progressbar { + padding: 0 1rem; + } +} + diff --git a/.config/hypr/config/LayerRules.conf b/.config/hypr/config/LayerRules.conf index 314de83..a70993e 100644 --- a/.config/hypr/config/LayerRules.conf +++ b/.config/hypr/config/LayerRules.conf @@ -1,4 +1,5 @@ layerrule = blur, gtk-layer-shell +layerrule = ignorezero, gtk-layer-shell layerrule = blur, logout_dialog layerrule = blur, waybar diff --git a/.config/hypr/config/keybinds/MediaCtrl.conf b/.config/hypr/config/keybinds/MediaCtrl.conf index 9f4f66e..c855677 100644 --- a/.config/hypr/config/keybinds/MediaCtrl.conf +++ b/.config/hypr/config/keybinds/MediaCtrl.conf @@ -9,9 +9,9 @@ bindl = , xf86AudioMicMute, exec, $scriptsDir/Volume.sh --toggle-mic # mic mute bindl = , xf86audiomute, exec, $scriptsDir/Volume.sh --toggle # mute # media controls using keyboards -bindl = , xf86AudioPlayPause, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioPause, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioPlay, exec, $scriptsDir/MediaCtrl.sh --pause -bindl = , xf86AudioNext, exec, $scriptsDir/MediaCtrl.sh --nxt -bindl = , xf86AudioPrev, exec, $scriptsDir/MediaCtrl.sh --prv -bindl = , xf86audiostop, exec, $scriptsDir/MediaCtrl.sh --stop +bindl = , xf86AudioPlayPause, exec, $scriptsDir/media.sh play-pause +bindl = , xf86AudioPause, exec, $scriptsDir/media.sh pause +bindl = , xf86AudioPlay, exec, $scriptsDir/media.sh play-pause +bindl = , xf86AudioNext, exec, $scriptsDir/media.sh next +bindl = , xf86AudioPrev, exec, $scriptsDir/media.sh previous +bindl = , xf86audiostop, exec, $scriptsDir/media.sh stop diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index a8c2ae4..cb75745 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -45,5 +45,6 @@ "typst.vim": { "branch": "main", "commit": "323539709e29a537ff39dfce6c05f175a8921504" }, "which-key.nvim": { "branch": "main", "commit": "904308e6885bbb7b60714c80ab3daf0c071c1492" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }, - "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } + "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" }, + "yuck.vim": { "branch": "master", "commit": "9b5e0370f70cc30383e1dabd6c215475915fe5c3" } } diff --git a/.config/nvim/lua/plugins/yuck.lua b/.config/nvim/lua/plugins/yuck.lua new file mode 100644 index 0000000..91918cb --- /dev/null +++ b/.config/nvim/lua/plugins/yuck.lua @@ -0,0 +1 @@ +return { "elkowar/yuck.vim", config = function() end } diff --git a/.config/scripts/media.sh b/.config/scripts/media.sh new file mode 100755 index 0000000..75026c3 --- /dev/null +++ b/.config/scripts/media.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +EWW_VARIABLE_NAME="media-close-time" +EWW_DISPLAY_TIME=10 + +case "$1" in +"play-pause" | "stop" | "next" | "previous") + playerctl "$1" + ;; +"display") + EWW_DISPLAY_TIME=${2:-10} + ;; +*) + echo "Invalid Entry" + exit 1 + ;; +esac + +eww update "$EWW_VARIABLE_NAME=$(($(date +%s) + $EWW_DISPLAY_TIME))" diff --git a/.config/scripts/playerctl-metadata-json.sh b/.config/scripts/playerctl-metadata-json.sh new file mode 100755 index 0000000..850e153 --- /dev/null +++ b/.config/scripts/playerctl-metadata-json.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +formatReturn() { + playerctl metadata | jq -R -s -c -r 'split("\n") | map(match("(\\w+) {1}([\\w:]+) {3,}(.+)") | {(.captures[1].string): .captures[2].string}) | add' + +} + +playerctl --follow metadata | while read line; do + ~/.config/scripts/media.sh display 5 + formatReturn + +done diff --git a/.config/yadm/bootstrap.v2/applications/20-Theming.sh b/.config/yadm/bootstrap.v2/applications/20-Theming.sh index 7272e4e..9cec6c0 100755 --- a/.config/yadm/bootstrap.v2/applications/20-Theming.sh +++ b/.config/yadm/bootstrap.v2/applications/20-Theming.sh @@ -1,6 +1,6 @@ #!/bin/env sh -addApplications python-pywal sass npm +addApplications python-pywal sass npm eww addGitInstall "image-glsl-processing" "https://github.com/Neintonine/image-glsl-processing.git" setup_image_glsl_processing diff --git a/.gitignore b/.gitignore index 21d60f7..4e88781 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ !/.config/xdg-desktop-portal/ !/.config/xdg-desktop-portal-termfilechooser/ !/.config/scripts/ +!/.config/eww/ !/.config/systemd/ /.config/systemd/* !/.config/systemd/user/