diff --git a/config/hypr/UserConfigs/UserKeybinds.conf b/config/hypr/UserConfigs/UserKeybinds.conf index 2a6ad470..c0fe77c4 100644 --- a/config/hypr/UserConfigs/UserKeybinds.conf +++ b/config/hypr/UserConfigs/UserKeybinds.conf @@ -10,6 +10,7 @@ $RunCMD = $scriptsDir/RunCMD.sh # Categories (for script) #! @actions: Actions +#! @tools: Tools #! @apps: Applications #! @windows: Windows #! @workspaces: Workspaces @@ -23,7 +24,7 @@ bind = $mainMod CTRL, L, exec, pidof hyprlock || hyprlock -q #! @description: " bind = $mainMod CTRL, P, exec, systemctl poweroff #! @description: "ShutDown"; @actions; bind = $mainMod CTRL, R, exec, systemctl reboot #! @description: "Restart"; @actions; bind = $mainMod CTRL, Q, exec, loginctl kill-session $XDG_SESSION_ID #! @description: "LogOut"; @actions; - +bind = CTRL SHIFT, R, exec, pkill ags ; ags # Terminals bind = ALT SHIFT,Return, exec, kitty --title Kitty --single-instance #! @description: "Terminal Float"; @apps; diff --git a/config/hypr/UserConfigs/UserSettings.conf b/config/hypr/UserConfigs/UserSettings.conf index d7656bde..e1bc14c6 100644 --- a/config/hypr/UserConfigs/UserSettings.conf +++ b/config/hypr/UserConfigs/UserSettings.conf @@ -26,7 +26,6 @@ general { gaps_in = 5 gaps_out = 14 border_size = 0 - resize_on_border = true col.active_border = $border_color_active col.inactive_border = $border_color_inactive @@ -97,7 +96,7 @@ animations { input { - kb_layout=us,np + kb_layout = us,np kb_variant = kb_model = kb_options = diff --git a/config/hypr/UserConfigs/custom.conf b/config/hypr/UserConfigs/custom.conf new file mode 100644 index 00000000..ec1b7f37 --- /dev/null +++ b/config/hypr/UserConfigs/custom.conf @@ -0,0 +1,3 @@ +general { + resize_on_border = true +} diff --git a/config/hypr/UserConfigs/old win rule.conf b/config/hypr/UserConfigs/old win rule.conf new file mode 100644 index 00000000..9f20eaf6 --- /dev/null +++ b/config/hypr/UserConfigs/old win rule.conf @@ -0,0 +1,211 @@ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + +# Opacity Rules +windowrulev2 = opacity 0.9 0.6, class:^([Rr]ofi)$ +windowrulev2 = opacity 0.9 0.6, class:^(yad)$ +windowrulev2 = opacity 0.9 0.6, class:^(mousepad)$ +windowrulev2 = opacity 0.9 0.9, class:^(geany)$ +windowrulev2 = opacity 0.80 0.70,class:^(nm-applet)$ +windowrulev2 = opacity 0.80 0.70,class:^(nm-connection-editor)$ + +# Xwaylandvideobridge (if installed) +windowrulev2 = opacity 0.0 override,class:^(xwaylandvideobridge)$ +windowrulev2 = noanim,class:^(xwaylandvideobridge)$ +windowrulev2 = noinitialfocus,class:^(xwaylandvideobridge)$ +windowrulev2 = maxsize 1 1,class:^(xwaylandvideobridge)$ +windowrulev2 = noblur,class:^(xwaylandvideobridge)$ + +# Workspace Rules +windowrule = workspace 5, ^(.*vlc*)$ + +#windowrule = stayfocused, ^(com.github.Aylur.ags)$ +windowrule = float, ^(com.github.Aylur.ags)$ + +# MPV +windowrule = workspace 5, ^(.*mpv*)$ +windowrulev2 = float, class:^(.*mpv.*) +windowrulev2 = size 70% 70%, class:^(.*mpv.*) + + +# Do not lose focus when rofi or gnome polkit is opened +windowrulev2 = stayfocused, class:(rofi) +windowrulev2 = stayfocused, class:(polkit-gnome-authentication-agent-1) + +# Pavucontrol +windowrulev2 = float, class:(pavucontrol) +windowrulev2 = size 533 533, class:(pavucontrol) +windowrulev2 = center, class:(pavucontrol) + +# Zathura +$zathura = class:^(.*zathura.*)$ +windowrulev2 = float, $zathura +windowrulev2 = size 35% 90%, $zathura +windowrulev2 = center 1, $zathura + + +# OBS + +# Main window / Profile screen +windowrulev2 = size 75% 70%, class:(com.obsproject.Studio), title:(.*Profile:.*) + +# Class settings +windowrulev2 = workspace 9, class:(com.obsproject.Studio) +windowrulev2 = float, class:(com.obsproject.Studio) +windowrulev2 = center, class:(com.obsproject.Studio) + +# Folder picker +windowrulev2 = size 50% 45%, class:(com.obsproject.Studio), title:(Select Recording Directory) +windowrulev2 = center, class:(com.obsproject.Studio), title:(Select Recording Directory) + + +# Fireox class settings +windowrulev2 = workspace 3, class:^(firefox)$ +windowrulev2 = workspace 3, class:^(qutebrowser)$ +windowrulev2 = workspace 3, class:^(Firefox-esr)$ +windowrulev2 = opacity 0.9 0.9, class:^(firefox)$ +windowrulev2 = opacity 0.95 0.95,title:^(Picture-in-Picture)$ +windowrulev2 = pin,title:^(Picture-in-Picture)$ +windowrulev2 = float, title:^(Picture-in-Picture)$ +windowrulev2 = size 25% 25%,title:^(Picture-in-Picture)$ +windowrulev2 = move 72% 7%,title:^(Picture-in-Picture)$ +windowrulev2 = idleinhibit fullscreen, class:^(.*firefox.*)$ + +# Thunar +windowrulev2 = size 456 884, title:(.*Compress.*), class:(thunar) +windowrulev2 = center, title:(.*Compress.*), class:(thunar) +windowrulev2 = float, title:(.*Compress.*), class:(thunar) + +windowrulev2 = size 516 158, title:(.*Rename.*), class:(thunar) +windowrulev2 = center, title:(.*Rename.*), class:(thunar) + +windowrulev2 = size 950 270, title:(Confirm to replace files), class:(thunar) +windowrulev2 = center, title:(Confirm to replace files), class:(thunar) +windowrulev2 = float,title:^(Confirm to replace files) + +windowrulev2 = size 444 103, title:(File Operation Progress), class:(thunar) +windowrulev2 = center, title:(File Operation Progress), class:(thunar) + +windowrulev2 = size 565 591, class:(thunar), title:(Properties) +windowrulev2 = center, class:(thunar), title:(Properties) + +windowrulev2 = size 477 149, class:(thunar), title:(Create New Folder) +windowrulev2 = center, class:(thunar), title:(Create New Folder) + +windowrulev2 = workspace 4, class:(thunar) +windowrulev2 = opacity 0.9 0.9, class:^([Tt]hunar)$ +#windowrulev2 = float, class:(thunar) +#windowrulev2 = size 1161 619, class:(thunar) +#windowrulev2 = center, class:(thunar) + + +# File / Folder pickers +$center-float = class:^(center-float)$|^(.*file-roller.*)$|^(.*FileRoller.*)$ +$center-float-title = title:^(.*Open Folder.*)$|^(.*Open File.*)$|^(.*Save File.*)$|^(.*Save Folder.*)$|^(.*Save Image.*)$|^(.*Save As.*)$|^(.*Open As.*)$ +windowrulev2 = float, $center-float +windowrulev2 = float, $center-float-title +windowrulev2 = size 50% 50%, $center-float +windowrulev2 = size 50% 50%, $center-float-title +windowrulev2 = center 1, $center-float +windowrulev2 = center 1, $center-float-title + + +# VS Code +windowrulev2 = workspace 2, class:^(.*Code.*)$|(.*codium.*)$|(.*VSCodium.*) +windowrulev2 = opacity 0.9 0.9, class:^(.*Code.*)$|(.*codium.*)$|(.*codium-url-handler.*)$|(.*VSCodium.*) + + +# Telegram +# windowrulev2 = fullscreen, class:(org.telegram.desktop), title:(Media viewer) + +windowrulev2 = opacity 0.90, class:^(org.telegram.desktop)$ +windowrulev2 = workspace 6, class:(org.telegram.desktop) +windowrulev2 = size 833 455, class:(org.telegram.desktop), title:(Choose Files) +windowrulev2 = center, class:(org.telegram.desktop), title:(Choose Files) +#windowrulev2 = float, class:^(org.telegram.desktop)$ +#windowrulev2 = center, class:^(org.telegram.desktop)$ +#windowrulev2 = size 800 800, class:^(org.telegram.desktop)$ + +# discord +windowrulev2 = workspace 7, class:^(.*discord.*)$|(.*vesktop.*)$|(.*WebCord.*)$ + +# File Roller +windowrulev2 = workspace 4, class:(file-roller), title:(Archive Manager) +windowrulev2 = float, class:(file-roller), title:(Archive Manager) +windowrulev2 = size 45% 50%, class:(file-roller), title:(Archive Manager) +windowrulev2 = center, class:(file-roller), title:(Archive Manager) +windowrulev2 = float, class:(file-roller), title:(Extract archive) +windowrulev2 = size 30% 15%, class:(file-roller), title:(Extract archive) +windowrulev2 = center, class:(file-roller), title:(Extract archive) + + +# qBittorrent +windowrulev2 = workspace 9, class:(org.qbittorrent.qBittorrent) +windowrulev2 = float, class:(org.qbittorrent.qBittorrent) +windowrulev2 = size 1137 547, class:(org.qbittorrent.qBittorrent), title:(.*qbittorrent.*) +windowrulev2 = center, class:(org.qbittorrent.qBittorrent), title:(.*qbittorrent.*) + + +# Kitty +windowrule = opacity 0.9 0.9,kitty +windowrule = float, title:^(Kitty)$ +windowrule = size 800 500, title:^(Kitty)$ +windowrule = move center, title:^(Kitty)$ +windowrule = animation slide, title:^(Kitty)$ +windowrule = float, title:^(Kitty)$ +windowrule = float, kitty_float + + +# Bluetooth applet +windowrulev2 = float, class:(blueman) +windowrulev2 = size 680 665, class:(blueman) +windowrulev2 = center, class:(blueman) + + +# IMV image viewer +$center-float-large = class:^(center-float-large)$|^(.*imv.*)$|^(.*imv-dir.*)$ +windowrulev2 = float, $center-float-large +windowrulev2 = size 70% 70%, $center-float-large +windowrulev2 = center 1, $center-float-large + + +# qt5ct / qt6ct +windowrulev2 = float, class:(qt5ct) +windowrulev2 = float, class:(qt6ct) + +windowrulev2 = size 1256 689, class:(qt5ct) +windowrulev2 = size 1256 689, class:(qt6ct) + +windowrulev2 = center, class:(qt5ct) +windowrulev2 = center, class:(qt6ct) + +windowrulev2 = size 257 116, class:(qt5ct), title:(Enter Color Scheme Name) +windowrulev2 = size 257 116, class:(qt6ct), title:(Enter Color Scheme Name) + +windowrulev2 = size 548 476, class:(qt5ct), title:(Select Color) +windowrulev2 = size 548 476, class:(qt6ct), title:(Select Color) + + +# Other +windowrule = float, nm-connection-editor|vlc|yad|rofi|Lxappearance +windowrule = float, org.kde.polkit-kde-authentication-agent-1 +windowrulev2 = size 543 239, class:^(polkit-gnome-authentication-agent-1)$ +windowrulev2 = float, class:^(polkit-gnome-authentication-agent-1)$ +windowrulev2 = center, class:(polkit-gnome-authentication-agent-1) + +windowrulev2 = float, title:(File Operation Progress) +windowrulev2 = center, title:(File Operation Progress) + + + +# Layer Rules +layerrule = noanim, hyprpicker + +layerrule = noanim, noanim +layerrule = blur, gtk-layer-shell +layerrule = ignorezero, gtk-layer-shell +layerrule = blur, launcher +layerrule = ignorealpha 0.5, launcher +layerrule = blur, notifications +layerrule = ignorealpha 0.69, notifications + +layerrule = noanim, notifications diff --git a/config/hypr/assets/cancel.svg b/config/hypr/assets/cancel.svg new file mode 100644 index 00000000..666d5dd7 --- /dev/null +++ b/config/hypr/assets/cancel.svg @@ -0,0 +1,39 @@ + + + + + + + + + + \ No newline at end of file diff --git a/config/hypr/configs/Keybinds.conf b/config/hypr/configs/Keybinds.conf index 3ee1822b..686dc12d 100644 --- a/config/hypr/configs/Keybinds.conf +++ b/config/hypr/configs/Keybinds.conf @@ -6,6 +6,7 @@ $mainMod = SUPER # Categories (for script) #! @actions: Actions +#! @tools: Tools #! @apps: Applications #! @windows: Windows #! @workspaces: Workspaces diff --git a/config/hypr/hyprland.conf b/config/hypr/hyprland.conf index 18ad6ac2..9d882935 100644 --- a/config/hypr/hyprland.conf +++ b/config/hypr/hyprland.conf @@ -16,6 +16,7 @@ source= $UserConfigs/Monitors.conf source= $UserConfigs/Laptops.conf source= $UserConfigs/LaptopDisplay.conf source= $UserConfigs/WindowRules.conf +source= $UserConfigs/custom.conf source= $UserConfigs/UserKeybinds.conf source= $UserConfigs/UserSettings.conf diff --git a/config/hypr/hyprlock.conf b/config/hypr/hyprlock.conf index 9fab64da..1ea71729 100644 --- a/config/hypr/hyprlock.conf +++ b/config/hypr/hyprlock.conf @@ -1,175 +1,122 @@ -$rosewater = rgb(f5e0dc) -$rosewaterAlpha = f5e0dc - -$flamingo = rgb(f2cdcd) -$flamingoAlpha = f2cdcd - -$pink = rgb(f5c2e7) -$pinkAlpha = f5c2e7 - -$mauve = rgb(cba6f7) -$mauveAlpha = cba6f7 - -$red = rgb(f38ba8) -$redAlpha = f38ba8 - -$maroon = rgb(eba0ac) -$maroonAlpha = eba0ac - -$peach = rgb(fab387) -$peachAlpha = fab387 - -$yellow = rgb(f9e2af) -$yellowAlpha = f9e2af - -$green = rgb(a6e3a1) -$greenAlpha = a6e3a1 - -$teal = rgb(94e2d5) -$tealAlpha = 94e2d5 - -$sky = rgb(89dceb) -$skyAlpha = 89dceb - -$sapphire = rgb(74c7ec) -$sapphireAlpha = 74c7ec - -$blue = rgb(89b4fa) -$blueAlpha = 89b4fa - -$lavender = rgb(b4befe) -$lavenderAlpha = b4befe - -$text = rgb(cdd6f4) -$textAlpha = cdd6f4 - -$subtext1 = rgb(bac2de) -$subtext1Alpha = bac2de - -$subtext0 = rgb(a6adc8) -$subtext0Alpha = a6adc8 - -$overlay2 = rgb(9399b2) -$overlay2Alpha = 9399b2 - -$overlay1 = rgb(7f849c) -$overlay1Alpha = 7f849c - -$overlay0 = rgb(6c7086) -$overlay0Alpha = 6c7086 - -$surface2 = rgb(585b70) -$surface2Alpha = 585b70 - -$surface1 = rgb(45475a) -$surface1Alpha = 45475a - -$surface0 = rgb(313244) -$surface0Alpha = 313244 - -$base = rgb(1e1e2e) -$baseAlpha = 1e1e2e - -$mantle = rgb(181825) -$mantleAlpha = 181825 - -$crust = rgb(11111b) -$crustAlpha = 11111by - +# BACKGROUND background { monitor = - color = #FFFFFF - - # all these options are taken from hyprland, see https://wiki.hyprland.org/Configuring/Variables/#blur for explanations - blur_size = 4 - blur_passes = 3 # 0 disables blurring - noise = 0.0117 - contrast = 1.3000 # Vibrant!!! - brightness = 0.8000 - vibrancy = 0.2100 + path = ~/.cache/current_wallpaper.png + blur_passes = 3 + contrast = 0.8916 + brightness = 0.8172 + vibrancy = 0.1696 vibrancy_darkness = 0.0 } -input-field { - monitor = - size = 160, 26 - rounding = 8 - outline_thickness = 2 - dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 - dots_spacing = 0.64 # Scale of dots' absolute size, 0.0 - 1.0 - dots_center = true - outer_color = $subtext0 - inner_color = $surface0 - font_color = $subtext0 - check_color = $yellow - fail_color = $red - fade_on_empty = true - placeholder_text = Password... # Text rendered in the input box when it's empty. - hide_input = false - fail_text = $FAIL ($ATTEMPTS) $(date +"%H:%M") " - color = rgba(255,255,255, 0.85) - font_size = 44 - font_family = SF Mono Nerd Font Mono 10 - shadow_passes = 3 - shadow_size = 4 - position = 0, -60 + text = cmd[update:1000] echo -e "$(date +"%A, %B %d")" + color = rgba(216, 222, 233, 0.70) + font_size = 25 + font_family = SF Pro Display Bold + position = 0, 350 halign = center - valign = top + valign = center } -# Date +# Time label { monitor = - text = cmd[update:18000000] echo " "$(date +'%A %-d %B')" " - color = rgba(255,255,255, 0.8) - font_size = 11 - font_family = SF Mono Nerd Font Mono Light 10 - shadow_passes = 3 - shadow_size = 3 - position = 0, -40 + text = cmd[update:1000] echo "$(date +"%I:%M %P")" + color = rgba(216, 222, 233, 0.70) + font_size = 120 + font_family = SF Pro Display Bold + position = 0, 250 halign = center - valign = top + valign = center } -label { - monitor = - text = HEY! $USER - color = $color1 - font_size = 8 - font_family = SF Mono Nerd Font Mono - opacity = 0.5 - position = 0, 30 - halign = center - valign = bottom -} - -# User Image +# Profie-Photo image { monitor = - size = 50 - border_size = 2 - border_color = $subtext0 path = ~/.face.icon - shadow_passes = 2 + border_size = 2 + border_color = rgba(255, 255, 255, .65) + size = 130 + rounding = -1 + rotate = 0 reload_time = -1 reload_cmd = - rounding = -1 # negative values mean circle - position = 0, 105 + position = 0, 40 + halign = center + valign = center +} + +# USER-BOX +shape { + monitor = + size = 300, 60 + color = rgba(255, 255, 255, .1) + rounding = -1 + border_size = 0 + border_color = rgba(253, 198, 135, 0) + rotate = 0 + xray = false # if true, make a "hole" in the background (rectangle of specified size, no rotation) + + position = 0, -130 + halign = center + valign = center +} + +# USER +label { + monitor = + text =  $USER + color = rgba(216, 222, 233, 0.80) + outline_thickness = 2 + dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true + font_size = 18 + font_family = SF Pro Display Bold + position = 0, -130 + halign = center + valign = center +} + +# INPUT FIELD +input-field { + monitor = + size = 300, 60 + outline_thickness = 2 + dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true + outer_color = rgba(0, 0, 0, 0) + inner_color = rgba(255, 255, 255, 0.1) + font_color = rgb(200, 200, 200) + fade_on_empty = false + font_family = SF Pro Display Bold + placeholder_text = 🔒 Enter Pass + hide_input = false + position = 0, -210 + halign = center + valign = center +} + +# CURRENT SONG +label { + monitor = + text = cmd[update:1000] echo "$(/home/vivek/.config/hypr/scripts/songdetail.sh)" + color = rgba(255, 255, 255, 0.6) + font_size = 18 + font_family = JetBrains Mono Nerd, SF Pro Display Bold + position = 0, 50 halign = center valign = bottom } diff --git a/config/hypr/scripts/Battery_Notify.sh b/config/hypr/scripts/Battery_Notify.sh deleted file mode 100755 index 94f5dfea..00000000 --- a/config/hypr/scripts/Battery_Notify.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - - - PREV_STATUS="Unknown" # Initialize previous status - FULL_CHARGE_NOTIFIED=0 - LOW_BATTERY_NOTIFIED=0 - - while true; do - STATUS=$(cat /sys/class/power_supply/AC/online 2>/dev/null) # Get charger status using power supply directory - - if [ "$STATUS" != "$PREV_STATUS" ]; then # Check if the charger status has changed - FULL_CHARGE_NOTIFIED=0 # Reset full charge notification state when charger status changes - LOW_BATTERY_NOTIFIED=0 # Reset low battery notification state when charger status changes - PREV_STATUS="$STATUS" # Update previous status - fi - - # Get battery percentage and remaining time using acpi - BATTERY_INFO=$(acpi) - PERCENT=$(echo "$BATTERY_INFO" | awk -F ',|%' '{print $2}') - - if [ "$STATUS" == "1" ] && [ "$PERCENT" -eq 100 ] && [ "$FULL_CHARGE_NOTIFIED" -eq 0 ]; then # Check if the battery is charging and the percentage is 100% - notify-send -u low "🔌 Battery Fully Charged" "You can unplug the charger" # Send a notification when the battery is fully charged - FULL_CHARGE_NOTIFIED=1 # Set the state to indicate that the full charge notification has been sent - fi - - if [ "$PERCENT" -le 40 ] && [ "$LOW_BATTERY_NOTIFIED" -eq 0 ]; then # Check if the battery percentage is less than or equal to 20% and low battery notification has not been sent - notify-send -u critical "🪫 Low Battery" "Plug in the charger" # Send low battery notification - LOW_BATTERY_NOTIFIED=1 # Set the state to indicate that the low battery notification has been sent - fi - sleep 0.1 # Sleep for some time before checking again - done diff --git a/config/hypr/scripts/Music_cmd.sh b/config/hypr/scripts/Music_cmd.sh deleted file mode 100755 index 8d978cb1..00000000 --- a/config/hypr/scripts/Music_cmd.sh +++ /dev/null @@ -1,172 +0,0 @@ -#!/bin/bash - -###################################### -# # -# Music # -# # -###################################### - -music(){ - -# Directory local music folder -mDIR="$HOME/Music/" - -# Directory for icons -iDIR="$HOME/dotfiles/hypr/assets" - -# Online Stations. Edit as required -declare -A online_music=( - ["ʙʜᴀᴊᴀɴ 🚩"]="https://youtube.com/playlist?list=PLwIh-QEhrDJDM8IF3gLUgnEyZm6dBgr_n&si=_RDHngYobHlcxaJW" - ["ʟᴏꜰɪ ɢɪʀʟ 📻🎶"]="https://www.youtube.com/watch?v=jfKfPfyJRdk" - ["ɴᴇᴘᴀʟɪ ᴏʟᴅ ꜱᴏɴɢ 📻🎶"]="https://youtube.com/playlist?list=PLXuVG9D9JQ8RAhpH2TyISgBgEmXONIhGY&si=SLyxb2vxaE0XuXsz" - ["ʙᴏʟʟʏᴡᴏᴏᴅ 📻🎶"]="https://youtube.com/playlist?list=PL9bw4S5ePsEEqCMJSiYZ-KTtEjzVy0YvK&si=J0gPvKL4R4fIlPz9" - ["ᴛᴏᴘ 50 ʙᴏʟʟʏᴡᴏᴏᴅ 📻🎶"]="https://youtube.com/playlist?list=PLHuHXHyLu7BEnMJNeVvkXpxapvDSp5UdI&si=-TBeeNJ28NqVcnKu" - ["ʜɪɴᴅɪ ᴅᴊ 🔊🎶"]="https://youtube.com/playlist?list=PLuVudh8_zaHsZKa76lLfirUazcMZWzodb&si=14t1wkmsHiREB71u" - ["ʜɪɴᴅɪ ʀᴇᴍɪx 📻🎶"]="https://youtube.com/playlist?list=PLuVudh8_zaHvhUe3kLBrq5H3DeTY0bjN2&si=9dzEcnR3n5j1It3S" - ["ᴍɪx 🔊🎶"]="https://youtube.com/playlist?list=PLwIh-QEhrDJCPrtNv-r0swKWG-onndWjg&si=37SGSalBVz7kwhso" - ["ᴀʟʟ ᴛɪᴍᴇ ɴᴇᴘᴀʟɪ ʙᴇꜱᴛ 📻🎶"]="https://youtube.com/playlist?list=PLMRKdK25AuPX9eE1G1W6-xBAYGDvKRX6H&si=pAmEK2fV6bLLN8Ss" - ) - - -# Populate local_music array with files from music directory and subdirectories -populate_local_music() { - local_music=() - filenames=() - while IFS= read -r file; do - local_music+=("$file") - filenames+=("$(basename "$file")") - done < <(find "$mDIR" -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.wav" -o -iname "*.ogg" -o -iname "*.mp4" \)) -} - -# Function for displaying notifications -notification() { - notify-send -u normal -i "$iDIR/music.png" "Playing: $@" -} - -# Main function for playing local music -play_local_music() { - populate_local_music - - # Prompt the user to select a song - choice=$(printf "%s\n" "${filenames[@]}" | rofi -i -dmenu -p "Local Music") - - if [ -z "$choice" ]; then - exit 1 - fi - - # Find the corresponding file path based on user's choice and set that to play the song then continue on the list - for (( i=0; i<"${#filenames[@]}"; ++i )); do - if [ "${filenames[$i]}" = "$choice" ]; then - - notification "$choice" - - # For some reason wont start playlist at 0 -mpv --playlist-start="$i" --loop-playlist --vid=no "${local_music[@]}" - break - fi - done -} - -# Main function for shuffling local music -shuffle_local_music() { - notification "Shuffle local music" - - # Play music in $mDIR on shuffle - mpv --shuffle --loop-playlist --vid=no "$mDIR" -} - -# Main function for playing online music -play_online_music() { - choice=$(printf "%s\n" "${!online_music[@]}" | rofi -i -dmenu -p "Online Music") - - if [ -z "$choice" ]; then - exit 1 - fi - - link="${online_music[$choice]}" - - notification "$choice" - - # Play the selected online music using mpv - mpv --shuffle --vid=no "$link" -} - -# Function to play/pause music -play_pause() { - playerctl --player=mpv play-pause - if playerctl --player=mpv status | grep -q "Playing"; then - notify-send -u low "▶️ Resuming music" - else - notify-send -u low "⏸️ Music paused" - fi -} - -# Function to adjust volume -adjust_volume() { - local change="$1" - local message="$2" - - current_volume=$(playerctl --player=mpv volume) - new_volume=$(echo "$current_volume + $change" | bc) - playerctl --player=mpv volume "$new_volume" - notify-send -u low "$message" -} - -music_controls() { - local choice="$1" - - case "$choice" in - "Play") playerctl --player=mpv play && notify-send -u low "▶️ Resuming music" ;; - "Pause") playerctl --player=mpv pause && notify-send -u low "⏸️ Music paused" ;; - "Stop") pkill mpv && notify-send -u low "🛑 Music stopped" ;; - "Next track") playerctl --player=mpv next && notify-send -u low "⏭️ Next track playing" ;; - "Previous track") playerctl --player=mpv previous && notify-send -u low "⏮️ Previous track playing" ;; - "Increase volume") adjust_volume 0.1 "🔊 Increasing track volume" ;; - "Decrease volume") adjust_volume -0.1 "🔉 Decreasing track volume" ;; - esac -} - -# Main function -main_menu() { - if playerctl --player=mpv status | grep -q "Playing"; then - local controls=("Pause" "Stop" "Next track" "Previous track" "Increase volume" "Decrease volume") - choice=$(printf "%s\n" "${controls[@]}" | rofi -dmenu -i -p "Music Controls") - music_controls "$choice" - else - local controls=("Play from Music Folder" "Play from Online Stations" "Shuffle Play from Music Folder") - choice=$(printf "%s\n" "${controls[@]}" | rofi -dmenu -i -p "Select music source") - case "$choice" in - "Play from Music Folder") play_local_music ;; - "Play from Online Stations") play_online_music ;; - "Shuffle Play from Music Folder") shuffle_local_music ;; - *) echo "Invalid choice" ;; - esac - fi -} - -# usage -usage() { - echo "Usage: $0 [-m] [-i] [-d] [-n] [-p] [-k] [-s]" - echo " -m Main menu" - echo " -i Increase volume" - echo " -d Decrease volume" - echo " -n Next track" - echo " -p Previous track" - echo " -k Play/pause" - echo " -s Stop music" - exit 1 -} - -while getopts "midnpks" flag; do - case "${flag}" in - m) main_menu ;; - i) adjust_volume 0.1 "🔊 Increasing track volume" ;; - d) adjust_volume -0.1 "🔉 Decreasing track volume" ;; - n) playerctl --player=mpv next && notify-send -u low "⏭️ Next track playing" ;; - p) playerctl --player=mpv previous && notify-send -u low "⏮️ Previous track playing" ;; - k) play_pause ;; - s) pkill mpv && notify-send -u low "🛑 Music stopped" ;; - *) usage ;; - esac -done -}