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:
@@ -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,
|
||||
|
||||
@@ -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()));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { BoxWidget } from 'lib/types/widget';
|
||||
import { capitalizeFirstLetter } from 'lib/utils';
|
||||
|
||||
const network = await Service.import('network');
|
||||
|
||||
@@ -49,9 +50,7 @@ const Ethernet = (): BoxWidget => {
|
||||
Widget.Label({
|
||||
hpack: 'start',
|
||||
class_name: 'connection-status dim',
|
||||
label:
|
||||
network.wired.internet.charAt(0).toUpperCase() +
|
||||
network.wired.internet.slice(1),
|
||||
label: capitalizeFirstLetter(network.wired.internet),
|
||||
}),
|
||||
],
|
||||
}),
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { PowerOptions } from 'lib/types/options';
|
||||
import { GButton } from 'lib/types/widget';
|
||||
import { capitalizeFirstLetter } from 'lib/utils';
|
||||
import options from 'options';
|
||||
import powermenu from '../power/helpers/actions';
|
||||
import { GButton } from 'lib/types/widget';
|
||||
|
||||
const { confirmation, shutdown, logout, sleep, reboot, showLabel } = options.menus.power;
|
||||
|
||||
@@ -48,7 +49,7 @@ export const PowerButton = (action: PowerOptions): GButton => {
|
||||
Widget.Label({
|
||||
hpack: 'center',
|
||||
hexpand: true,
|
||||
label: action.charAt(0).toUpperCase() + action.slice(1),
|
||||
label: capitalizeFirstLetter(action),
|
||||
className: `power-button-label ${action}-label show-label`,
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user