Skip to content

Conversation

mahaveergurjar
Copy link
Member

@mahaveergurjar mahaveergurjar commented Aug 20, 2025

Pull Request

Description

add new hyprlock layouts

Please read these instructions and remove unnecessary text.

  • Try to include a summary of the changes and which issue is fixed.
  • Also include relevant motivation and context (if applicable).
  • Make sure to make PR against dev and not the master
  • List any dependencies that are required for this change. (e.g., packages or other PRs)
  • Provide a link if there is an issue related to this pull request. e.g., Fixes # (issue)
  • Please add Reviewers, Assignees, Labels, Projects, and Milestones to the PR. (if applicable)

Type of change

Please put an x in the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (non-breaking change; modified files are limited to the documentations)
  • Technical debt (a code change that does not fix a bug or add a feature but makes something clearer for devs)
  • Other (provide details below)

Checklist

Please put an x in the boxes that apply:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My commit message follows the commit guidelines.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added a changelog entry.
  • I have added necessary comments/documentation to my code.
  • I have added tests to cover my changes.
  • I have tested my code locally and it works as expected.
  • All new and existing tests passed.

Screenshots

image image image

Additional context

Add any other context about the problem here.

@rubiin
Copy link
Collaborator

rubiin commented Aug 20, 2025

looks cool

@mahaveergurjar mahaveergurjar changed the title oneplus hyprlock layout feat: new hyprlock layouts Aug 20, 2025
@rubiin
Copy link
Collaborator

rubiin commented Aug 20, 2025

Also LAYOUT 2,3,4,11,12,13,14 from your repo looks nice as well. Might well add them

@kRHYME7
Copy link
Contributor

kRHYME7 commented Aug 20, 2025

😭😭😭😭

You guys are wild. Reserve extra room for other contribs HAHAHA.

Thank you BTW!

@mahaveergurjar
Copy link
Member Author

Also LAYOUT 2,3,4,11,12,13,14 from your repo looks nice as well. Might well add them

ok i will add

@rubiin
Copy link
Collaborator

rubiin commented Aug 20, 2025

@mahaveergurjar also add this at the begining of the config

$resolve.font=SF Pro Display|font.download/dl/font/sf-pro-display.zip

This will download and source the font. Change the name and url accordingly.
No need for Jetbrains font , but for other 3rd party fonts that hyde doesnt ship with

@mahaveergurjar
Copy link
Member Author

@rubiin now review please

@mahaveergurjar
Copy link
Member Author

by the way i don't use this sf-pro-display then why need to add this font ??

@mahaveergurjar
Copy link
Member Author

mahaveergurjar commented Aug 20, 2025

@kRHYME7 please add this type script of music to use full music functionality in hyprlock

#!/bin/bash


# Script for Music Stats
if [ "$1" == "-music" ]; then

	# Function to get metadata using playerctl
	get_metadata() {
		key=$1
		playerctl metadata --format "{{ $key }}" 2>/dev/null
	}

	# Check for arguments

	# Function to determine the source and return an icon and text
	get_source_info() {
		trackid=$(get_metadata "mpris:trackid")
		if [[ "$trackid" == *"firefox"* ]]; then
			echo -e "Firefox 󰈹"
		elif [[ "$trackid" == *"spotify"* ]]; then
			echo -e "Spotify "
		elif [[ "$trackid" == *"chromium"* ]]; then
			echo -e "Chrome "
		else
			echo "Source    "
		fi
	}

	# Parse the argument
	case "$2" in
	--title)
		title=$(get_metadata "xesam:title")
		if [ -z "$title" ]; then
			echo "Nothing Playing"
		else
			ten="          " 
			thirty="$ten$ten$ten"
			len=${#title}
			end="   "
			if ((len>13)); then
				len=13
				end="..."
			fi
			title="${title:0:13}${thirty:0:$((13 - len))}"
			echo "${title}${end}"
			#echo "${title:0:18}" # Limit the output to 50 characters
		fi
		;;
	--arturl)
		url=$(get_metadata "mpris:artUrl")
		if [ -z "$url" ]; then
			echo ""
		else
			if [[ "$url" == file://* ]]; then
				url=${url#file://}
			elif [[ "$url" == https://i.scdn.co/* ]]; then
				cd "$HOME/.config/hypr/hyprlock"
				temp_url=$(echo $url | awk -F '/' '{print $5}')
				if [ ! -f "${temp_url}" ]; then
					rm *[^.jpg][^.sh][^.webp] >/dev/null 2>/dev/null
					wget $url -O $temp_url >/dev/null 2>/dev/null
				fi
				url="$HOME/.config/hyprlock/${temp_url}"
			fi
			echo "$url"
		fi
		;;
	--artist)
		artist=$(get_metadata "xesam:artist")
		if [ -z "$artist" ]; then
			echo ""
		else
			ten="          " 
			thirty="$ten$ten$ten"
			len=${#artist}
			end="   "
			if ((len>10)); then
				len=10
				end="..."
			fi
			artist="${artist:0:10}${thirty:0:$((10 - len))}"
			echo "${artist}${end}"
			# echo "${artist:0:30}" # Limit the output to 50 characters
		fi
		;;
	--length)
		length=$(get_metadata "mpris:length")
		if [ -z "$length" ]; then
			echo ""
		else
			# Convert length from microseconds to a more readable format (seconds)
			echo "$(echo "scale=2; $length / 1000000 / 60" | bc) m"
		fi
		;;
	--status)
		status=$(playerctl status 2>/dev/null)
		if [[ $status == "Playing" ]]; then
			echo "󰎆"
		elif [[ $status == "Paused" ]]; then
			echo "󱑽"
		else
			echo ""
		fi
		;;
	--album)
		album=$(playerctl metadata --format "{{ xesam:album }}" 2>/dev/null)
		if [[ -n $album ]]; then
			echo "$album"
		else
			status=$(playerctl status 2>/dev/null)
			if [[ -n $status ]]; then
				echo "Not album"
			else
				echo ""
			fi
		fi
		;;
	--source)
		get_source_info
		;;
	*)
		echo "Invalid parameter: $2"
		echo "Usage: $0 -music --title | --url | --artist | --length | --album | --source"
		exit 1
		;;
	esac

else
	echo "Invalid option: $1"
	echo "Usage: $0 -bat | -music"
	exit 1
fi

@mahaveergurjar
Copy link
Member Author

the existing music text give long complete title

image

@kRHYME7
Copy link
Contributor

kRHYME7 commented Aug 20, 2025

I'll be adding a full mpris.sh stack soon. This way we can use this anywhere too. I'll probably move hyprlock.sh --mpris to mpris.sh.

@rubiin rubiin self-requested a review August 20, 2025 19:02
@rubiin rubiin self-requested a review August 20, 2025 19:04
Copy link
Collaborator

@rubiin rubiin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just the change as said above

@kRHYME7
Copy link
Contributor

kRHYME7 commented Aug 21, 2025

Anyone tried this on x2 scaling and fractional scaling?

@rubiin
Copy link
Collaborator

rubiin commented Aug 21, 2025

Anyone tried this on x2 scaling and fractional scaling?

nah just on my regular screen

Copy link
Contributor

@kRHYME7 kRHYME7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use scalable units for position and size

position = -2%, 1%
halign = right
valign = bottom
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

x1 scaling is broken
x2 is decent

Copy link
Contributor

@kRHYME7 kRHYME7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some scaling issues for x1 scaling monitor

My monitor

image

I suggest to use percent instead of hard-coding position and size

@mahaveergurjar
Copy link
Member Author

mahaveergurjar commented Aug 30, 2025

@kRHYME7 please review now related to scaling
main issue is in in label text font_size not working with relative in % how to fix this ???

@kRHYME7
Copy link
Contributor

kRHYME7 commented Aug 30, 2025

main issue is in in label text font_size not working with relative in % how to fix this ???

We can't. It's hyprlock thing. I suggest just support x1 and x2 monitor for now. At least avoid overlaps.

@kRHYME7
Copy link
Contributor

kRHYME7 commented Aug 31, 2025

I think I can't add this to rc for now. I have a busy week.

@mahaveergurjar
Copy link
Member Author

Okay 👍

@mahaveergurjar
Copy link
Member Author

When will this pr merge ??

@kRHYME7
Copy link
Contributor

kRHYME7 commented Oct 10, 2025

scaling for x1 and x2 are fine now?

@mahaveergurjar
Copy link
Member Author

Yes the scaling issue fixed

@kRHYME7
Copy link
Contributor

kRHYME7 commented Oct 10, 2025

Will test tomorrow and if it's okay this patch will be available in 25.10.3
Thanks!

@kRHYME7
Copy link
Contributor

kRHYME7 commented Oct 11, 2025

Let's continue this to the hyprlock-new branch so we can fix the issues in one PR.

@kRHYME7 kRHYME7 merged commit a2348b3 into HyDE-Project:hyprlock-new Oct 11, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants