diff --git a/.zshrc b/.zshrc index caaa566..88658c3 100644 --- a/.zshrc +++ b/.zshrc @@ -34,20 +34,19 @@ clshist() { } v() { - [ -z "$*" ] && file=$(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}' -m) || file=$* - nvim -O $file + [ -z "$*" ] && nvim -O $(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}' -m | tr '\n' ' ') || nvim -O $* } help() { - "$@" --help 2>&1 | bat -pp --language=help + "$@" --help 2>&1 | bat --plain --language=help } addpkg(){ - paru -Ss "$*" | sed -nE 's|^[a-z]*/([^ ]*).*|\1|p' | fzf --preview 'paru -Si {} | bat --language=yaml --color=always -pp' --preview-window right:65%:wrap | paru -S - + paru -Ss "$*" | sed -nE 's|^[a-z]*/([^ ]*).*|\1|p' | fzf --preview 'paru -Si {} | bat --language=yaml --color=always -pp' --preview-window right:65%:wrap -m | paru -S - } rmpkg(){ - paru -Qs "$*" | sed -nE 's|^[a-z]*/([^ ]*).*|\1|p' | fzf --preview 'paru -Si {} | bat --language=yaml --color=always -pp' --preview-window right:65%:wrap | paru -Rcns - + 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 @@ -59,7 +58,7 @@ export VIDEO="mpv" export WM="hyprland" export IMAGE="nsxiv" alias cat="bat -pp" -alias anime="$HOME/lol/ani-cli" +alias anime="$HOME/ani-cli/ani-cli" alias cp="cp -v" alias rm="rm -v" alias mv="mv -v" diff --git a/QtProject.conf b/QtProject.conf index 2106c6d..f39e099 100644 --- a/QtProject.conf +++ b/QtProject.conf @@ -1,7 +1,7 @@ [FileDialog] -history=file:///home/tanveer, file:///home/tanveer/softwares and isos, file:///home/tanveer/Downloads +history=@Invalid() lastVisited=file:///home/tanveer -qtVersion=6.4.1 +qtVersion=5.15.7 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) diff --git a/btop/btop.conf b/btop/btop.conf index e17b911..ee6c395 100644 --- a/btop/btop.conf +++ b/btop/btop.conf @@ -160,7 +160,7 @@ show_swap = True swap_disk = True #* If mem box should be split to also show disks info. -show_disks = False +show_disks = True #* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar. only_physical = True diff --git a/eww/eww.scss b/eww/eww.scss new file mode 100644 index 0000000..0248dce --- /dev/null +++ b/eww/eww.scss @@ -0,0 +1,102 @@ +* { + all: unset; +} + + +/** Background ***************************************/ +.bg { + background-color: rgba(0,0,0,0); + opacity: 0; +} + +/** Generic window ***********************************/ +.genwin { + background-color: rgba(0,0,0,0); + border-radius: 16px; +} + +/** Clock ********************************************/ +.time_hour, .time_min { + color: #DA0F67; + font-size : 70px; + font-weight : bold; +} +.time_hour { + margin : 15px 0px 0px 20px; +} +.time_min { + margin : 0px 0px 10px 0px; +} + +.time_mer { + color: #A3BE8C; + font-size : 40px; + font-weight : bold; + margin : 20px 0px 0px 0px; +} + +.time_day { + color: #EBCB8B; + font-size : 30px; + font-weight : normal; + margin : 0px 0px 20px -20px; +} + +/** Music ***************************************/ +.album_art { + background-size: cover; + background-repeat:no-repeat; + background-color: rgba(0,0,0,0); + min-height: 210px; + min-width: 210px; + margin: 0px 50px 0px 0px; + border-radius: 15px; + border-style:none; +} + +.song { + color: #DA0F67; + font-size : 24px; + font-weight : bold; + margin : 5px 0px 0px 0px; +} + +.artist { + color: #EBCB8B; + font-size : 20px; + font-weight : normal; + margin : 0px 0px -10px 0px; +} + +.btn_play { + margin : 0px 0px 0px 0px; + color: #A3BE8C; + font-size : 70px; + font-weight : bold; +} + +.btn_prev { + color: #EBCB8B; + font-size : 32px; + font-weight : normal; +} + +.btn_next { + color: #EBCB8B; + font-size : 32px; + font-weight : normal; +} + +.music_bar scale trough highlight { + all: unset; + background-image: linear-gradient(to right, #8A3288 30%, #8A32AA 50%, #8A326F 100% *50); + border-radius: 24px; +} +.music_bar scale trough { + all: unset; + background-color: #232232; + border-radius: 24px; + min-height: 13px; + min-width: 190px; + margin : -22px 0px 10px 0px; +} diff --git a/eww/eww.yuck b/eww/eww.yuck new file mode 100644 index 0000000..801c508 --- /dev/null +++ b/eww/eww.yuck @@ -0,0 +1,89 @@ +;;time +(defwindow time_1 + :monitor 1 + :geometry (geometry :x "-10px" + :y "30px" + :width "20%" + :height "200px" + :anchor "top right") + :stacking "bg" + :reserve (struts :distance "40px" :side "top") + :windowtype "dock" + :wm-ignore false + (clock)) + +(defwindow time_0 + :monitor 0 + :geometry (geometry :x "-10px" + :y "20px" + :width "20%" + :height "200px" + :anchor "top right") + :stacking "bg" + :reserve (struts :distance "40px" :side "top") + :windowtype "dock" + :wm-ignore false + (clock)) + +(defpoll HOUR :interval "5s" `date +\"%I\"`) +(defpoll MIN :interval "5s" `date +\"%M\"`) +(defpoll MER :interval "5s" `date +\"%p\"`) +(defpoll DAY :interval "5s" `date +\"%A\"`) + +(defwidget clock [] + (box :class "genwin" :orientation "h" :spacing 50 :space-evenly false :vexpand "false" :hexpand "false" + (box :orientation "h" :spacing 0 + (label :class "time_hour" :valign "start" :wrap "true" :limit-width 25 :text HOUR) + (label :class "time_min" :valign "end" :wrap "true" :limit-width 25 :text MIN)) + (box :orientation "v" :spacing 0 + (label :class "time_mer" :valign "start" :halign "end" :wrap "true" :limit-width 25 :text MER) + (label :class "time_day" :valign "end" :halign "end" :wrap "true" :limit-width 25 :text DAY)))) + +;; music +(defwindow music_0 + :monitor 0 + :geometry (geometry :x "50" + :y "50" + :width "20%" + :height "0px" + :anchor "bottom left") + :stacking "bg" + :reserve (struts :distance "10px" :side "bottom") + :windowtype "dock" + :wm-ignore true + (music)) + +(defwindow music_1 + :monitor 1 + :geometry (geometry :x "50" + :y "50" + :width "20%" + :height "0px" + :anchor "bottom left") + :stacking "bg" + :reserve (struts :distance "10px" :side "bottom") + :windowtype "dock" + :wm-ignore true + (music)) + +(defpoll SONG :interval "1s" `./script song`) +(defpoll ARTIST :interval "1s" `./script artist`) +(defpoll STATUS :interval "0.5s" `./script status`) +(defpoll COVER :interval "1s" `./script cover`) +(defpoll CURRENT :interval "1s" `./script time`) + +(defwidget music [] + (box :class "genwin" :orientation "h" :space-evenly "false" :vexpand "true" :hexpand "false" + (box :class "album_art" :vexpand "false" :hexpand "false" :style "background-image: url('${COVER}');") + (box :orientation "v" :spacing 20 :space-evenly "false" :vexpand "false" :hexpand "false" + (label :halign "center" :class "song" :wrap "false" :limit-width 40 :text SONG) + (label :halign "center" :class "artist" :wrap "false" :text ARTIST) + (box :orientation "h" :spacing 20 :halign "center" :space-evenly "true" :vexpand "false" :hexpand "false" + (button :class "btn_prev" :onclick "./script prev" "玲") + (button :class "btn_prev" :onclick "./script seek '-1'" "") + (button :class "btn_play" :onclick "./script play_toggle" STATUS) + (button :class "btn_next" :onclick "./script seek '1'" "") + (button :class "btn_next" :onclick "./script next" "怜")) + (box :class "music_bar" :halign "center" :vexpand "false" :hexpand "false" :space-evenly "false" + (scale :min 0 :active "true" :max 100 :value CURRENT)) + ))) diff --git a/eww/music.png b/eww/music.png new file mode 100644 index 0000000..3ded333 Binary files /dev/null and b/eww/music.png differ diff --git a/eww/script b/eww/script new file mode 100755 index 0000000..57a622c --- /dev/null +++ b/eww/script @@ -0,0 +1,52 @@ +#!/bin/sh + + +out=$(echo '{ "command": ["get_property", "pause"]}' | socat - /tmp/mpvsocket 2>/dev/null) +case $1 in + song) + if [ -n "$out" ];then + cut -d'>' -f1 < "$HOME/.cache/yt-music/current" | cut -d':' -f2 | sed 's|[^-]*$||;s|-$||' + else + echo "Offline" + fi + ;; + artist) + if [ -n "$out" ];then + cut -d'>' -f1 < "$HOME/.cache/yt-music/current" | sed 's_.* -__' + else + echo "Offline" + fi + ;; + cover) + if [ -n "$out" ];then + echo "$HOME/.cache/yt-music/default.jpg" + else + echo "$HOME/.config/eww/music.png" + fi + ;; + status) + if [ -z "$out" ];then + printf "" + elif printf "%s" "$out" | grep -q "true";then + echo "喇" + else + echo "" + fi + ;; + play_toggle) + echo cycle pause | socat - "/tmp/mpvsocket" + ;; + next) + $HOME/repos_scripts/yt-music play_next >/dev/null + ;; + prev) + $HOME/repos_scripts/yt-music play "$(sed 's| >|\t|g' $HOME/.cache/yt-music/prev | cut -d':' -f2)" + ;; + time) + out=$(echo '{"command" :["get_property" , "percent-pos"]}' | socat - /tmp/mpvsocket 2>/dev/null | sed -nE 's_.*data":([^,]*).*_\1_p') + [ -z "$out" ] && echo "0" || echo "$out" + ;; + seek) + echo "{\"command\" :[\"seek\" ,\"$2\",\"relative-percent\"]}" | socat - /tmp/mpvsocket + ;; +esac diff --git a/hypr/hyprland.conf b/hypr/hyprland.conf index bfe50fe..ceeb4e4 100644 --- a/hypr/hyprland.conf +++ b/hypr/hyprland.conf @@ -98,8 +98,6 @@ bind = $mainMod, up, movefocus, u bind = $mainMod, down, movefocus, d bind = $mainMod,Tab,cyclenext, bind = $mainMod,Tab,bringactivetotop, -bind = ALT,Tab,cyclenext, -bind = ALT,Tab,bringactivetotop, # Switch workspaces with mainMod + [0-9] bind = $mainMod, 1, workspace, 1 diff --git a/hypr/workspace b/hypr/workspace index 33346b3..a95ed23 100755 --- a/hypr/workspace +++ b/hypr/workspace @@ -10,6 +10,7 @@ setup_dual_monitor(){ hyprctl dispatch moveworkspacetomonitor "$i 0" done hyprctl dispatch moveworkspacetomonitor "4 1" + eww open-many time_1 music_1 fi } @@ -35,7 +36,7 @@ case $1 in #shows the workspace number as notification whenever u switch workspaces and also handles the dual monitor setup on the fly(perfect for laptop users) socat - UNIX-CONNECT:/tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock | while read line;do printf "%s" "$line" | grep -q "monitoradded" && handle_it "$line" - printf "%s" "$line" | grep -q "monitorremoved" && sed -i "s/monitor=,1920x1080,0x0,1,mirror,eDP-1/monitor=,preferred,auto,1/g" $HOME/.config/hypr/hyprland.conf + printf "%s" "$line" | grep -q "monitorremoved" && sed -i "s/monitor=,1920x1080,0x0,1,mirror,eDP-1/monitor=,preferred,auto,1/g" $HOME/.config/hypr/hyprland.conf && eww close music_1 time_1 notify-send -i "lol" "$(printf "$line" | sed -nE 's_^(workspace)>>([^ ]*)_\1 \2_p')" -r 1 -t 700 2>/dev/null done ;; toggle)