bar text: truncate instead of having horiz scroll (#320)

This commit is contained in:
end-4
2024-03-10 23:05:41 +07:00
parent 3f05d77664
commit 0b979d9903
2 changed files with 15 additions and 11 deletions
@@ -14,6 +14,8 @@ const WindowTitle = async () => {
children: [
Widget.Label({
xalign: 0,
truncate: 'end',
maxWidthChars: 10, // Doesn't matter, just needs to be non negative
className: 'txt-smaller bar-topdesc txt',
setup: (self) => self.hook(Hyprland.active.client, label => { // Hyprland.active.client
label.label = Hyprland.active.client.class.length === 0 ? 'Desktop' : Hyprland.active.client.class;
@@ -21,6 +23,8 @@ const WindowTitle = async () => {
}),
Widget.Label({
xalign: 0,
truncate: 'end',
maxWidthChars: 10, // Doesn't matter, just needs to be non negative
className: 'txt txt-smallie',
setup: (self) => self.hook(Hyprland.active.client, label => { // Hyprland.active.client
label.label = Hyprland.active.client.title.length === 0 ? `Workspace ${Hyprland.active.workspace.id}` : Hyprland.active.client.title;