feat: launcher icon auto detect from os name (#413)

* feat: launcher icon auto detect from os name

* feat: add more

* fix: revamp distro icon

* feat: on hover only show actions if available on notifications (#396)

* feat: on hover only show actions if available on notifications

* feat: on hover only show actions if available on notifications

* fix: make the change configurable

* fix: remove unneeded op

* Added the ability to scale a popover. (#443)

* Added the ability to scale a popover.

* Removed redundant code

* Provide a cli command to clear notifications. (#444)

* Added a cpu temperature custom module. (#446)

* Added a CPU Temperature module.

* Update defauls and add wiki link.

* Move celsius to fahr conversion to method.

* fix: move distoicons , use capitalizeLetter func

* fix: lint

* Rename dissto.ts to distro.ts

* Update lib/utils.ts

---------

Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
Rubin Bhandari
2024-11-08 15:16:21 +05:45
committed by GitHub
parent 9ae59034fa
commit 3cc3fa5d42
8 changed files with 68 additions and 20 deletions

View File

@@ -1,12 +1,13 @@
import Gdk from 'gi://Gdk?version=3.0';
import { openMenu } from '../utils.js';
import options from 'options';
import { BarBoxChild } from 'lib/types/bar.js';
import Button from 'types/widgets/button.js';
import { Attribute, Child } from 'lib/types/widget.js';
import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils.js';
import Gdk from 'gi://Gdk?version=3.0';
import { BarBoxChild } from 'lib/types/bar.js';
import { Attribute, Child } from 'lib/types/widget.js';
import options from 'options';
import Button from 'types/widgets/button.js';
import { openMenu } from '../utils.js';
import { getDistroIcon } from 'lib/utils.js';
const { rightClick, middleClick, scrollUp, scrollDown } = options.bar.launcher;
const { rightClick, middleClick, scrollUp, scrollDown, autoDetectIcon, icon } = options.bar.launcher;
const Menu = (): BarBoxChild => {
return {
@@ -22,7 +23,9 @@ const Menu = (): BarBoxChild => {
}),
child: Widget.Label({
class_name: 'bar-menu_label bar-button_icon txt-icon bar',
label: options.bar.launcher.icon.bind('value'),
label: Utils.merge([autoDetectIcon.bind('value'), icon.bind('value')], (autoDetect, icon): string => {
return autoDetect ? getDistroIcon() : icon;
}),
}),
}),
isVisible: true,

View File

@@ -1,12 +1,13 @@
const hyprland = await Service.import('hyprland');
import { BarBoxChild } from 'lib/types/bar';
import options from 'options';
import { Attribute, Child } from 'lib/types/widget';
import { ActiveClient } from 'types/service/hyprland';
import Label from 'types/widgets/label';
import { runAsyncCommand, throttledScrollHandler } from 'customModules/utils';
import Button from 'types/widgets/button';
import { BarBoxChild } from 'lib/types/bar';
import { Attribute, Child } from 'lib/types/widget';
import { capitalizeFirstLetter } from 'lib/utils';
import options from 'options';
import Gdk from 'types/@girs/gdk-3.0/gdk-3.0';
import { ActiveClient } from 'types/service/hyprland';
import Button from 'types/widgets/button';
import Label from 'types/widgets/label';
const { leftClick, rightClick, middleClick, scrollDown, scrollUp } = options.bar.windowtitle;
@@ -117,7 +118,7 @@ const filterTitle = (windowtitle: ActiveClient): Record<string, string> => {
['^$', '󰇄', 'Desktop'],
// Fallback icon
['(.+)', '󰣆', `${windowtitle.class.charAt(0).toUpperCase() + windowtitle.class.slice(1)}`],
['(.+)', '󰣆', `${capitalizeFirstLetter(windowtitle.class)}}`],
];
const foundMatch = windowTitleMap.find((wt) => RegExp(wt[0]).test(windowtitle.class.toLowerCase()));