Upgrade to Agsv2 + Astal (#533)
* migrate to astal * Reorganize project structure. * progress * Migrate Dashboard and Window Title modules. * Migrate clock and notification bar modules. * Remove unused code * Media menu * Rework network and volume modules * Finish custom modules. * Migrate battery bar module. * Update battery module and organize helpers. * Migrate workspace module. * Wrap up bar modules. * Checkpoint before I inevitbly blow something up. * Updates * Fix event propagation logic. * Type fixes * More type fixes * Fix padding for event boxes. * Migrate volume menu and refactor scroll event handlers. * network module WIP * Migrate network service. * Migrate bluetooth menu * Updates * Migrate notifications * Update scrolling behavior for custom modules. * Improve popup notifications and add timer functionality. * Migration notifications menu header/controls. * Migrate notifications menu and consolidate notifications menu code. * Migrate power menu. * Dashboard progress * Migrate dashboard * Migrate media menu. * Reduce media menu nesting. * Finish updating media menu bindings to navigate active player. * Migrate battery menu * Consolidate code * Migrate calendar menu * Fix workspace logic to update on client add/change/remove and consolidate code. * Migrate osd * Consolidate hyprland service connections. * Implement startup dropdown menu position allocation. * Migrate settings menu (WIP) * Settings dialo menu fixes * Finish Dashboard menu * Type updates * update submoldule for types * update github ci * ci * Submodule update * Ci updates * Remove type checking for now. * ci fix * Fix a bunch of stuff, losing track... need rest. Brb coffee * Validate dropdown menu before render. * Consolidate code and add auto-hide functionality. * Improve auto-hide behavior. * Consolidate audio menu code * Organize bluetooth code * Improve active player logic * Properly dismiss a notification on action button resolution. * Implement CLI command engine and migrate CLI commands. * Handle variable disposal * Bar component fixes and add hyprland startup rules. * Handle potentially null bindings network and bluetooth bindings. * Handle potentially null wired adapter. * Fix GPU stats * Handle poller for GPU * Fix gpu bar logic. * Clean up logic for stat bars. * Handle wifi and wired bar icon bindings. * Fix battery percentages * Fix switch behavior * Wifi staging fixes * Reduce redundant hyprland service calls. * Code cleanup * Document the option code and reduce redundant calls to optimize performance. * Remove outdated comment. * Add JSDocs * Add meson to build hyprpanel * Consistency updates * Organize commands * Fix images not showing up on notifications. * Remove todo * Move hyprpanel configuration to the ~/.config/hyprpanel directory and add utility commands. * Handle SRC directory for the bundled/built hyprpanel. * Add namespaces to all windows * Migrate systray * systray updates * Update meson to include ts, tsx and scss files. * Remove log from meson * Fix file choose path and make it float. * Added a command to check the dependency status * Update dep names. * Get scale directly from env * Add todo
This commit is contained in:
142
src/lib/constants/colors.ts
Normal file
142
src/lib/constants/colors.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
export const namedColors = new Set([
|
||||
'alice blue',
|
||||
'antique white',
|
||||
'aqua',
|
||||
'aquamarine',
|
||||
'azure',
|
||||
'beige',
|
||||
'bisque',
|
||||
'black',
|
||||
'blanched almond',
|
||||
'blue',
|
||||
'blue violet',
|
||||
'brown',
|
||||
'burlywood',
|
||||
'cadet blue',
|
||||
'chartreuse',
|
||||
'chocolate',
|
||||
'coral',
|
||||
'cornflower blue',
|
||||
'cornsilk',
|
||||
'crimson',
|
||||
'cyan',
|
||||
'dark blue',
|
||||
'dark cyan',
|
||||
'dark goldenrod',
|
||||
'dark gray',
|
||||
'dark green',
|
||||
'dark khaki',
|
||||
'dark magenta',
|
||||
'dark olive green',
|
||||
'dark orange',
|
||||
'dark orchid',
|
||||
'dark red',
|
||||
'dark salmon',
|
||||
'dark sea green',
|
||||
'dark slate blue',
|
||||
'dark slate gray',
|
||||
'dark turquoise',
|
||||
'dark violet',
|
||||
'deep pink',
|
||||
'deep sky blue',
|
||||
'dim gray',
|
||||
'dodger blue',
|
||||
'firebrick',
|
||||
'floral white',
|
||||
'forest green',
|
||||
'fuchsia',
|
||||
'gainsboro',
|
||||
'ghost white',
|
||||
'gold',
|
||||
'goldenrod',
|
||||
'gray',
|
||||
'green',
|
||||
'green yellow',
|
||||
'honeydew',
|
||||
'hot pink',
|
||||
'indian red',
|
||||
'indigo',
|
||||
'ivory',
|
||||
'khaki',
|
||||
'lavender',
|
||||
'lavender blush',
|
||||
'lawn green',
|
||||
'lemon chiffon',
|
||||
'light blue',
|
||||
'light coral',
|
||||
'light cyan',
|
||||
'light goldenrod yellow',
|
||||
'light green',
|
||||
'light grey',
|
||||
'light pink',
|
||||
'light salmon',
|
||||
'light sea green',
|
||||
'light sky blue',
|
||||
'light slate gray',
|
||||
'light steel blue',
|
||||
'light yellow',
|
||||
'lime',
|
||||
'lime green',
|
||||
'linen',
|
||||
'magenta',
|
||||
'maroon',
|
||||
'medium aquamarine',
|
||||
'medium blue',
|
||||
'medium orchid',
|
||||
'medium purple',
|
||||
'medium sea green',
|
||||
'medium slate blue',
|
||||
'medium spring green',
|
||||
'medium turquoise',
|
||||
'medium violet red',
|
||||
'midnight blue',
|
||||
'mint cream',
|
||||
'misty rose',
|
||||
'moccasin',
|
||||
'navajo white',
|
||||
'navy',
|
||||
'old lace',
|
||||
'olive',
|
||||
'olive drab',
|
||||
'orange',
|
||||
'orange red',
|
||||
'orchid',
|
||||
'pale goldenrod',
|
||||
'pale green',
|
||||
'pale turquoise',
|
||||
'pale violet red',
|
||||
'papaya whip',
|
||||
'peach puff',
|
||||
'peru',
|
||||
'pink',
|
||||
'plum',
|
||||
'powder blue',
|
||||
'purple',
|
||||
'red',
|
||||
'rosy brown',
|
||||
'royal blue',
|
||||
'saddle brown',
|
||||
'salmon',
|
||||
'sandy brown',
|
||||
'sea green',
|
||||
'seashell',
|
||||
'sienna',
|
||||
'silver',
|
||||
'sky blue',
|
||||
'slate blue',
|
||||
'slate gray',
|
||||
'snow',
|
||||
'spring green',
|
||||
'steel blue',
|
||||
'tan',
|
||||
'teal',
|
||||
'thistle',
|
||||
'tomato',
|
||||
'turquoise',
|
||||
'violet',
|
||||
'wheat',
|
||||
'white',
|
||||
'white smoke',
|
||||
'yellow',
|
||||
'yellow green',
|
||||
]);
|
||||
31
src/lib/constants/distro.ts
Normal file
31
src/lib/constants/distro.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
export const distroIcons = [
|
||||
['deepin', ''],
|
||||
['fedora', ''],
|
||||
['arch', ''],
|
||||
['nixos', ''],
|
||||
['debian', ''],
|
||||
['opensuse-tumbleweed', ''],
|
||||
['ubuntu', ''],
|
||||
['endeavouros', ''],
|
||||
['manjaro', ''],
|
||||
['popos', ''],
|
||||
['garuda', ''],
|
||||
['zorin', ''],
|
||||
['mxlinux', ''],
|
||||
['arcolinux', ''],
|
||||
['gentoo', ''],
|
||||
['artix', ''],
|
||||
['centos', ''],
|
||||
['hyperbola', ''],
|
||||
['kubuntu', ''],
|
||||
['mandriva', ''],
|
||||
['xerolinux', ''],
|
||||
['parabola', ''],
|
||||
['void', ''],
|
||||
['linuxmint', ''],
|
||||
['archlabs', ''],
|
||||
['devuan', ''],
|
||||
['freebsd', ''],
|
||||
['openbsd', ''],
|
||||
['slackware', ''],
|
||||
];
|
||||
22
src/lib/constants/network.ts
Normal file
22
src/lib/constants/network.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import AstalNetwork from 'gi://AstalNetwork?version=0.1';
|
||||
|
||||
type DeviceSate = AstalNetwork.DeviceState;
|
||||
type DevceStates = {
|
||||
[key in DeviceSate]: string;
|
||||
};
|
||||
|
||||
export const DEVICE_STATES: DevceStates = {
|
||||
[AstalNetwork.DeviceState.UNKNOWN]: 'Unknown',
|
||||
[AstalNetwork.DeviceState.UNMANAGED]: 'Unmanaged',
|
||||
[AstalNetwork.DeviceState.UNAVAILABLE]: 'Unavailable',
|
||||
[AstalNetwork.DeviceState.DISCONNECTED]: 'Disconnected',
|
||||
[AstalNetwork.DeviceState.PREPARE]: 'Prepare',
|
||||
[AstalNetwork.DeviceState.CONFIG]: 'Config',
|
||||
[AstalNetwork.DeviceState.NEED_AUTH]: 'Need Authentication',
|
||||
[AstalNetwork.DeviceState.IP_CONFIG]: 'IP Configuration',
|
||||
[AstalNetwork.DeviceState.IP_CHECK]: 'IP Check',
|
||||
[AstalNetwork.DeviceState.SECONDARIES]: 'Secondaries',
|
||||
[AstalNetwork.DeviceState.ACTIVATED]: 'Activated',
|
||||
[AstalNetwork.DeviceState.DEACTIVATING]: 'Deactivating',
|
||||
[AstalNetwork.DeviceState.FAILED]: 'Failed',
|
||||
};
|
||||
37
src/lib/constants/options.ts
Normal file
37
src/lib/constants/options.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { Gtk } from 'astal/gtk3';
|
||||
import { DropdownMenuList } from '../types/options';
|
||||
|
||||
export const StackTransitionMap = {
|
||||
none: Gtk.StackTransitionType.NONE,
|
||||
crossfade: Gtk.StackTransitionType.CROSSFADE,
|
||||
slide_right: Gtk.StackTransitionType.SLIDE_RIGHT,
|
||||
slide_left: Gtk.StackTransitionType.SLIDE_LEFT,
|
||||
slide_up: Gtk.StackTransitionType.SLIDE_UP,
|
||||
slide_down: Gtk.StackTransitionType.SLIDE_DOWN,
|
||||
};
|
||||
|
||||
export const RevealerTransitionMap = {
|
||||
none: Gtk.RevealerTransitionType.NONE,
|
||||
crossfade: Gtk.RevealerTransitionType.CROSSFADE,
|
||||
slide_right: Gtk.RevealerTransitionType.SLIDE_RIGHT,
|
||||
slide_left: Gtk.RevealerTransitionType.SLIDE_LEFT,
|
||||
slide_up: Gtk.RevealerTransitionType.SLIDE_UP,
|
||||
slide_down: Gtk.RevealerTransitionType.SLIDE_DOWN,
|
||||
};
|
||||
|
||||
export const dropdownMenuList = [
|
||||
'dashboardmenu',
|
||||
'audiomenu',
|
||||
'mediamenu',
|
||||
'networkmenu',
|
||||
'bluetoothmenu',
|
||||
'notificationsmenu',
|
||||
'calendarmenu',
|
||||
'energymenu',
|
||||
'powerdropdownmenu',
|
||||
'settings-dialog',
|
||||
] as const;
|
||||
|
||||
export const isDropdownMenu = (name: string): name is DropdownMenuList => {
|
||||
return dropdownMenuList.includes(name as DropdownMenuList);
|
||||
};
|
||||
34
src/lib/constants/services.ts
Normal file
34
src/lib/constants/services.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* NOTE: This approach is not recommended if the program is going to be
|
||||
* running as a client.
|
||||
* ---------------------------------------
|
||||
* Hyprpanel will not be, so this is fine.
|
||||
* ---------------------------------------
|
||||
*/
|
||||
import Hyprland from 'gi://AstalHyprland';
|
||||
export const hyprlandService = Hyprland.get_default();
|
||||
|
||||
import AstalMpris from 'gi://AstalMpris?version=0.1';
|
||||
export const mprisService = AstalMpris.get_default();
|
||||
|
||||
import AstalWp from 'gi://AstalWp?version=0.1';
|
||||
const wireplumber = AstalWp.get_default() as AstalWp.Wp;
|
||||
export const audioService = wireplumber.audio;
|
||||
|
||||
import AstalNetwork from 'gi://AstalNetwork?version=0.1';
|
||||
export const networkService = AstalNetwork.get_default();
|
||||
|
||||
import AstalBluetooth from 'gi://AstalBluetooth?version=0.1';
|
||||
export const bluetoothService = AstalBluetooth.get_default();
|
||||
|
||||
import AstalBattery from 'gi://AstalBattery?version=0.1';
|
||||
export const batteryService = AstalBattery.get_default();
|
||||
|
||||
import AstalNotifd from 'gi://AstalNotifd?version=0.1';
|
||||
export const notifdService = AstalNotifd.get_default();
|
||||
|
||||
import Brightness from 'src/services/Brightness';
|
||||
export const brightnessService = Brightness.get_default();
|
||||
|
||||
import AstalPowerProfiles from 'gi://AstalPowerProfiles?version=0.1';
|
||||
export const powerProfilesService = AstalPowerProfiles.get_default();
|
||||
29
src/lib/constants/workspaces.ts
Normal file
29
src/lib/constants/workspaces.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export const defaultApplicationIcons = {
|
||||
'[dD]iscord': '',
|
||||
'^thunderbird': '',
|
||||
'class:wezterm$': '',
|
||||
'draw.io': '',
|
||||
'firefox-developer-edition': '',
|
||||
'google-chrome': '',
|
||||
'title:YouTube ': '',
|
||||
Spotify: '',
|
||||
chromium: '',
|
||||
code: '',
|
||||
dbeaver: '',
|
||||
edge: '',
|
||||
evince: '',
|
||||
firefox: '',
|
||||
foot: '',
|
||||
keepassxc: '',
|
||||
keymapp: '',
|
||||
kitty: '',
|
||||
obsidian: '',
|
||||
password$: '',
|
||||
qBittorrent$: '',
|
||||
rofi: '',
|
||||
slack: '',
|
||||
spotube: '',
|
||||
steam: '',
|
||||
telegram: '',
|
||||
vlc: '',
|
||||
};
|
||||
Reference in New Issue
Block a user