Compare commits

239 Commits

Author SHA1 Message Date
10a5c775be [Build] Start refactor 2026-02-02 16:01:56 +01:00
c38907ec39 [Hyprland] add launch command for qutebrowser 2026-02-02 09:07:09 +01:00
1721651319 [Hyprland] Add binds for qalculate 2026-01-23 13:41:07 +01:00
e4692c456c [Hyprland] Make steam not start in floating mode 2026-01-22 19:48:26 +01:00
6ee881c7dc [Hyprland] Update for new keyboard having native ability to swap caps and escape 2026-01-19 11:08:22 +01:00
2649ee4b56 [Hyprland] Remove hyprpm reload 2026-01-09 17:41:47 +01:00
4024b9e830 [Setup] Improve color extraction 2026-01-09 16:23:30 +01:00
11767c3009 [Astal] Prepare for reloadable style 2026-01-09 16:04:51 +01:00
c2cd216dac [Scripts] Another incorrect filename fix 2026-01-09 15:04:45 +01:00
5c245f9c35 [Scripts] Fix incorrect filename 2026-01-09 14:46:04 +01:00
54fb71eeae [Scripts] Add script to add latexindent 2026-01-09 14:45:09 +01:00
44642960ad [Hyprland] Remove vivado shenanigans 2026-01-09 07:45:59 +01:00
f8b7f00f44 [Hyprland] Flat accel profile 2026-01-06 14:03:59 +01:00
069139641f [Yazi] Update to new conf 2026-01-06 13:03:33 +01:00
17689ac0e8 [Hyprland] Update config to newest version 2026-01-01 15:10:39 +01:00
5581267a73 [Fish] Add alias for flutter via fvm 2026-01-01 12:50:09 +01:00
e2fd60187a [Hyprland] Improve scrolling 2025-12-19 11:08:09 +01:00
37ff1af0ed [Kitty] Improve scrolling 2025-12-19 11:04:12 +01:00
37849dee8f [Hyprland] Finish change to us-intl layout 2025-12-14 11:05:19 +01:00
fe36f97774 [Eslint] More fixes 2025-12-13 14:29:12 +01:00
e9399cf7bb [Eslint] Fix typing 2025-12-13 14:28:22 +01:00
c453e7aa90 [Hyprland] improve notifications 2025-12-09 11:26:04 +01:00
5c069beb2b [Hyprland] Add notifications to layout change 2025-12-09 11:24:07 +01:00
0a555e9e5a [Hyprland] update bind 2025-12-09 11:22:52 +01:00
c7e82042af [Hyprland] update keyboard layout and add layout change binds 2025-12-09 11:17:07 +01:00
c421ea2cb3 [Hyprland] Fix binds 2025-12-08 10:29:08 +01:00
84b008e29c [Hyprland] Extract gestures into separate file 2025-12-08 10:28:11 +01:00
007c3d0bf0 [Eslint] Fix config error 2025-12-04 14:50:46 +01:00
8872abecbd [Eslint] Update config 2025-12-04 11:22:01 +01:00
841575d4e3 [Fish] Update alias 2025-11-27 16:46:14 +01:00
befe9696b0 [Fish] Fix alias 2025-11-27 16:45:38 +01:00
4b12ae2c12 [Scripts] Fixes for vpn script 2025-11-24 14:25:13 +01:00
5227e5f05e [Scripts] Fix vpn script 2025-11-23 13:36:06 +01:00
b8098eac8b [Scripts] Improve VPN script 2025-11-18 09:38:24 +01:00
5b610643c7 [Install] Fix bt 2025-11-17 09:17:27 +01:00
4fce8c955c [Hyprland] Fix cursor size 2025-11-12 10:32:15 +01:00
eabb972cb8 [Binds] Fix swapescape 2025-11-11 09:58:48 +01:00
688b94c3ad [Binds] Add binds to dynamically enable and disable caps:swapescape 2025-11-11 09:50:31 +01:00
d4689d66cd [FMT] Improve latexindent config 2025-11-11 08:05:53 +01:00
e28e3e6207 [Install] Add usbutils 2025-11-06 17:47:18 +01:00
b45b3d60d1 [Scripts] Add pdf wordcount script 2025-11-04 15:51:49 +01:00
8d2e3cea85 [Hyprland] Move conflicting bind 2025-11-03 17:13:44 +01:00
8a42f9bfa2 [Install] Add timesyncd enable 2025-11-03 10:15:00 +01:00
09916ae68e [Hyprland] Add more launch commands 2025-11-02 10:49:33 +01:00
5b5fa9ad4e [Astal] Fix launch on new astal version 2025-11-01 10:37:30 +01:00
814b975533 [Linecount] Add cloc and alias for it 2025-10-30 15:31:47 +01:00
d0a450d4e8 [Setup] Make cleaner 2025-10-30 10:42:50 +01:00
786d5c5fe0 [Yazi] Fix themes 2025-10-30 10:42:42 +01:00
5ba2894101 [Hyprland] Improve windowrules 2025-10-30 10:24:08 +01:00
499bf793b2 [Hyprland] Add some nice windorules 2025-10-30 10:24:08 +01:00
f1c57b8ecc [Scripts] Add nvim update script 2025-10-29 15:19:18 +01:00
20cc042b64 [Scripts] Add batch video conversion script 2025-10-25 16:26:39 +02:00
ae9dcaa074 [Hyprland] Windowrules: Add for BeatSaber 2025-10-22 17:01:28 +02:00
21b68b1e68 [Hyprland] Fix alvr launch bind typo 2025-10-22 12:55:57 +02:00
fa4929a94b [Hyprland] Screenshot binds exit submap 2025-10-22 12:53:44 +02:00
6b4d0e22b1 [Kitty] Remove default mapping interfering with new nvim bind 2025-10-21 08:44:42 +02:00
d5615892e7 [Hyprland] Add launch command for alvr and bsm 2025-10-17 17:30:04 +02:00
81d0df6023 [Hyprland] Fix notifications submap 2025-10-17 10:58:39 +02:00
9cf14d3b55 [Astal] Format 2025-10-17 10:47:05 +02:00
06325b09b8 [Hyprland] Update readmes 2025-10-17 10:44:33 +02:00
539ec34b4c [Astal] Finish modes, move tray into quickactions menu 2025-10-17 10:44:33 +02:00
00d4f101fc [Hyprland] Remove some quick access binds (unnecessary) 2025-10-17 09:55:15 +02:00
c9a89cf545 [Setup] Fix platform wrong 2025-10-17 09:54:16 +02:00
7ba9a65f19 [Build] Add linter 2025-10-17 09:47:40 +02:00
52ced69697 [Hyprland] Fix submaps 2025-10-17 09:47:25 +02:00
47bbdd9f85 [Astal] Add mode indicator 2025-10-17 09:47:18 +02:00
94a57be9f7 [Astal] Add colours 2025-10-17 07:29:18 +02:00
9d779269eb [Hyprland] Notifications binds 2025-10-17 06:52:15 +02:00
da61dc869d [Astal] Add new mode for hyprland 2025-10-17 06:51:05 +02:00
e44cc65f1f [Astal] Start adding hyprland module 2025-10-16 22:25:48 +02:00
0392f8fc0f [Hyprland] Launch submap autoreset 2025-10-16 22:25:35 +02:00
3c76f0412a [Setup] Fix hyprmode apply 2025-10-16 17:05:11 +02:00
627c005fe3 [Hyprland] Fix submap 2025-10-16 17:05:03 +02:00
6540bda07a [Hyprland] Add new bind layout 2025-10-16 16:18:08 +02:00
a9c73ba9d9 [Scripts] Improve VPN script 2025-10-16 10:44:27 +02:00
30488edaed [Fish] Fix latexdocs alias 2025-10-10 15:05:28 +02:00
8ed711d300 [Fish] Improve latex doc opening 2025-10-09 21:08:06 +02:00
a8043a9899 [Hyprland] Speed up animations even more 2025-10-09 11:02:51 +02:00
aa9ebaf22b [Astal] Battery widget: Show waiting 2025-10-09 09:33:21 +02:00
2314a17066 [Install] Add ntp 2025-10-06 13:11:34 +02:00
7051688fa5 [Clang] Formatter: Only merge empty functions 2025-10-05 12:13:56 +02:00
0f4f601a2d [Clang] Improve formatter config 2025-10-05 12:09:53 +02:00
f38e2ff94f [Clang] Improve formatter config 2025-10-05 11:58:55 +02:00
50c5cf945d [Clang] Improve formatter config 2025-10-05 08:38:26 +02:00
903da245ac [Termfilechooser] Fix 2025-10-04 08:53:07 +02:00
2d15296597 [Fish] Force pager into pager mode and not cat 2025-10-02 14:39:15 +02:00
3a619cbf92 [Hyprland] Add new keybind on laptop 2025-10-02 14:21:32 +02:00
530022ee59 [Hyprlock] Update clock 2025-10-02 08:39:03 +02:00
5c01a5f806 [LatexIndent] Fix path 2025-10-01 15:34:14 +02:00
b6f5ad9bcf [Install] Add man 2025-10-01 13:44:15 +02:00
92dc644ee2 [Fish] Add alias for gcc with error flags 2025-10-01 12:42:14 +02:00
ddc39f4928 [Setup] Fix indentconfig copying 2025-10-01 10:48:30 +02:00
a93d7494d3 [Install] Add sysstat package 2025-10-01 10:47:13 +02:00
706cff40b3 [Setup] Fix errors with startup 2025-09-30 14:03:26 +02:00
e35845099a [Hyprland] Update for new folder structure 2025-09-30 07:41:44 +02:00
c44ef61cf2 [Fish] Update for new folder structure 2025-09-30 07:41:14 +02:00
ef65f827a2 [Yazi] Update keymap for new structure 2025-09-29 11:48:29 +02:00
6b8f415703 [Eslint] Update rules 2025-09-28 17:08:48 +02:00
f7004d9f25 [All] Remove old files 2025-09-27 08:07:58 +02:00
58d5b6cf69 [Setup] Add reload to make sure config reload happens properly 2025-09-26 14:04:47 +02:00
c55f70b852 [Fish] Add alias for latex docs 2025-09-26 14:03:21 +02:00
97e02d81af [Clang] Fix config file 2025-09-25 16:42:26 +02:00
a545bb0066 [Clang] Fix incorrect config 2025-09-25 16:40:53 +02:00
35d51f80df [Clang] Finish up config 2025-09-25 15:57:39 +02:00
d638aa0434 [Clang] Fix setup script 2025-09-25 15:52:55 +02:00
258fc61669 [Clang] Add formatter config 2025-09-25 15:52:16 +02:00
6dc15047d4 [Eslint] Add sort-imports rule 2025-09-25 15:20:13 +02:00
0725763b95 [Hyprland] Configure gestures 2025-09-25 15:04:47 +02:00
29b8f188e9 [Yazi] Update keymap 2025-09-25 11:04:07 +02:00
959732ffd1 [Yazi] Update keymap 2025-09-23 15:19:36 +02:00
be3497de77 [Indent] Add more rules 2025-09-23 11:14:26 +02:00
17d83a53b7 [Hyprland] configure gestures 2025-09-23 11:12:53 +02:00
122f3ab070 [Hyprland] Add special workspace config 2025-09-22 16:17:22 +02:00
46a732e8f7 [Install] Add dep for latexindent 2025-09-22 13:44:53 +02:00
3373ae3b8c [Install] Add dep for latexindent 2025-09-22 13:37:50 +02:00
edd2db313c [Install] Add dep for latexindent 2025-09-22 13:36:37 +02:00
ecfd517a4a [Hyprland] Tweak animation duration 2025-09-22 13:01:13 +02:00
25419067d4 [Install] Add note on using nwg-look 2025-09-22 12:53:46 +02:00
36faff6b5f [Install] Add langgerman to install 2025-09-22 08:44:27 +02:00
ffe516175c [Eslint] Revert EOL decision 2025-09-20 08:12:20 +02:00
f58f22cadd [Install] Add german latex extras 2025-09-20 07:17:56 +02:00
7e9faff6d6 [Astal] Make brightness adjust only in 5% intervals 2025-09-18 07:52:41 +02:00
ffa25045e5 [zathura] Add poppler to install 2025-09-17 16:17:43 +02:00
66dcd82952 [Hyprland] Fix bind 2025-09-16 17:31:28 +02:00
40013a61d1 [Hyprland] Fix some binds 2025-09-16 17:30:37 +02:00
ee26c0c5c2 [Hyprland] Fix errors 2025-09-16 13:03:25 +02:00
02a351768f [Fish] Add pager alias 2025-09-16 12:59:20 +02:00
9539f09e83 [Install] Add pager 2025-09-16 12:59:20 +02:00
25a78f126e [Astal] Add battery low notification 2025-09-15 14:42:05 +02:00
e0c339785d [Eslint] Update eol-last 2025-09-15 10:32:59 +02:00
e6f57831b1 [Eslint] Enforce newline 2025-09-15 10:27:26 +02:00
4e323d932f [Hyprland] Update binds 2025-09-15 09:20:29 +02:00
64d8ca7ab4 [Install] Add eslint_d 2025-09-14 07:29:12 +02:00
7de17aaeb7 [Yazi] Update keymaps for ETH folders 2025-09-13 17:24:37 +02:00
4f0c6a45cf [Install] Add http-server 2025-09-13 08:29:42 +02:00
a2dbdd78d3 [Setup] Don't do autologin (will make optional) 2025-09-13 08:22:11 +02:00
e4a76c494c [Greetd] Add auto-unlock of keyring 2025-09-12 17:26:53 +02:00
1ee3f01883 [Setup] Add note 2025-09-12 13:12:13 +02:00
a89ed00a17 [Greetd] Add autologin 2025-09-12 12:26:47 +02:00
64e671119d [Hyprland] Add dimming around rofi layer 2025-09-12 11:54:55 +02:00
7b7955ac29 [Build] Run config build 2025-09-12 11:52:00 +02:00
823a8d8fbc [Setup] Make it quicker for small changes 2025-09-12 11:49:34 +02:00
088562cd53 [System] Remove mkinitcpio config 2025-09-12 11:49:26 +02:00
e9b8c35b52 [Scripts] Rename 2025-09-12 11:42:53 +02:00
5a1811979e [Rofi] Fix positioning 2025-09-12 11:41:21 +02:00
274890281c [Install] Add ripgrep 2025-09-12 10:40:46 +02:00
0606ec06f5 [Hyprland] Add new rules 2025-09-12 10:40:11 +02:00
f22f8da68c [Install] Add git-credential-manager 2025-09-12 10:19:00 +02:00
409078edf9 [Install] Add ruby 2025-09-12 10:15:18 +02:00
2840c9aa70 [Fish] Add fish_variables 2025-09-12 10:13:22 +02:00
f4aedf7b5e [Install] Fix packages 2025-09-12 10:10:58 +02:00
f51cc0049a [Fish] Disable greeting 2025-09-12 10:10:48 +02:00
c01529a599 [Fish] Remove autojump from config 2025-09-12 09:57:40 +02:00
121f02c785 [Yazi] Fix keymap overlap 2025-09-12 09:57:33 +02:00
f6cd98e458 [Install] Add more utilities 2025-09-12 09:57:25 +02:00
cc9f38c71c [Install] Add more features 2025-09-12 09:29:18 +02:00
606a1fec1b [Install] Add auto-install of arch4edu and yay 2025-09-12 08:46:19 +02:00
d3bf33a142 [Install] Add seahorse to install 2025-09-12 06:59:29 +02:00
91a6566d68 [Install] Finish up 2025-09-11 20:25:42 +02:00
ce0d951a54 [Install] Reorganize 2025-09-11 09:22:29 +02:00
106fe9cd9e Restructure bar restart and fix typos in ethz-vpn 2025-09-09 13:28:31 +02:00
a199569aac [Eslint] Increase max line length 2025-08-28 15:44:56 +02:00
80d16ab6ff [Install] Properly install yazi plugins 2025-08-22 14:21:19 +02:00
1c8b72867e [Yazi] Add new plugin 2025-08-22 12:00:06 +02:00
9d59b24995 [Scripts] Add script to update open-webui 2025-08-21 12:14:30 +02:00
e78d07b25b [Base] Remove unnecessary files 2025-08-20 17:25:48 +02:00
a2c11e5cd1 [Yazi] Add keybind to open in evince 2025-08-05 11:21:27 +02:00
70aceee3ca [Build] Build config 2025-07-31 09:08:07 +02:00
8e6340e4c7 [Hyprlock] Update to V0.9 2025-07-31 09:07:19 +02:00
46a4d7628d [Yazi] Add keybinds, start configuring openers 2025-07-28 11:10:03 +02:00
2ec9356aca [Scripts] Prepare for cleanup 2025-07-22 15:52:52 +02:00
3c19159c23 [Install] Use bvi instead of ghex 2025-07-16 15:38:45 +02:00
f6afd785fd [Setup] Fix yazi plugin updates 2025-06-22 15:21:45 +02:00
e20a33e132 [Setup] Fix 2025-06-22 14:49:58 +02:00
4683a171b9 [Astal] Finish up audio fix 2025-06-18 11:59:03 +02:00
4189258def [Astal] Fix audio issues 2025-06-18 11:40:58 +02:00
2e8f1ec9ae [Hypr] Add easy docked switching 2025-06-12 10:08:57 +02:00
78c97c5d84 [Hypr] Add docked config 2025-06-12 10:05:16 +02:00
4540dc00e7 [Eslint] Fix newline 2025-06-11 10:56:47 +02:00
294d7a9a98 [Eslint] Add max-len config 2025-06-11 09:48:34 +02:00
77dd4b4ca8 [Eslint] Add function-paren-newline option 2025-06-11 09:43:48 +02:00
7394ab63bf [Eslint] Change a few options 2025-06-10 17:23:43 +02:00
7f851fac73 [Eslint] Fix errors with single-line interface defintions 2025-06-07 11:18:58 +02:00
a5a6d9a916 [Eslint] Fix issues with end of file extra line 2025-06-06 15:36:12 +02:00
3967a4cd5c [latexfmt] Update align delims 2025-06-06 13:27:45 +02:00
f684f52d8f [latexfmt] Add indents for code 2025-06-06 13:20:52 +02:00
1079f62c06 [Eslint] Fix no-extra-parens config 2025-06-06 13:20:39 +02:00
1f460ccc38 [Eslint] Add support for mjs and cjs, format config 2025-06-06 11:46:57 +02:00
8b7f15eddf [Eslint] Add padding guides 2025-06-06 11:36:04 +02:00
0750c45111 [latexfmt] Finish up latexindent config 2025-06-06 10:59:16 +02:00
0db1815665 [Eslint] Fix spelling error in config 2025-06-06 10:35:04 +02:00
d028b027c5 [Eslint] Add more style options 2025-06-06 10:34:01 +02:00
e91f5aa5d6 [Eslint] Fix end of file newline 2025-06-06 10:27:49 +02:00
6105341234 [Eslint] Finish up config 2025-06-06 09:33:57 +02:00
6a362a963f [Eslint] Fix config 2025-06-05 19:59:45 +02:00
9005bd089a [Hyprland] Increase border size 2025-06-05 17:53:49 +02:00
1921545d08 [Hyprland] Fix keybind for cliphist 2025-06-05 15:40:00 +02:00
05b463699f [Install] Add cliphist 2025-06-05 15:38:19 +02:00
6f33358f4a [Hyprland] Add cliphist 2025-06-05 15:37:44 +02:00
909983d069 [Scripts] Fix indentconfig.yaml 2025-06-05 14:10:04 +02:00
a259206de8 [Scripts] add indentconfig.yaml 2025-06-05 13:33:52 +02:00
3f058cbfd3 [Scripts] Add a script to automatically rename files
This script automatically fixes any file name errors to ensure all files
are named correctly. Use with caution, as I have not yet tested it much
2025-06-04 14:26:32 +02:00
318fc39b61 [Astal] Fix syntax 2025-05-26 15:05:07 +02:00
6b1c8dec58 [Setup] Fix syntax error 2025-05-22 16:47:46 +02:00
3541ec68e7 [Hyprland] Update binds (remove unnecessary ones) 2025-05-22 16:47:33 +02:00
3a3674670b [Hyprland] Update binds 2025-05-22 16:43:27 +02:00
b2c6d72a2f [Hypridle] Improve idle manager 2025-05-22 11:46:20 +02:00
b9c68535d4 [Hypridle] Remove 100s timout 2025-05-22 11:45:28 +02:00
ae5226202a [Install] Remove TODO 2025-05-22 11:27:07 +02:00
580aee4ad5 [Vimiv] Add notes and alias for fish 2025-05-22 10:12:12 +02:00
a8bf678d45 [Astal] Increase max-width of hyprland active window 2025-05-20 17:04:28 +02:00
73feae1142 [Hyprland] Change to dwindle layout 2025-05-20 15:19:18 +02:00
b26b870bb2 [Hyprland] Resize window keybinds 2025-05-20 14:35:39 +02:00
2d3a6ad33f [Astal] Remove debug code 2025-05-20 14:24:25 +02:00
ef9439b92c [Hyprland] Improve gestures 2025-05-19 14:29:40 +02:00
c635f3bfa9 [Build] Run build 2025-05-19 10:02:44 +02:00
7c3eb71150 [Astal] Update memory icon 2025-05-19 09:47:12 +02:00
4fef18041f [Notes] Add another todo 2025-05-16 07:39:25 +02:00
df3384c667 [Notes] Mark completed items, add new todo 2025-05-16 07:37:49 +02:00
7a97d7425e [Bar] Ellipsize too large text 2025-05-15 17:07:06 +02:00
73ca687358 [Fish] Add more aliases 2025-05-13 17:26:44 +02:00
88441958d9 [Yazi] Add more keybinds 2025-05-13 17:26:36 +02:00
e59af388b1 [Kitty] Finish improved cursor_trail settings 2025-05-12 14:17:24 +02:00
39da9176ad [Build] Run build 2025-05-12 13:49:46 +02:00
e4ee9c9dc8 [Kitty] Improve cursor trail 2025-05-12 13:48:54 +02:00
feef8452f4 [Install] Add new programs, restructure 2025-05-09 11:12:02 +02:00
c3ff5a58d6 [AGS] Improve Battery display 2025-05-08 12:53:53 +02:00
a005189aef [Setup] Make bars restart, will be writing new notifications stuff soon 2025-05-08 10:55:31 +02:00
e98f5c2bd7 [Build] Run build 2025-05-08 10:43:00 +02:00
e7f6be4291 [AGS] QuickView: Use better battery icon 2025-05-08 10:42:55 +02:00
4fa7dc3c1a [Eslint] Update arrow-parens to as-needed 2025-05-05 16:15:19 +02:00
2ccb49f24b [Eslint] Finish config 2025-05-05 15:50:56 +02:00
ec04ebee66 [Player] Fix time display 2025-05-05 12:01:07 +02:00
2b2f1c2b66 [Build] Run build 2025-05-03 16:57:46 +02:00
21f7e53b2b [Build] Fix changeable colours 2025-05-03 16:57:39 +02:00
5f09b7b915 [Install] Add new program 2025-04-29 15:35:19 +02:00
688013a6b8 [Hyprland] Add logging for bar & notifier to temp folder 2025-04-29 14:47:56 +02:00
4e7c3ceee8 [Yazi] Remove plugins from here 2025-04-28 10:16:30 +02:00
390874374e [Hyprland] Hyprlock: Animations 2025-04-28 10:16:30 +02:00
601 changed files with 1940166 additions and 18680 deletions

View File

@@ -3,7 +3,16 @@
<h1>janishutz Hyprland</h1>
</div>
Collection of dotfiles for my personal Hyprland setup, running on Arch Linux. Includes a setup and install script (that one is not complete yet though). For my neovim config, see [here](https://git.janishutz.com/janishutz/nvim)
Collection of dotfiles for my personal Hyprland setup, running on Arch Linux.
Includes a setup and install script (that one is not complete yet though).
For my neovim config, see [here](https://git.janishutz.com/janishutz/nvim)
![screenshot of desktop with 2 screens](./assets/screenshot.png)
I am currently working on redoing my keybinds for Hyprland, in what I call `hyprvim`:
They are going to use submaps and will be significantly different, yet still familiar.
This will enable me to have many more keybinds with reasonable starter bindings.
I will also update Astal to have a mode indicator if `hyprvim` is enabled.
## Features
- Astal4 based Status Bar and Quick Actions menu

BIN
assets/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

744
build/eslint.config.mjs Normal file
View File

@@ -0,0 +1,744 @@
import eslint from '@eslint/js';
import globals from 'globals';
import stylistic from '@stylistic/eslint-plugin';
import tseslint from 'typescript-eslint';
import typescript from '@typescript-eslint/eslint-plugin';
import vue from 'eslint-plugin-vue';
const style = {
'plugins': {
'@stylistic': stylistic,
'@stylistic/js': stylistic,
'@stylistic/ts': stylistic
},
'files': [
'**/*.ts',
'**/*.js',
'**/*.mjs',
'**/*.cjs',
'**/*.tsx',
'**/*.jsx'
],
'rules': {
'sort-imports': [
'warn',
{
'ignoreCase': false,
'ignoreDeclarationSort': false,
'ignoreMemberSort': false,
'memberSyntaxSortOrder': [
'none',
'all',
'multiple',
'single'
],
'allowSeparatedGroups': false
}
],
// Formatting
'@stylistic/array-bracket-newline': [
'error',
{
'multiline': false,
'minItems': 2
}
],
'@stylistic/array-bracket-spacing': [
'error',
'always'
],
'@stylistic/array-element-newline': [
'error',
{
'consistent': false,
'multiline': false,
'minItems': 2
}
],
'@stylistic/arrow-parens': [
'error',
'as-needed'
],
'@stylistic/arrow-spacing': [
'error',
{
'before': true,
'after': true
}
],
'@stylistic/block-spacing': [
'error',
'always'
],
'@stylistic/brace-style': [
'error',
'1tbs',
{
'allowSingleLine': false
}
],
'@stylistic/comma-dangle': [
'error',
'never'
],
'@stylistic/comma-spacing': [
'error',
{
'before': false,
'after': true
}
],
'@stylistic/comma-style': [
'error',
'last'
],
'@stylistic/dot-location': [
'error',
'property'
],
'@stylistic/function-call-argument-newline': [
'error',
'consistent'
],
'@stylistic/function-call-spacing': [
'error',
'never'
],
'@stylistic/function-paren-newline': [
'error',
'multiline-arguments'
],
'@stylistic/implicit-arrow-linebreak': [
'error',
'beside'
],
'@stylistic/indent': [
'error',
4
],
'@stylistic/indent-binary-ops': [
'error',
4
],
'@stylistic/key-spacing': [
'error',
{
'beforeColon': false,
'afterColon': true
}
],
'@stylistic/keyword-spacing': [
'error',
{
'before': true,
'after': true
}
],
'@stylistic/lines-between-class-members': [
'error',
'always'
],
'@stylistic/max-len': [
'warn',
{
'code': 140,
'comments': 160,
'ignoreComments': false,
'ignoreUrls': true,
'ignoreStrings': true,
'ignoreTemplateLiterals': true,
'ignoreRegExpLiterals': true
}
],
'@stylistic/max-statements-per-line': [
'error',
{
'max': 1
}
],
'@stylistic/multiline-ternary': [
'error',
'always-multiline'
],
'@stylistic/new-parens': [
'error',
'always'
],
'@stylistic/newline-per-chained-call': 'error',
'@stylistic/no-confusing-arrow': 'error',
'@stylistic/no-extra-parens': [
'error',
'all',
{
'nestedBinaryExpressions': false,
'ternaryOperandBinaryExpressions': false,
'ignoreJSX': 'multi-line',
'nestedConditionalExpressions': false
}
],
'@stylistic/no-extra-semi': 'error',
'@stylistic/no-floating-decimal': 'error',
'@stylistic/no-mixed-operators': 'error',
'@stylistic/no-mixed-spaces-and-tabs': 'error',
'@stylistic/no-multi-spaces': 'error',
'@stylistic/no-multiple-empty-lines': [
'error',
{
'max': 3,
'maxEOF': 2
}
],
'@stylistic/no-tabs': 'error',
'@stylistic/no-trailing-spaces': 'error',
'@stylistic/no-whitespace-before-property': 'error',
'@stylistic/object-curly-newline': [
'error',
{
'multiline': true,
'minProperties': 1
}
],
'@stylistic/object-curly-spacing': [
'error',
'always'
],
'@stylistic/object-property-newline': 'error',
'@stylistic/one-var-declaration-per-line': 'error',
'@stylistic/operator-linebreak': [
'error',
'before'
],
'@stylistic/padded-blocks': [
'error',
{
'blocks': 'never',
'classes': 'always',
'switches': 'never'
}
],
// Padding lines. The most in-depth part of this config
'@stylistic/padding-line-between-statements': [
'error',
// Variables, Constants
{
'blankLine': 'never',
'prev': 'var',
'next': 'var'
},
{
'blankLine': 'never',
'prev': 'let',
'next': 'let'
},
{
'blankLine': 'never',
'prev': 'const',
'next': 'const'
},
{
'blankLine': 'always',
'prev': 'var',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'cjs-import',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'import',
'let',
'return',
'switch',
'throw',
'try',
'var',
'with'
]
},
{
'blankLine': 'always',
'prev': 'let',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'cjs-import',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'import',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
{
'blankLine': 'always',
'prev': 'const',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'cjs-import',
'class',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'import',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
// Import
{
'blankLine': 'never',
'prev': 'import',
'next': 'import'
},
{
'blankLine': 'never',
'prev': 'cjs-import',
'next': 'cjs-import'
},
{
'blankLine': 'always',
'prev': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
],
'next': 'cjs-import'
},
{
'blankLine': 'always',
'prev': 'cjs-import',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
{
'blankLine': 'always',
'prev': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
],
'next': 'import'
},
{
'blankLine': 'always',
'prev': 'import',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
// If
{
'blankLine': 'always',
'prev': '*',
'next': 'if'
},
{
'blankLine': 'always',
'prev': 'if',
'next': '*'
},
// For
{
'blankLine': 'always',
'prev': '*',
'next': 'for'
},
{
'blankLine': 'always',
'prev': 'for',
'next': '*'
},
// While
{
'blankLine': 'always',
'prev': '*',
'next': 'while'
},
{
'blankLine': 'always',
'prev': 'while',
'next': '*'
},
// Functions
{
'blankLine': 'always',
'prev': '*',
'next': 'function'
},
{
'blankLine': 'always',
'prev': 'function',
'next': '*'
},
// Block Statements
{
'blankLine': 'always',
'prev': '*',
'next': 'block-like'
},
{
'blankLine': 'always',
'prev': 'block-like',
'next': '*'
},
// Switch
{
'blankLine': 'always',
'prev': '*',
'next': 'switch'
},
{
'blankLine': 'always',
'prev': 'switch',
'next': '*'
},
// Try-Catch
{
'blankLine': 'always',
'prev': '*',
'next': 'try'
},
{
'blankLine': 'always',
'prev': 'try',
'next': '*'
},
// Throw
{
'blankLine': 'always',
'prev': '*',
'next': 'throw'
},
{
'blankLine': 'always',
'prev': 'throw',
'next': '*'
},
// Return
{
'blankLine': 'never',
'prev': 'return',
'next': '*'
},
{
'blankLine': 'always',
'prev': '*',
'next': 'return'
},
// Export
{
'blankLine': 'always',
'prev': '*',
'next': 'export'
},
{
'blankLine': 'always',
'prev': 'export',
'next': '*'
},
{
'blankLine': 'always',
'prev': '*',
'next': 'cjs-export'
},
{
'blankLine': 'always',
'prev': 'cjs-export',
'next': '*'
},
// Classes
{
'blankLine': 'always',
'prev': '*',
'next': 'class'
},
{
'blankLine': 'always',
'prev': 'class',
'next': '*'
}
],
'@stylistic/quote-props': [
'error',
'always'
],
'@stylistic/quotes': [
'error',
'single'
],
'@stylistic/rest-spread-spacing': [
'error',
'never'
],
'@stylistic/semi': [
'error',
'always'
],
'@stylistic/semi-spacing': [
'error',
{
'before': false,
'after': true
}
],
'@stylistic/semi-style': [
'error',
'last'
],
'@stylistic/space-before-blocks': [
'error',
'always'
],
'@stylistic/space-before-function-paren': [
'error',
'always'
],
'@stylistic/space-in-parens': [
'error',
'always'
],
'@stylistic/space-infix-ops': [
'error',
{
'int32Hint': false
}
],
'@stylistic/space-unary-ops': 'error',
'@stylistic/spaced-comment': [
'error',
'always'
],
'@stylistic/switch-colon-spacing': 'error',
'@stylistic/template-curly-spacing': [
'error',
'always'
],
'@stylistic/template-tag-spacing': [
'error',
'always'
],
'@stylistic/type-generic-spacing': 'error',
'@stylistic/type-named-tuple-spacing': 'error',
'@stylistic/wrap-iife': [
'error',
'inside'
],
'@stylistic/wrap-regex': 'error',
'@stylistic/ts/type-annotation-spacing': 'error'
}
};
/** @type {import('eslint').Linter.Config} */
export default tseslint.config(
// Base JavaScript rules
eslint.configs.recommended,
tseslint.configs.recommended,
style,
// Vue support (including TS and JSX inside SFCs)
{
'files': [ '**/*.vue' ],
'languageOptions': {
'sourceType': 'module',
'ecmaVersion': 'latest',
'globals': globals.browser,
'parserOptions': {
'parser': tseslint.parser
}
},
'plugins': {
'vue': vue,
'@stylistic': stylistic,
'@stylistic/js': stylistic,
'@stylistic/ts': stylistic,
'@typescript-eslint': typescript
},
'extends': [
eslint.configs.recommended,
...vue.configs['flat/recommended']
],
'rules': {
...typescript.configs.recommended.rules,
...style.rules,
// Vue specific rules
'@stylistic/indent': 'off',
'vue/html-indent': [
'error',
4
],
'vue/html-comment-indent': [
'error',
4
],
'vue/script-indent': [
'error',
4,
{
'baseIndent': 1,
'switchCase': 1
}
],
'vue/html-self-closing': [
'error',
{
'html': {
'void': 'never',
'normal': 'never',
'component': 'always'
},
'svg': 'always',
'math': 'never'
}
],
'vue/max-attributes-per-line': [
'error',
{
'singleline': 3,
'multiline': 1
}
]
}
}
);

View File

@@ -1,170 +0,0 @@
const convert = require( 'color-convert' );
const fs = require( 'fs' );
const path = require( 'path' );
/**
* Recursively find all files with extension in a directory
* @param {string} dir The directory to search. Either absolute or relative path
* @param {string} extension The file extension to look for
* @returns {string[]} returns a list of html files with their full path
*/
const treeWalker = ( dir, extension, ignoreList ) => {
const ls = fs.readdirSync( dir );
const fileList = [];
for ( let file in ls ) {
if ( fs.statSync( path.join( dir, ls[ file ] ) ).isDirectory() ) {
// Filter ignored directories
if ( ignoreList === undefined || !ignoreList.includes( ls[ file ] ) ) {
const newFiles = treeWalker( path.join( dir, ls[ file ] ), extension, ignoreList );
for (let file = 0; file < newFiles.length; file++) {
fileList.push( newFiles[ file ] );
}
}
} else if ( extension == '*' || ls[ file ].includes( extension ) ) {
if ( ignoreList === undefined || !ignoreList.includes( ls[ file ] ) ) {
fileList.push( path.join( dir, ls[ file ] ) );
}
}
}
return fileList;
}
const renderColourAsHex = ( colour ) => {
return '#' + convert.default.rgb.hex( colour[ 0 ], colour[ 1 ], colour[ 2 ] );
}
const renderColourAsRGB = ( colour ) => {
return `rgb(${ colour[ 0 ] }, ${ colour[ 1 ] }, ${ colour[ 2 ] })`
}
const renderColourAsRGBA = ( colour, ambiance ) => {
return `rgba(${ colour[ 0 ] }, ${ colour[ 1 ] }, ${ colour[ 2 ] }, ${ ambiance })`
}
const renderColourAsRGBHex = ( colour ) => {
const hexCol = convert.default.rgb.hex( colour[ 0 ], colour[ 1 ], colour[ 2 ] );
return `rgb(${hexCol})`.toLowerCase();
}
function decimalToHex(decimal) {
const hexValue = Math.round(decimal * 255);
return hexValue.toString(16).padStart(2, '0');
}
const renderColourAsRGBAHex = ( colour, ambiance ) => {
const hexCol = convert.default.rgb.hex( colour[ 0 ], colour[ 1 ], colour[ 2 ] );
return `rgba(${hexCol}${decimalToHex(ambiance)})`.toLowerCase();
}
const removeUselessColours = ( palette ) => {
const p = [];
for ( let i = 0; i < palette.length; i++ ) {
const luminance = calculateLuminance( palette[ i ] );
if ( luminance < 215 && luminance > 40 ) {
p.push( palette[ i ] );
}
}
return p;
}
const calculateLuminance = ( colour ) => {
return colour[ 0 ] + colour[ 1 ] + colour[ 2 ] / 3;
}
/*
* Replace the colours with variable names
*/
const replacements = {
'#0f1011': '@bg',
'rgba(9, 9, 10, 0.9)': '@bg_rgba_07',
'rgba(26, 28, 30, 0.3)': '@bg_rgba_05',
'#000': '@bg_accent',
'#000000': '@bg_accent',
'rgba(0, 0, 0, 0.7)': '@bg_accent_rgba_07',
'rgba(0, 0, 0, 0.6)': '@bg_accent_rgba_06',
'rgba(0, 0, 0, 0.5)': '@bg_accent_rgba_05',
'rgba(0, 0, 0, 0.4)': '@bg_accent_rgba_04',
'rgba(0, 0, 0, 0.3)': '@bg_accent_rgba_03',
'rgba(0, 0, 0, 0.12)': '@bg_accent_rgba_015',
'rgba(0, 0, 0, 0.08)': '@bg_accent_rgba_01',
'rgba(9, 9, 10, 0.9)': '@bg_inactive',
'#80868b': '@inactive',
'rgba(128, 134, 139, 0.7)': '@inactive_rgba_07',
'rgba(128, 134, 139, 0.5)': '@inactive_rgba_05',
'rgba(128, 134, 139, 0.3)': '@inactive_rgba_03',
'rgba(128, 134, 139, 0.2)': '@inactive_rgba_02',
// '#555A': '@shadow_rgba',
// '#555': '@shadow',
'#387db7': '@accent',
'rgba(56, 125, 183, 0.5)': '@accent_rgba_05',
'rgba(56, 125, 183, 0.32)': '@accent_rgba_03',
'rgba(56, 125, 183, 0.24)': '@accent_rgba_02',
'rgba(56, 125, 183, 0.16)': '@accent_rgba_015',
'rgba(56, 125, 183, 0.12)': '@accent_rgba_011',
'rgba(56, 125, 183, 0.08)': '@accent_rgba_007',
'#1a1a1b': '@accent_gradient_5',
'#1f1f21': '@accent_gradient_4',
'#1a2530': '@accent_gradient_3',
'#1c2c3b': '@accent_gradient_2',
'#1e3040': '@accent_gradient_1',
'#4887bd': '@accent_gradient_inverse_1',
'#508dc0': '@accent_gradient_inverse_2',
'#5892c3': '@accent_gradient_inverse_3',
'#673ab7': '@accent2',
'rgba(103, 58, 183, 0.12)': '@accent2_rgba_015',
'#fff': '@fg_accent',
'rgba(255, 255, 255, 0.7)': '@fg_accent_rgba_07',
'rgba(255, 255, 255, 0.6)': '@fg_accent_rgba_06',
'rgba(255, 255, 255, 0.5)': '@fg_accent_rgba_05',
'rgba(255, 255, 255, 0.3)': '@fg_accent_rgba_03',
'rgba(255, 255, 255, 0.2)': '@fg_accent_rgba_02',
'#9e9e9e': '@fg',
'rgba(158, 158, 158, 0.7)': '@fg_rgba_07',
'rgba(158, 158, 158, 0.6)': '@fg_rgba_06',
'rgba(158, 158, 158, 0.5)': '@fg_rgba_05',
'rgba(158, 158, 158, 0.3)': '@fg_rgba_03',
'rgba(158, 158, 158, 0.2)': '@fg_rgba_02',
'rgba(158, 158, 158, 0.1168)': '@fg_rgba_01'
};
const themePreProcessor = ( file, replacement, out ) => {
const colours = Object.keys( replacements );
let data = '' + fs.readFileSync( file );
for (let index = 0; index < colours.length; index++) {
const colour = colours[index];
data = data.replaceAll(colour, replacements[ colour ]);
}
const outPath = file.replace( replacement, out );
try {
fs.mkdirSync( path.dirname( outPath ), {
recursive: true,
} );
} catch ( e ) {
console.error( e );
}
fs.writeFileSync( outPath, data );
}
const getGradientColour = ( colour, index, multiplier ) => {
if ( index === 0 ) {
return [ colour[ 0 ] * multiplier, colour[ 1 ] * multiplier, colour[ 2 ] * multiplier ];
}
const gradient = getGradientColour( colour, index - 1, multiplier );
return [ Math.min( 255, gradient[ 0 ] * multiplier ), Math.min( 255, gradient[ 1 ] * multiplier ), Math.min( 255, gradient[ 2 ] * multiplier ) ];
}
module.exports = {
treeWalker,
renderColourAsHex,
renderColourAsRGB,
renderColourAsRGBA,
renderColourAsRGBHex,
renderColourAsRGBAHex,
themePreProcessor,
getGradientColour,
removeUselessColours
}

View File

@@ -1,23 +1,30 @@
{
"name": "janishutz-config-build",
"version": "1.0.0",
"description": "Build janishutz's dotfiles configs",
"repository": {
"type": "git",
"url": "https://git.janishutz.com/janishutz/dotfiles"
},
"license": "GPL-3.0-or-later",
"author": "janishutz",
"type": "commonjs",
"main": "build.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@janishutz/colorthief": "^3.0.2",
"chalk": "^5.4.1",
"color-convert": "^3.0.1",
"inquirer": "^12.5.0",
"mustache": "^4.2.0"
}
"name": "janishutz-config-build",
"version": "1.0.0",
"description": "Build janishutz's dotfiles configs",
"repository": {
"type": "git",
"url": "https://git.janishutz.com/janishutz/dotfiles"
},
"license": "GPL-3.0-or-later",
"author": "janishutz",
"type": "module",
"main": "build.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"dependencies": {
"@janishutz/colorthief": "^3.0.2",
"chalk": "^5.4.1",
"color-convert": "^3.0.1",
"inquirer": "^12.5.0",
"mustache": "^4.2.0"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
"@stylistic/eslint-plugin": "^5.7.1",
"@types/node": "^25.2.0",
"eslint-plugin-vue": "^10.7.0",
"typescript-eslint": "^8.54.0"
}
}

View File

@@ -1,4 +1,22 @@
const util = require( './util' );
import {
Color
} from '../types/colours';
import {
colours
} from '../variables/colors';
import {
fonts
} from '../variables/fonts';
import {
gradientMultipliers
} from '../variables/gradients';
import {
iconTheme
} from '../variables/icons';
import util from './util';
import {
yaziThemes
} from '../variables/yazi';
const renderColourAsRGB = util.renderColourAsRGB;
const renderColourAsRGBA = util.renderColourAsRGBA;
@@ -9,7 +27,7 @@ const renderColourAsHex = util.renderColourAsHex;
// │ Theme generator (returns theme as object) │
// ╰───────────────────────────────────────────────╯
// ───────────────────────────────────────────────────────────────────
module.exports.generateTheme = ( theme, wallpaper, lockpaper, palette ) => {
export const generateTheme = ( theme: string, wallpaper: string, lockpaper: string, palette: Color[] ) => {
return {
'wallpaper-path': wallpaper,
'lockpaper-path': lockpaper,
@@ -154,127 +172,6 @@ module.exports.generateTheme = ( theme, wallpaper, lockpaper, palette ) => {
// ┌ ┐
// │ Path to this repo on disk │
// └ ┘
'path-to-dotfiles': __dirname.slice(0, __dirname.length - 5),
}
}
// ───────────────────────────────────────────────────────────────────
// ╭───────────────────────────────────────────────╮
// │ Theme definitions │
// ╰───────────────────────────────────────────────╯
// ───────────────────────────────────────────────────────────────────
const gradientMultipliers = {
'nordic': 0.9,
'deep-dark': 0.8,
'material': 0.85,
'light': 1.1,
'bright': 1.15,
'test': 0.75
}
const colours = {
foreground: {
'nordic': [ 200, 220, 255 ],
'deep-dark': [ 230, 230, 230 ],
'material': [ 255, 255, 255 ], // TODO: Will be calculated by material theme generator
'light': [ 40, 40, 40 ],
'bright': [ 0, 0, 0 ],
'test': [ 0, 0, 0 ],
},
'foreground-accent': {
'nordic': [ 255, 255, 255 ],
'deep-dark': [ 255, 255, 255 ],
'material': [ 200, 200, 200 ], // TODO: Will be calculated by material theme generator
'light': [ 0, 0, 0 ],
'bright': [ 50, 50, 50 ],
'test': [ 0, 0, 0 ],
},
background: {
'nordic': [ 10, 10, 15 ],
'deep-dark': [ 20, 20, 20 ],
'material': [ 30, 30, 30 ], // TODO: Will be calculated by material theme generator
'light': [ 230, 230, 230 ],
'bright': [ 255, 255, 255 ],
'test': [ 255, 255, 255 ],
},
'background-alternative': {
'nordic': [ 20, 20, 25 ],
'deep-dark': [ 30, 30, 30 ],
'material': [ 40, 40, 40 ], // TODO: Will be calculated by material theme generator
'light': [ 210, 210, 210 ],
'bright': [ 230, 230, 230 ],
'test': [ 255, 255, 0 ] // brown
},
'background-tertiary': {
'nordic': [ 0, 0, 0 ],
'deep-dark': [ 45, 45, 45 ],
'material': [ 0, 0, 0 ], // TODO: Will be calculated by material theme generator
'light': [ 180, 180, 180 ],
'bright': [ 200, 200, 200 ],
'test': [ 255, 0, 255 ] // purple
},
shadow: {
'nordic': [ 0, 0, 2 ],
'deep-dark': [ 40, 40, 40 ],
'material': [ 30, 30, 30 ], // TODO: Will be calculated by material theme generator
'light': [ 190, 190, 190 ],
'bright': [ 150, 150, 150 ],
'test': [ 120, 0, 0 ] // dark red
},
inactive: {
'nordic': [ 200, 200, 200 ],
'deep-dark': [ 200, 200, 200 ],
'material': [ 200, 200, 200 ], // TODO: Will be calculated by material theme generator
'light': [ 65, 65, 65 ],
'bright': [ 60, 60, 60 ],
'test': [ 150, 150, 150 ]
},
'inactive-background': {
'nordic': [ 0, 0, 0 ],
'deep-dark': [ 0, 0, 0 ],
'material': [ 255, 255, 255 ], // TODO: Will be calculated by material theme generator
'light': [ 80, 80, 80 ],
'bright': [ 60, 60, 60 ],
'test': [ 60, 60, 60 ]
}
}
const fonts = {
'primary': {
'nordic': 'Comfortaa',
'deep-dark': 'Comfortaa',
'material': 'Comfortaa',
'light': 'Adwaita Sans',
'bright': 'Adwaita Sans Extralight'
},
'accent': {
'nordic': 'Adwaita Sans',
'deep-dark': 'Adwaita Sans',
'material': 'Adwaita Sans',
'light': 'Cantarell',
'bright': 'Contarell Thin'
},
'mono': {
'nordic': 'Source Code Pro',
'deep-dark': 'Source Code Pro',
'material': 'Source Code Pro',
'light': 'Jetbrains Mono',
'bright': 'Jetbrains Mono',
}
}
const iconTheme = {
'nordic': 'Candy',
'deep-dark': 'Candy',
'material': 'Candy',
'light': 'Candy',
'bright': 'Candy'
}
const yaziThemes = {
'nordic': 'tokyo-night',
'deep-dark': 'vscode-dark-modern',
'material': 'dracula',
'light': 'vscode-light-modern',
'bright': 'vscode-light-modern',
}
'path-to-dotfiles': __dirname.slice( 0, __dirname.length - 5 )
};
};

View File

@@ -1,47 +1,67 @@
const mustache = require( 'mustache' );
const colorThief = require( '@janishutz/colorthief' );
const fs = require( 'fs' );
const path = require( 'path' );
const util = require( './util' );
const generateTheme = require( './generateTheme' );
const chalk = require( 'chalk' ).default;
const inquirer = require( 'inquirer' ).default;
import chalk from 'chalk';
import colorThief from '@janishutz/colorthief';
import fs from 'fs';
import inquirer from 'inquirer';
import mustache from 'mustache';
import path from 'path';
import util from './util';
const build = ( wallpaper, lockpaper, theme ) => {
const build = ( wallpaper: string, lockpaper: string, theme: string ) => {
console.log( '\n=> Extracting colours' );
// Extract colour palette from chosen wallpaper using Color-Thief
colorThief.getPalette( wallpaper ).then( palette => {
colorThief.getPalette( wallpaper, 20 ).then( palette => {
palette = util.removeUselessColours( palette );
// Define view options (for rendering with mustache)
if ( theme === 'test' ) {
palette = [ [ 255, 0, 0 ], [ 0, 255, 0 ], [ 0, 0, 255 ] ];
palette = [
[
255,
0,
0
],
[
0,
255,
0
],
[
0,
0,
255
]
];
}
console.log( 'The following colours will be used based on your wallpaper: ' );
let col = palette[ 0 ];
console.log( ' => Primary accent colour: ' + chalk.rgb( col[ 0 ], col[ 1 ], col[ 2 ] )( util.renderColourAsHex( col ) ) );
col = palette[ 1 ];
console.log( ' => Secondary accent colour: ' + chalk.rgb( col[ 0 ], col[ 1 ], col[ 2 ] )( util.renderColourAsHex( col ) ) );
col = palette[ 2 ];
console.log( ' => Tertiary accent colour: ' + chalk.rgb( col[ 0 ], col[ 1 ], col[ 2 ] )( util.renderColourAsHex( col ) ) );
inquirer.prompt( [{
type: 'confirm',
name: 'confirm-proceed-build',
message: 'Okay to proceed with these colours?'
inquirer.prompt( [ {
'type': 'confirm',
'name': 'confirm-proceed-build',
'message': 'Okay to proceed with these colours?'
} ] ).then( answer => {
if ( answer ) proceedWithBuild( wallpaper, lockpaper, theme, palette );
if ( answer['confirm-proceed-build'] ) proceedWithBuild( wallpaper, lockpaper, theme, palette );
else {
// Have the user pick any other of the extracted colours instead
let counter = -1;
const colourOptions = palette.map( c => {
counter++;
return {
name: chalk.rgb( c[ 0 ], c[ 1 ], c[ 2 ] )( util.renderColourAsHex( c ) ),
value: counter
}
} )
inquirer.prompt( [
'name': chalk.rgb( c[ 0 ], c[ 1 ], c[ 2 ] )( util.renderColourAsHex( c ) ),
'value': counter
};
} );
inquirer.prompt( [
{
'type': 'list',
'message': 'Pick the primary accent colour',
@@ -61,24 +81,31 @@ const build = ( wallpaper, lockpaper, theme ) => {
'name': 'tertiary'
}
] ).then( result => {
const p = [ palette[ result.primary ], palette[ result.secondary ], palette[ result.tertiary ] ];
const p = [
palette[ result.primary ],
palette[ result.secondary ],
palette[ result.tertiary ]
];
proceedWithBuild( wallpaper, lockpaper, theme, p );
} ).catch( e => {
console.error( e );
process.exit( 1 );
} );
} )
.catch( e => {
console.error( e );
process.exit( 1 );
} );
}
} ).catch( e => {
} )
.catch( e => {
console.error( e );
process.exit( 1 );
} );
} )
.catch( e => {
console.error( e );
console.error( '\n=> Failed to load image or retrieve colour palette from it' );
process.exit( 1 );
} );
} ).catch( e => {
console.error( e );
console.error( '\n=> Failed to load image or retrieve colour palette from it' );
process.exit( 1 );
} );
}
};
const proceedWithBuild = ( wallpaper, lockpaper, theme, palette ) => {
@@ -92,9 +119,15 @@ const proceedWithBuild = ( wallpaper, lockpaper, theme, palette ) => {
// recursively index files from config directory -> Maybe add a file to each
// directory to indicate whether or not to index files in it?
const fileList = util.treeWalker( path.join( __dirname, '/../../renderable/' ), '*', [ 'node_modules', '@girs', '.gitignore', '.git', 'flavours' ] );
const fileList = util.treeWalker( path.join( __dirname, '/../../renderable/' ), '*', [
'node_modules',
'@girs',
'.gitignore',
'.git',
'flavours'
] );
for (let index = 0; index < fileList.length; index++) {
for ( let index = 0; index < fileList.length; index++ ) {
try {
render( fileList[ index ], view );
} catch ( e ) {
@@ -105,7 +138,7 @@ const proceedWithBuild = ( wallpaper, lockpaper, theme, palette ) => {
util.themePreProcessor( path.join( __dirname, '/../../gtk-theme/src/gtk-4.0/gtk.css' ), 'src', 'dist' );
util.themePreProcessor( path.join( __dirname, '/../../gtk-theme/src/gtk-3.0/gtk.css' ), 'src', 'dist' );
render( path.join( __dirname, '/../../gtk-theme/src/colours.css' ), view, 'src', 'dist' );
}
};
/**
* @param {string} templatePath - absolute path to config directory
@@ -117,16 +150,19 @@ const render = ( templatePath, view, originalDir = 'renderable', newDir = 'confi
// Load template from disk (all can be found in <project-root>/renderable)
// TODO: Make exclusion better plus copy other files maybe?
const template = '' + fs.readFileSync( templatePath );
const outPath = path.join( templatePath.replace( originalDir, newDir ) );
const outPath = path.join( templatePath.replace( originalDir, newDir ) );
console.log( '=> Rendering to ' + outPath );
try {
fs.mkdirSync( path.dirname( outPath ), {
recursive: true,
'recursive': true
} );
} catch ( e ) {
console.error( e );
}
fs.writeFileSync( outPath, mustache.render( template, view ) );
}
};
module.exports = build;

150
build/src/helpers/util.ts Normal file
View File

@@ -0,0 +1,150 @@
import {
Color
} from '../types/colours';
import convert from 'color-convert';
import fs from 'fs';
import path from 'path';
import {
replacements
} from '../variables/replacements';
/**
* Recursively find all files with extension in a directory
* @param {string} dir The directory to search. Either absolute or relative path
* @param {string} extension The file extension to look for
* @returns {string[]} returns a list of html files with their full path
*/
const treeWalker = ( dir: string, extension: string, ignoreList: string[] ): string[] => {
const ls = fs.readdirSync( dir );
const fileList = [];
for ( const file in ls ) {
if ( fs.statSync( path.join( dir, ls[ file ] ) ).isDirectory() ) {
// Filter ignored directories
if ( ignoreList === undefined || !ignoreList.includes( ls[ file ] ) ) {
const newFiles = treeWalker( path.join( dir, ls[ file ] ), extension, ignoreList );
for ( let file = 0; file < newFiles.length; file++ ) {
fileList.push( newFiles[ file ] );
}
}
} else if ( extension == '*' || ls[ file ].includes( extension ) ) {
if ( ignoreList === undefined || !ignoreList.includes( ls[ file ] ) ) {
fileList.push( path.join( dir, ls[ file ] ) );
}
}
}
return fileList;
};
const renderColourAsHex = ( colour: Color ) => {
return '#' + convert.rgb.hex( colour[ 0 ], colour[ 1 ], colour[ 2 ] );
};
const renderColourAsRGB = ( colour: Color ) => {
return `rgb(${ colour[ 0 ] }, ${ colour[ 1 ] }, ${ colour[ 2 ] })`;
};
const renderColourAsRGBA = ( colour: Color, ambiance: number ) => {
return `rgba(${ colour[ 0 ] }, ${ colour[ 1 ] }, ${ colour[ 2 ] }, ${ ambiance })`;
};
const renderColourAsRGBHex = ( colour: Color ) => {
const hexCol = convert.rgb.hex( colour[ 0 ], colour[ 1 ], colour[ 2 ] );
return `rgb(${ hexCol })`.toLowerCase();
};
function decimalToHex ( decimal: number ) {
const hexValue = Math.round( decimal * 255 );
return hexValue.toString( 16 ).padStart( 2, '0' );
}
const renderColourAsRGBAHex = ( colour: Color, ambiance: number ) => {
const hexCol = convert.rgb.hex( colour[ 0 ], colour[ 1 ], colour[ 2 ] );
return `rgba(${ hexCol }${ decimalToHex( ambiance ) })`.toLowerCase();
};
const removeUselessColours = ( palette: Color[] ) => {
const p = [];
for ( let i = 0; i < palette.length; i++ ) {
const el = palette[ i ];
const luminance = calculateLuminance( palette[ i ] );
if ( luminance < 210 && luminance > 40 ) {
p.push( palette[ i ] );
}
for ( let j = 0; j < el.length; j++ ) {
if ( el[j] > 70 ) {
p.push( palette[ i ] );
break;
}
}
}
return p;
};
const calculateLuminance = ( colour: Color ) => {
return colour[ 0 ] + colour[ 1 ] + ( colour[ 2 ] / 3 );
};
const themePreProcessor = ( file: string, replacement: string, out: string ) => {
const colours = Object.keys( replacements );
let data = '' + fs.readFileSync( file );
for ( let index = 0; index < colours.length; index++ ) {
const colour = colours[index];
data = data.replaceAll( colour, replacements[ colour ] );
}
const outPath = file.replace( replacement, out );
try {
fs.mkdirSync( path.dirname( outPath ), {
'recursive': true
} );
} catch ( e ) {
console.error( e );
}
fs.writeFileSync( outPath, data );
};
const getGradientColour = ( colour: Color, index: number, multiplier: number ): Color => {
if ( index === 0 ) {
return [
colour[ 0 ] * multiplier,
colour[ 1 ] * multiplier,
colour[ 2 ] * multiplier
];
}
const gradient = getGradientColour( colour, index - 1, multiplier );
return [
Math.min( 255, gradient[ 0 ] * multiplier ),
Math.min( 255, gradient[ 1 ] * multiplier ),
Math.min( 255, gradient[ 2 ] * multiplier )
];
};
export default {
treeWalker,
renderColourAsHex,
renderColourAsRGB,
renderColourAsRGBA,
renderColourAsRGBHex,
renderColourAsRGBAHex,
themePreProcessor,
getGradientColour,
removeUselessColours
};

View File

@@ -1,29 +1,37 @@
const fs = require( 'fs' );
const path = require( 'path' );
const data = '' + fs.readFileSync( '/usr/share/themes/Material-Black-Blueberry/gtk-4.0/gtk.css' );
let lineNumber = 1;
const indexer = {};
for (let i = 0; i < data.length; i++) {
for ( let i = 0; i < data.length; i++ ) {
const char = data[i];
if ( char === '\n' ) {
lineNumber++;
} else if ( char === '#' ) {
const extract = data.substring( i );
const col = extract.slice( 0, extract.indexOf( '\n' ) );
if ( !indexer[ col ] ) {
indexer[ col ] = [];
}
indexer[ col ].push( lineNumber );
} else if ( char === 'r' ) {
const extract = data.substring( i );
if ( extract.slice( 0, 3 ) === 'rgb' ) {
const col = extract.slice( 0, extract.indexOf( '\n' ) );
if ( !indexer[ col ] ) {
indexer[ col ] = [];
}
indexer[ col ].push( lineNumber );
}
}
@@ -32,7 +40,8 @@ for (let i = 0; i < data.length; i++) {
// Output
const keys = Object.keys( indexer );
for (let i = 0; i < keys.length; i++) {
for ( let i = 0; i < keys.length; i++ ) {
const element = keys[i];
if ( element.length <= 25 ) {

1
build/src/types/colours.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
export type Color = number[];

View File

@@ -0,0 +1,266 @@
import {
Color
} from '../types/colours';
export const colours: {
[key: string]: {
[key: string]: Color
}
} = {
'foreground': {
'nordic': [
200,
220,
255
],
'deep-dark': [
230,
230,
230
],
'material': [
255,
255,
255
], // TODO: Will be calculated by material theme generator
'light': [
40,
40,
40
],
'bright': [
0,
0,
0
],
'test': [
0,
0,
0
]
},
'foreground-accent': {
'nordic': [
255,
255,
255
],
'deep-dark': [
255,
255,
255
],
'material': [
200,
200,
200
], // TODO: Will be calculated by material theme generator
'light': [
0,
0,
0
],
'bright': [
50,
50,
50
],
'test': [
0,
0,
0
]
},
'background': {
'nordic': [
10,
10,
15
],
'deep-dark': [
20,
20,
20
],
'material': [
30,
30,
30
], // TODO: Will be calculated by material theme generator
'light': [
230,
230,
230
],
'bright': [
255,
255,
255
],
'test': [
255,
255,
255
]
},
'background-alternative': {
'nordic': [
20,
20,
25
],
'deep-dark': [
30,
30,
30
],
'material': [
40,
40,
40
], // TODO: Will be calculated by material theme generator
'light': [
210,
210,
210
],
'bright': [
230,
230,
230
],
'test': [
255,
255,
0
] // brown
},
'background-tertiary': {
'nordic': [
0,
0,
0
],
'deep-dark': [
45,
45,
45
],
'material': [
0,
0,
0
], // TODO: Will be calculated by material theme generator
'light': [
180,
180,
180
],
'bright': [
200,
200,
200
],
'test': [
255,
0,
255
] // purple
},
'shadow': {
'nordic': [
0,
0,
2
],
'deep-dark': [
40,
40,
40
],
'material': [
30,
30,
30
], // TODO: Will be calculated by material theme generator
'light': [
190,
190,
190
],
'bright': [
150,
150,
150
],
'test': [
120,
0,
0
] // dark red
},
'inactive': {
'nordic': [
200,
200,
200
],
'deep-dark': [
200,
200,
200
],
'material': [
200,
200,
200
], // TODO: Will be calculated by material theme generator
'light': [
65,
65,
65
],
'bright': [
60,
60,
60
],
'test': [
150,
150,
150
]
},
'inactive-background': {
'nordic': [
0,
0,
0
],
'deep-dark': [
0,
0,
0
],
'material': [
255,
255,
255
], // TODO: Will be calculated by material theme generator
'light': [
80,
80,
80
],
'bright': [
60,
60,
60
],
'test': [
60,
60,
60
]
}
};

View File

@@ -0,0 +1,27 @@
export const fonts: {
[key: string]: {
[key]: string
}
} = {
'primary': {
'nordic': 'Comfortaa',
'deep-dark': 'Comfortaa',
'material': 'Comfortaa',
'light': 'Adwaita Sans',
'bright': 'Adwaita Sans Extralight'
},
'accent': {
'nordic': 'Adwaita Sans',
'deep-dark': 'Adwaita Sans',
'material': 'Adwaita Sans',
'light': 'Cantarell',
'bright': 'Contarell Thin'
},
'mono': {
'nordic': 'Source Code Pro',
'deep-dark': 'Source Code Pro',
'material': 'Source Code Pro',
'light': 'Jetbrains Mono',
'bright': 'Jetbrains Mono'
}
};

View File

@@ -0,0 +1,10 @@
export const gradientMultipliers: {
[key: string]: number
} = {
'nordic': 0.9,
'deep-dark': 0.8,
'material': 0.85,
'light': 1.1,
'bright': 1.15,
'test': 0.75
};

View File

@@ -0,0 +1,9 @@
export const iconTheme: {
[key: string]: string
} = {
'nordic': 'Candy',
'deep-dark': 'Candy',
'material': 'Candy',
'light': 'Candy',
'bright': 'Candy'
};

View File

@@ -0,0 +1,56 @@
/*
* Replace the colours with variable names
*/
export const replacements: {
[key: string]: string
} = {
'#0f1011': '@bg',
'rgba(9, 9, 10, 0.9)': '@bg_rgba_07',
'rgba(26, 28, 30, 0.3)': '@bg_rgba_05',
'#000': '@bg_accent',
'#000000': '@bg_accent',
'rgba(0, 0, 0, 0.7)': '@bg_accent_rgba_07',
'rgba(0, 0, 0, 0.6)': '@bg_accent_rgba_06',
'rgba(0, 0, 0, 0.5)': '@bg_accent_rgba_05',
'rgba(0, 0, 0, 0.4)': '@bg_accent_rgba_04',
'rgba(0, 0, 0, 0.3)': '@bg_accent_rgba_03',
'rgba(0, 0, 0, 0.12)': '@bg_accent_rgba_015',
'rgba(0, 0, 0, 0.08)': '@bg_accent_rgba_01',
'#80868b': '@inactive',
'rgba(128, 134, 139, 0.7)': '@inactive_rgba_07',
'rgba(128, 134, 139, 0.5)': '@inactive_rgba_05',
'rgba(128, 134, 139, 0.3)': '@inactive_rgba_03',
'rgba(128, 134, 139, 0.2)': '@inactive_rgba_02',
// '#555A': '@shadow_rgba',
// '#555': '@shadow',
'#387db7': '@accent',
'rgba(56, 125, 183, 0.5)': '@accent_rgba_05',
'rgba(56, 125, 183, 0.32)': '@accent_rgba_03',
'rgba(56, 125, 183, 0.24)': '@accent_rgba_02',
'rgba(56, 125, 183, 0.16)': '@accent_rgba_015',
'rgba(56, 125, 183, 0.12)': '@accent_rgba_011',
'rgba(56, 125, 183, 0.08)': '@accent_rgba_007',
'#1a1a1b': '@accent_gradient_5',
'#1f1f21': '@accent_gradient_4',
'#1a2530': '@accent_gradient_3',
'#1c2c3b': '@accent_gradient_2',
'#1e3040': '@accent_gradient_1',
'#4887bd': '@accent_gradient_inverse_1',
'#508dc0': '@accent_gradient_inverse_2',
'#5892c3': '@accent_gradient_inverse_3',
'#673ab7': '@accent2',
'rgba(103, 58, 183, 0.12)': '@accent2_rgba_015',
'#fff': '@fg_accent',
'rgba(255, 255, 255, 0.7)': '@fg_accent_rgba_07',
'rgba(255, 255, 255, 0.6)': '@fg_accent_rgba_06',
'rgba(255, 255, 255, 0.5)': '@fg_accent_rgba_05',
'rgba(255, 255, 255, 0.3)': '@fg_accent_rgba_03',
'rgba(255, 255, 255, 0.2)': '@fg_accent_rgba_02',
'#9e9e9e': '@fg',
'rgba(158, 158, 158, 0.7)': '@fg_rgba_07',
'rgba(158, 158, 158, 0.6)': '@fg_rgba_06',
'rgba(158, 158, 158, 0.5)': '@fg_rgba_05',
'rgba(158, 158, 158, 0.3)': '@fg_rgba_03',
'rgba(158, 158, 158, 0.2)': '@fg_rgba_02',
'rgba(158, 158, 158, 0.1168)': '@fg_rgba_01'
};

View File

@@ -0,0 +1,9 @@
export const yaziThemes: {
[key: string]: string
} = {
'nordic': 'tokyo-night',
'deep-dark': 'vscode-dark-modern',
'material': 'dracula',
'light': 'vscode-light-modern',
'bright': 'vscode-light-modern'
};

View File

@@ -1,5 +0,0 @@
{
"gen": {
"overrides": {}
}
}

View File

@@ -1,19 +0,0 @@
import { App } from "astal/gtk4"
import style from "./style.scss"
import Bar from "./ui/Launcher"
App.start({
css: style,
main() {
App.get_monitors().map(Bar)
},
requestHandler(request, res) {
if ( request === 'open' ) {
res( 'ok' );
} else if ( request === 'close' ) {
res( 'ok' );
} else if ( request === 'toggle' ) {
res( 'ok' );
}
}
})

View File

@@ -1,75 +0,0 @@
/*
* dotfiles - components.d.ts
*
* Created by Janis Hutz 03/22/2025, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import type { UIComponent, ResultElement } from "./rendering";
export interface App extends ResultElement {
/**
* The app start command that will be executed
*/
command: string;
}
// TODO: Finish
export interface DictionaryEntry extends ResultElement {
/**
* Execute no command
*/
action: null;
/**
* The dictionary definition
*/
definition: string;
}
export interface CMDOutput extends ResultElement {
/**
* Stdout from the command that was run
*/
result: string;
}
export interface Calculation extends ResultElement {
/**
* THe calculation result
*/
result: string;
}
/* ************* *
* UI Components *
* ************* */
export interface LargeUIComponent extends UIComponent {
/**
* The number of items to display per line. Image size will automatically be scaled
* based on width
*/
itemsPerLine: number;
}
export interface MediumUIComponent extends UIComponent {}
export interface ListUIComponent extends UIComponent {}
export interface DictionaryUIComponent extends UIComponent {
elements: DictionaryEntry[];
}
export interface CMDOutputUIComponent extends UIComponent {
elements: CMDOutput[];
}
export interface CalculationUIComponent extends UIComponent {
elements: Calculation[];
}

View File

@@ -1,60 +0,0 @@
/*
* dotfiles - rendering.d.ts
*
* Created by Janis Hutz 03/22/2025, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
export interface UIComponent {
/**
* The title of the component (like a category name), shown above small divider line
*/
title: string;
/**
* ResultElement list, made up of all elements that should be shown
*/
elements: ResultElement[];
/**
* Choose how many elements to show before truncating (will expand when command is run)
*/
truncate: number;
/**
* The weight of the element (determines order)
*/
weight: number;
}
export interface ResultElement {
/**
* The name of the result element
*/
name: string;
/**
* Path to the image to be displayed in the UI
*/
img: string;
/**
* The weight of the element (determines order)
*/
weight: number;
/**
* The action to be executed
*/
action: Action;
/**
* The font size of the text (optional)
*/
fontSize: number | undefined;
}
type Action = '' | null;

View File

@@ -1,32 +0,0 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fast_fuzzy_1 = require("fast-fuzzy");
const fs_1 = __importDefault(require("fs"));
// Get list source from args
// ARGS: type source
// Then we read query from stdin to not restart indexing & the like for each keystroke
let data = [];
if (process.argv[2] === 'fs') {
if (process.argv[3].includes('.json')) {
data = JSON.parse('' + fs_1.default.readFileSync(process.argv[3]));
}
else if (process.argv[3].includes('.txt')) {
data = ('' + fs_1.default.readFileSync(process.argv[3])).split(',');
}
else if (fs_1.default.statSync(process.argv[3]).isDirectory()) {
data = fs_1.default.readdirSync(process.argv[3]);
}
}
else if (process.argv[2] === 'arg') {
data = process.argv[3].split(',');
}
else {
throw new Error('Invalid argument at position 1. Can be either fs or arg, not ' + process.argv[2]);
}
process.stdin.on("data", (query) => {
// On stdin submit (which the other client will have to support) process data
console.log((0, fast_fuzzy_1.search)(query.toString(), data));
});

View File

@@ -1,18 +0,0 @@
{
"name": "fzf",
"version": "1.0.0",
"description": "",
"license": "ISC",
"author": "",
"type": "commonjs",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"@types/node": "^22.14.0"
},
"dependencies": {
"fast-fuzzy": "^1.12.0"
}
}

View File

@@ -1,27 +0,0 @@
import { search } from 'fast-fuzzy';
import fs from 'fs';
// Get list source from args
// ARGS: type source
// Then we read query from stdin to not restart indexing & the like for each keystroke
let data: string[] = [];
if ( process.argv[ 2 ] === 'fs' ) {
if ( process.argv[ 3 ].includes( '.json' ) ) {
data = JSON.parse( '' + fs.readFileSync( process.argv[ 3 ] ) );
} else if ( process.argv[ 3 ].includes( '.txt' ) ) {
data = ( '' + fs.readFileSync( process.argv[ 3 ] ) ).split( ',' );
} else if ( fs.statSync( process.argv[ 3 ] ).isDirectory() ) {
data = fs.readdirSync( process.argv[ 3 ] );
}
} else if ( process.argv[ 2 ] === 'arg' ) {
data = process.argv[ 3 ].split( ',' );
} else {
throw new Error( 'Invalid argument at position 1. Can be either fs or arg, not ' + process.argv[ 2 ] );
}
process.stdin.on( "data", ( query ) => {
// On stdin submit (which the other client will have to support) process data
console.log( search( query.toString(), data ) );
} );

View File

@@ -1,13 +0,0 @@
{
"compilerOptions": {
"outDir": "./dist",
"allowJs": true,
"target": "ES6",
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"types": ["node"],
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": [ "./src/**/*" ],
}

View File

@@ -1,20 +0,0 @@
// https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/theme/Adwaita/_colors-public.scss
$fg-color: #{"@theme_fg_color"};
$bg-color: #{"@theme_bg_color"};
window.Bar {
background: transparent;
color: $fg-color;
font-weight: bold;
>centerbox {
background: $bg-color;
border-radius: 10px;
margin: 8px;
}
button {
border-radius: 8px;
margin: 2px;
}
}

View File

@@ -1,32 +0,0 @@
import { App, Astal, Gtk, Gdk } from "astal/gtk4"
import { Variable } from "astal"
function hide() {
App.get_window("launcher")!.hide()
}
export default function Launcher(monitor: Gdk.Monitor) {
const { CENTER } = Gtk.Align
const width = Variable(1000)
const text = Variable("")
return <window
name="launcher"
anchor={Astal.WindowAnchor.TOP | Astal.WindowAnchor.BOTTOM}
exclusivity={Astal.Exclusivity.IGNORE}
keymode={Astal.Keymode.ON_DEMAND}
application={App}
onShow={(self) => {
text.set("")
width.set(self.get_current_monitor().get_width_mm())
}}
onKeyPressed={(self, keyval, keycode) => {
print( 'key pressed: ' + keyval + ' which has code ' + keycode );
}}>
<box>
</box>
</window>
}

View File

@@ -1,3 +0,0 @@
export default () => {
return <box></box>
}

View File

@@ -1,12 +0,0 @@
/*
* dotfiles - file.ts
*
* Created by Janis Hutz 03/22/2025, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import { readFileAsync, writeFileAsync, monitorFile } from "astal";

View File

@@ -1,24 +0,0 @@
/*
* dotfiles - fzf.ts
*
* Created by Janis Hutz 03/30/2025, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import AstalApps from "gi://AstalApps?version=0.1"
// TODO: For all astal apps, read a global colours config file
const fzfApplication = ( query: string ) => {
const apps = new AstalApps.Apps()
return apps.fuzzy_query( query );
}
const fzfCmd = ( query: string ) => {
}
export default {
fzfApplication
}

View File

@@ -1,51 +0,0 @@
/*
* dotfiles - search.ts
*
* Created by Janis Hutz 03/22/2025, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import subprocessRunner from "./subprocessRunner";
import fzf from "./fzf";
const preprocess = ( input: string ) => {
// Find out what kind of instruction to process
if ( input.startsWith( ':' ) ) {
processCommand( input.substring( 1, input.indexOf( ' ' ) ), input.substring( input.indexOf( ' ' ) ).split( ' ' ) );
} else if ( input.startsWith( '!' ) ) {
processBang( input.substring( 1, input.indexOf( ' ' ) ), input.substring( input.indexOf( ' ' ) ) );
} else {
// Determine if entered string is calculation or not
// We can easily do that by asking qalc (qalculate cli) if this is fine
subprocessRunner.executeCommand( 'qalc "' + input + '"' ).then( out => {
// we get a calculation result here
print( out );
processCalculation( out );
} ).catch( err => {
processSearch( input );
print( err );
} );
}
}
const processSearch = ( input: string ) => {
}
const processCalculation = ( output: string ) => {
}
const processCommand = ( cmd: string, args: string[] ) => {
}
const processBang = ( bang: string, input: string ) => {
}
export default {
preprocess
}

View File

@@ -1,43 +0,0 @@
/*
* dotfiles - subprocessRunner.ts
*
* Created by Janis Hutz 03/22/2025, Licensed under the GPL V3 License
* https://janishutz.com, development@janishutz.com
*
*
*/
import { subprocess, execAsync, Process } from "astal/process";
// TODO: Get cwd and the likes to then use that to run JavaScript files with node / python with python, etc
/**
* Run a subprocess. If you simply want to run a command that doesn't need continuous updates
* run executeCommand instead.
* @param cmd - The command to be run
* @param onOut - Calback function for stdout of the subprocess
* @param onErr - [TODO:description]
* @returns [TODO:return]
*/
const startSubProcess = (
cmd: string | string[],
onOut: (stdout: string) => void,
onErr: (stderr: string) => void | undefined,
): Process => {
return subprocess( cmd, onOut, onErr );
};
/**
* Run a command. If you need continuous updates, run startSubProcess instead
* @param cmd - The command to be run. Either a string or an array of strings
* @returns A Promise resolving to stdout of the command
*/
const executeCommand = (cmd: string | string[]): Promise<string> => {
return execAsync( cmd );
};
export default {
startSubProcess,
executeCommand
}

View File

@@ -1,2 +0,0 @@
node_modules/
@girs/

View File

@@ -1,21 +0,0 @@
declare const SRC: string
declare module "inline:*" {
const content: string
export default content
}
declare module "*.scss" {
const content: string
export default content
}
declare module "*.blp" {
const content: string
export default content
}
declare module "*.css" {
const content: string
export default content
}

View File

@@ -1,2 +0,0 @@
node_modules/
@girs/

View File

@@ -1,85 +0,0 @@
import { exec } from "astal";
import { Gtk } from "astal/gtk4";
const PowerMenu = (): Gtk.Popover => {
const popover = new Gtk.Popover({ cssClasses: ["PowerMenu"] });
const powerMenuBox = () => {
return (
<box>
<button
cssClasses={["power-button"]}
child={
<image iconName={"system-shutdown-symbolic"}></image>
}
onClicked={() => exec("/bin/sh -c 'shutdown now'")}
></button>
<button
cssClasses={["power-button"]}
child={<image iconName={"system-reboot-symbolic"}></image>}
onClicked={() => exec("/bin/sh -c 'reboot'")}
></button>
<button
cssClasses={["power-button"]}
child={<image iconName={"system-suspend-symbolic"}></image>}
onClicked={() => exec("/bin/sh -c 'systemctl suspend'")}
></button>
</box>
);
};
popover.set_child(powerMenuBox());
return popover;
};
const Power = () => {
const pm = PowerMenu();
return (
<button
widthRequest={0}
hexpand={false}
vexpand={false}
cssClasses={["power-menu-button"]}
child={
<box>
<image iconName={"system-shutdown-symbolic"}></image>
{pm}
</box>
}
onClicked={() => pm.popup()}
/>
);
};
const UserMenu = (): Gtk.Popover => {
const popover = new Gtk.Popover();
const powerMenuBox = () => {
return (
<box>
<button
cssClasses={["power-button"]}
child={
<image iconName={"system-lock-screen-symbolic"}></image>
}
onClicked={() => exec("/bin/sh -c 'hyprlock'")}
></button>
<button
cssClasses={["power-button"]}
child={<image iconName={"system-log-out-symbolic"}></image>}
onClicked={() =>
exec("/bin/sh -c 'hyprctl dispatch exit 0'")
}
></button>
</box>
);
};
popover.set_child(powerMenuBox());
return popover;
};
export default {
Power,
UserMenu
};

View File

@@ -1,143 +0,0 @@
import AstalTray from "gi://AstalTray";
import { bind, GObject } from "astal";
import AstalHyprland from "gi://AstalHyprland";
import { Gtk } from "astal/gtk4";
const hypr = AstalHyprland.get_default();
const SYNC = GObject.BindingFlags.SYNC_CREATE;
const SysTray = () => {
const trayBox = new Gtk.Box({ cssClasses: ["bar-button"] });
const tray = AstalTray.get_default();
const trayItems = new Map<string, Gtk.MenuButton>();
const trayAddedHandler = tray.connect("item-added", (_, id) => {
const item = tray.get_item(id);
const popover = Gtk.PopoverMenu.new_from_model(item.menu_model);
const icon = new Gtk.Image();
const button = new Gtk.MenuButton({
popover,
child: icon,
cssClasses: ["tray-item"],
});
item.bind_property("gicon", icon, "gicon", SYNC);
popover.insert_action_group("dbusmenu", item.action_group);
item.connect("notify::action-group", () => {
popover.insert_action_group("dbusmenu", item.action_group);
});
trayItems.set(id, button);
trayBox.append(button);
});
const trayRemovedHandler = tray.connect("item-removed", (_, id) => {
const button = trayItems.get(id);
if (button) {
trayBox.remove(button);
button.run_dispose();
trayItems.delete(id);
}
});
trayBox.connect("destroy", () => {
tray.disconnect(trayAddedHandler);
tray.disconnect(trayRemovedHandler);
});
return trayBox;
};
const Workspace = () => {
return (
<box>
{bind(hypr, "workspaces").as(wss =>
wss
.filter(ws => !(ws.id >= -99 && ws.id <= -2)) // filter out special workspaces
.sort((a, b) => a.id - b.id)
.map(ws => (
<button
cssClasses={bind(hypr, "focusedWorkspace").as(fw =>
ws === fw
? [
"focused-workspace-button",
"workspace-button",
]
: ["workspace-button"],
)}
onButtonPressed={() => ws.focus()}
child={<label label={String(ws.id)}></label>}
></button>
)),
)}
</box>
);
};
/**
* Displays the name of the currently active window and provides a popover for
* displaying all available clients
*/
const ActiveWindow = () => {
const focused = bind(hypr, "focusedClient");
const WindowPopover = (): Gtk.Popover => {
// Set up boxes + Popover
const popover = new Gtk.Popover();
const popoverBox = WindowPopoverBox();
popover.set_child(popoverBox);
return popover;
};
const windowPopover = WindowPopover();
// ───────────────────────────────────────────────────────────────────
// Return fully assembled HyprlandFocusedClient box
// ───────────────────────────────────────────────────────────────────
return (
<box visible={focused.as(Boolean)}>
<button
onClicked={() => windowPopover.popup()}
cssClasses={["bar-button"]}
child={
focused.as(
client =>
client && (
<label label={bind(client, "title").as(String)} />
),
)
}></button>
{windowPopover}
</box >
);
};
const WindowPopoverBox = () => {
return <box vertical>
<label label={"Available Windows"} cssClasses={['title-2']}></label>
<Gtk.Separator marginTop={5} marginBottom={5}></Gtk.Separator>
<box vertical>
{bind(hypr, 'clients').as(clients => {
return clients.map(client => {
return <button child={
<box>
<label label={bind(client, 'workspace').as(w => `(WS ${w.name})`)}></label>
<label label={bind(client, 'initialClass').as(c => `[${c}]`)}></label>
<label label={bind(client, 'title')}></label>
</box>
}
onClicked={() => client.focus()}
></button>
})
})}
</box>
</box>
}
export default {
Workspace,
ActiveWindow,
SysTray,
};

View File

@@ -1,188 +0,0 @@
import { bind } from "astal";
import AstalBattery from "gi://AstalBattery";
import AstalBluetooth from "gi://AstalBluetooth";
import AstalNetwork from "gi://AstalNetwork";
import AstalWp from "gi://AstalWp";
import { Gtk } from "astal/gtk4";
import Brightness from "../../../util/brightness";
import QuickActions from "../../QuickActions/QuickActions";
const STATE = AstalNetwork.DeviceState;
const QuickView = () => {
const qa = QuickActions.QuickActions();
const showQuickActions = () => {
qa.popup();
};
return (
<button
onClicked={() => showQuickActions()}
cssClasses={["quick-action-button"]}
child={
<box>
<BatteryWidget></BatteryWidget>
<Audio></Audio>
<BluetoothWidget></BluetoothWidget>
<NetworkWidget></NetworkWidget>
<image iconName={"system-shutdown-symbolic"}></image>
{qa}
</box>
}
></button>
);
};
const NetworkWidget = () => {
const network = AstalNetwork.get_default();
return (
<box>
<image
iconName={bind(network, "state").as(state => {
if (state === AstalNetwork.State.CONNECTING) {
return "chronometer-reset-symbolic";
} else if (
state === AstalNetwork.State.CONNECTED_LOCAL ||
state === AstalNetwork.State.CONNECTED_SITE ||
state === AstalNetwork.State.CONNECTED_GLOBAL
) {
return "network-wired-activated-symbolic";
} else {
return "paint-unknown-symbolic";
}
})}
cssClasses={["network-widget", "quick-view-symbol"]}
visible={bind(network.wifi, "state").as(
state => state !== STATE.ACTIVATED,
)}
></image>
<image
iconName={bind(network.wifi, "state").as(state => {
if (state === STATE.ACTIVATED) {
return network.wifi.iconName;
} else {
return "";
}
})}
tooltipText={bind(network.wifi, 'ssid')}
cssClasses={["network-widget", "quick-view-symbol"]}
visible={bind(network.wifi, "state").as(
state => state === STATE.ACTIVATED,
)}
></image>
</box>
);
};
const BluetoothWidget = () => {
const bluetooth = AstalBluetooth.get_default();
const enabled = bind(bluetooth, "isPowered");
const connected = bind(bluetooth, "isConnected");
// For each connected BT device, render status
return (
<box>
<box visible={enabled.as(e => e)}>
<image
iconName={"bluetooth-active-symbolic"}
visible={connected.as(c => c)}
></image>
<image
iconName={"bluetooth-disconnected-symbolic"}
visible={connected.as(c => !c)}
></image>
</box>
<image
iconName={"bluetooth-disabled-symbolic"}
visible={enabled.as(e => !e)}
></image>
<box>
{bind(bluetooth, "devices").as(devices => {
return devices.map(device => {
return (
<image
iconName={bind(device, "icon").as(
icon => icon,
)}
visible={bind(device, "connected")}
tooltipText={bind(device, "batteryPercentage").as(
n => {
return device.get_name() + ': ' + n + "%";
},
)}
></image>
);
});
})}
</box>
</box>
);
};
const BatteryWidget = () => {
const battery = AstalBattery.get_default();
if (battery.get_is_present()) {
return (
<image
iconName={bind(battery, "iconName").as(icon => icon)}
cssClasses={["quick-view-symbol"]}
tooltipText={bind(battery, 'percentage').as(p => `${Math.round(p * 100)}%`)}
></image>
);
} else {
return <box></box>;
}
// Else, no battery available -> Don't show the widget
};
const BrightnessWidget = () => {
const brightness = Brightness.get_default();
const screen_brightness = bind(brightness, "screen");
return (
<box cssClasses={["quick-view-symbol"]}>
<image iconName={"brightness-high-symbolic"}></image>
<label
label={screen_brightness.as(b => '' + Math.round(100 * b))}
visible={bind(brightness, "screenAvailable")}
></label>
</box>
);
};
const Audio = () => {
const wireplumber = AstalWp.get_default();
if (wireplumber) {
return (
<box orientation={Gtk.Orientation.HORIZONTAL}>
<image
iconName={bind(wireplumber.defaultSpeaker, "volumeIcon").as(
icon => icon,
)}
cssClasses={["quick-view-symbol"]}
tooltipText={bind(wireplumber.defaultSpeaker, 'volume').as(v => Math.round(100 * v) + '%')}
></image>
<image
iconName={bind(
wireplumber.defaultMicrophone,
"volumeIcon",
).as(icon => icon)}
cssClasses={["quick-view-symbol"]}
tooltipText={bind(wireplumber.defaultMicrophone, 'volume').as(v => Math.round(100 * v) + '%')}
></image>
</box>
);
} else {
print(
"[ WirePlumber ] Could not connect, Audio support in bar will be missing",
);
return <image iconName={"action-unavailable-symbolic"}></image>;
}
};
// cssClasses={[ 'quick-view-symbol' ]}
export default {
QuickView,
};

View File

@@ -1,6 +0,0 @@
{
"name": "astal-shell",
"dependencies": {
"astal": "/usr/share/astal/gjs"
}
}

View File

@@ -1,5 +0,0 @@
$fg-color: #E6E6E6;
$bg-color: #141414;
$accent-color: #591641;
$accent-color-2: #97103A;
$shadow-color: rgba(40, 40, 40, 0.3);

View File

@@ -1,121 +0,0 @@
# ────────────────────────────────────────────────────────────────────
# ╭────────────────────────────────────────────────╮
# │ WORKSPACE RULES │
# ╰────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────────────
# Display full sized (without gaps), if only window on screen
# workspace = w[tv1], gapsout:0, gapsin:0
# workspace = f[1], gapsout:0, gapsin:0
# windowrule = bordersize 0, floating:0, onworkspace:w[tv1]
# windowrule = rounding 0, floating:0, onworkspace:w[tv1]
# windowrule = bordersize 0, floating:0, onworkspace:f[1]
# windowrule = rounding 0, floating:0, onworkspace:f[1]
$mainMod = SUPER
# ────────────────────────────────────────────────────────────────────
# ╭────────────────────────────────────────────────╮
# │ WINDOW RULES │
# ╰────────────────────────────────────────────────╯
# ────────────────────────────────────────────────────────────────────
windowrule = float, title:.*(rofi).*
windowrule = animation popin, title:.*(rofi).*
windowrule = center, title:(rofi)(.*)
windowrule = move 1450 50, title:^(.*)(Power menu)$
windowrule = workspace 2, class:evince
windowrule = workspace 2, title:.*(Okular).*
windowrule = workspace 2, class:org.pwmt.zathura
windowrule = fullscreen, title:wlogout
windowrule = workspace 2, class:librewolf
windowrule = workspace 2, title:LibreWolf
windowrule = workspace 2, title:(.*)(Discord)(.*)
windowrule = workspace 3, title:^(Steam)(.*)$
windowrule = workspace 1, title:^(.*)(VSCodium)$
windowrule = center, title:^(.*)(VSCodium)$
windowrule = workspace 3, class:minecraft-launcher
windowrule = tile, class:minecraft-launcher
windowrule = fullscreen, title:^(.*)(Minecraft)(.*)$
windowrule = workspace 3, title:^(.*)(Minecraft)(.*)$
windowrule = workspace 1, title:^(.*)hidden-terminator*(.*)$
windowrule = size 0 0, title:^(.*)hidden-terminator*(.*)$
windowrule = move 0 0, title:^(.*)hidden-terminator*(.*)$
windowrule = float, title:^(.*)hidden-terminator*(.*)$
# ┌ ┐
# │ Set rule for yazi filepicker │
# └ ┘
windowrule = float, title:^(.*)termfilechooser*(.*)$
windowrule = size 1400 800, title:^(.*)termfilechooser*(.*)$
windowrule = center, title:^(.*)termfilechooser*(.*)$
# ┌ ┐
# │ Set floating windows & position them centered │
# └ ┘
windowrule = float, class:file_progress
windowrule = center, class:file_progress
windowrule = float, class:confirm
windowrule = center, class:confirm
windowrule = float, class:dialog
windowrule = center, class:dialog
windowrule = float, class:download
windowrule = center, class:download
windowrule = float, class:notification
windowrule = center, class:notification
windowrule = float, class:error
windowrule = center, class:error
windowrule = float, class:splash
windowrule = center, class:splash
windowrule = float, class:confirmreset
windowrule = center, class:confirmreset
windowrule = float, title:Open File
windowrule = center, title:Open File
windowrule = float, title:branchdialog
windowrule = center, title:branchdialog
windowrule = float, class:Lxappearance
windowrule = center, class:Lxappearance
windowrule = float, title:^(Media viewer)$
windowrule = center, title:^(Media viewer)$
windowrule = float, title:^(Volume Control)$
windowrule = center, title:^(Volume Control)$
windowrule = float, title:^(Picture-in-Picture)$
windowrule = center, title:^(Picture-in-Picture)$
windowrule = float, title:^(File Operation Progress)$
windowrule = center, title:^(File Operation Progress)$
windowrule = float, title:^(Loading)(.*)$
windowrule = center, title:^(Loading)(.*)$
windowrule = float, class:pavucontrol-qt
windowrule = center, class:pavucontrol-qt
windowrule = float, class:pavucontrol
windowrule = center, class:pavucontrol
windowrule = float, class:file-roller
windowrule = center, class:file-roller
windowrule = idleinhibit focus, title:^(Rocket League)(.*)$
windowrule = fullscreen, title:^(Steam Big Picture)$
windowrule = idleinhibit always, class:steam
windowrule = idleinhibit always, class:lutris
windowrule = idleinhibit focus, class:vlc
windowrule = idleinhibit focus, class:supertuxkart
windowrule = idleinhibit fullscreen, title:^(.*)(Discord)(.*)$
windowrule = idleinhibit fullscreen, title:^(.*)(~)(.*)$

File diff suppressed because it is too large Load Diff

View File

@@ -1,65 +0,0 @@
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@stylistic/eslint-plugin';
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
{
'plugins': {
'@stylistic/js': stylistic,
'@stylistic/ts': stylistic,
},
'rules': {
// Formatting
'@stylistic/js/array-bracket-newline': [ 'error', { 'multiline': true, 'minItems': 4 } ],
'@stylistic/js/array-bracket-spacing': [ 'error', 'always' ],
'@stylistic/js/array-element-newline': [ 'error', { 'multiline': true, 'minItems': 4 } ],
'@stylistic/js/arrow-parens': [ 'error', 'always' ],
'@stylistic/js/arrow-spacing': [ 'error', { 'before': true, 'after': true } ],
'@stylistic/js/block-spacing': [ 'error', 'always' ],
'@stylistic/js/brace-style': [ 'error', '1tbs' ],
'@stylistic/js/comma-spacing': [ 'error', { 'before': false, 'after': true } ],
'@stylistic/js/comma-style': [ 'error', 'last' ],
'@stylistic/js/dot-location': [ 'error', 'property' ],
'@stylistic/js/eol-last': [ 'error', 'always' ],
'@stylistic/js/function-call-spacing': [ 'error', 'never' ],
'@stylistic/js/implicit-arrow-linebreak': [ 'error', 'beside' ],
'@stylistic/js/indent': [ 'error', 4 ],
'@stylistic/js/key-spacing': [ 'error', { 'beforeColon': false, 'afterColon': true } ],
'@stylistic/js/keyword-spacing': [ 'error', { 'before': true, 'after': true } ],
'@stylistic/js/lines-between-class-members': [ 'error', 'always' ],
'@stylistic/js/new-parens': [ 'error', 'always' ],
'@stylistic/js/no-extra-parens': [ 'error', 'all' ],
'@stylistic/js/no-extra-semi': 'error',
'@stylistic/js/no-floating-decimal': 'error',
'@stylistic/js/no-mixed-operators': 'error',
'@stylistic/js/no-mixed-spaces-and-tabs': 'error',
'@stylistic/js/no-multi-spaces': 'error',
'@stylistic/js/no-trailing-spaces': 'error',
'@stylistic/js/no-whitespace-before-property': 'error',
'@stylistic/js/object-curly-newline': [ 'error', { 'multiline': true, 'minProperties': 3 } ],
'@stylistic/js/object-curly-spacing': [ 'error', 'always' ],
'@stylistic/js/one-var-declaration-per-line': 'error',
'@stylistic/js/quote-props': [ 'error', 'always' ],
'@stylistic/js/quotes': [ 'error', 'single' ],
'@stylistic/js/rest-spread-spacing': [ 'error', 'never' ],
'@stylistic/js/semi': [ 'error', 'always' ],
'@stylistic/js/semi-spacing': [ 'error', { 'before': false, 'after': true } ],
'@stylistic/js/semi-style': [ 'error', 'last' ],
'@stylistic/js/space-before-blocks': [ 'error', 'always' ],
'@stylistic/js/space-before-function-paren': [ 'error', 'always' ],
'@stylistic/js/space-in-parens': [ 'error', 'always' ],
'@stylistic/js/space-infix-ops': [ 'error', { 'int32Hint': false } ],
'@stylistic/js/space-unary-ops': 'error',
'@stylistic/js/spaced-comment': [ 'error', 'always' ],
'@stylistic/js/switch-colon-spacing': 'error',
'@stylistic/js/template-curly-spacing': [ 'error', 'always' ],
'@stylistic/js/wrap-iife': [ 'error', 'inside' ],
'@stylistic/js/wrap-regex': 'error',
'@stylistic/ts/type-annotation-spacing': 'error',
}
}
);

View File

@@ -1,13 +0,0 @@
/** Basic config file **/
configuration {
show-icons: true;
icon-theme: "Candy";
display-drun: "";
display-run: "🏃🏽‍♂️ ";
display-window: "🗔 ";
display-combi: "🔎 ";
dpi: 160;
}
@theme "style.rasi"

View File

@@ -1,37 +0,0 @@
[manager]
prepend_keymap = [
# # undo trash
{ on = "u", run = "plugin restore", desc = "Restore last deleted files/folders" },
# # compress
{ on = "C", run = "plugin ouch tar.gz", desc = "Compress with ouch" },
# Goto
{ on = [ "g", "h" ], run = "cd ~", desc = "Go to ~" },
{ on = [ "g", "c", "c" ], run = "cd ~/.config", desc = "Go to ~/.config" },
{ on = [ "g", "c", "h" ], run = "cd ~/.config/hypr", desc = "Go to Hyprland config" },
{ on = [ "g", "c", "f" ], run = "cd ~/.config/fish", desc = "Go to Fish config" },
{ on = [ "g", "c", "y" ], run = "cd ~/.config/yazi", desc = "Go to Yazi config" },
{ on = [ "g", "c", "w" ], run = "cd ~/.config/waybar", desc = "Go to waybar config" },
{ on = [ "g", "c", "n" ], run = "cd ~/.config/nvim", desc = "Go to NeoVim config" },
{ on = [ "g", "a" ], run = "cd ~/.cache", desc = "Go to ~/.cache" },
{ on = [ "g", "n" ], run = "cd ~/NextCloud/Documents/", desc = "Go to NextCloud Documents" },
{ on = [ "g", "e", "c" ], run = "cd ~/projects/active/eth-gitlab/eth-code-expert/Semester2/", desc = "Go to ETH-Code-Expert" },
{ on = [ "g", "e", "n" ], run = "cd ~/NextCloud/Documents/ETH/Semester2", desc = "Go to ETH Nextcloud" },
{ on = [ "g", "e", "p" ], run = "cd ~/projects/active/eth/semester2/", desc = "Go to ETH notes folder" },
{ on = [ "g", "e", "g" ], run = "cd ~/projects/active/eth-gitlab/pprog25-jahutz/", desc = "Go to ETH Gitlab folder" },
{ on = [ "g", "l", "b" ], run = "cd ~/.local/bin", desc = "Go to ~/.local/bin" },
{ on = [ "g", "l", "s" ], run = "cd ~/.local/share", desc = "Go to ~/.local/share" },
{ on = [ "g", "s", "h" ], run = "cd ~/.steam/steam/steamapps/common", desc = "Go to ~/.steam/steam/steamapps/common" },
{ on = [ "g", "s", "g" ], run = "cd /mnt/games/SteamLibrary", desc = "Go to SteamLibrary on NTFS partition" },
{ on = [ "g", "s", "s" ], run = "cd /mnt/secondary/SteamLibrary", desc = "Go to SteamLibrary on main games drive" },
{ on = [ "g", "o" ], run = "cd /mnt/janis/Documents", desc = "Go to Documents" },
{ on = [ "g", "d" ], run = "cd ~/Downloads", desc = "Go to ~/Downloads" },
{ on = [ "g", "p", "a" ], run = "cd ~/projects/active", desc = "Go to Active projects" },
{ on = [ "g", "p", "r" ], run = "cd ~/projects/archive", desc = "Go to Archive projects" },
{ on = [ "g", "p", "p" ], run = "cd ~/projects", desc = "Go to projects" },
{ on = [ "g", "t", "m" ], run = "cd /tmp", desc = "Go to /tmp" },
{ on = [ "g", "t", "t" ], run = "cd ~/.local/share/Trash/", desc = "Go to TRASH" },
{ on = [ "g", "/" ], run = "cd /", desc = "Go to /" },
{ on = [ "g", "m" ], run = "cd /run/media/$USER", desc = "Go to /run/media" },
{ on = [ "g", "<Space>" ], run = "cd --interactive", desc = "Go to interactively" },
]

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2024 ndtoan96
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,78 +0,0 @@
# ouch.yazi
[ouch](https://github.com/ouch-org/ouch) plugin for [Yazi](https://github.com/sxyazi/yazi).
![ouch.yazi](https://github.com/ndtoan96/ouch.yazi/assets/33489972/946397ec-b37b-4bf4-93f1-c676fc8e59f2)
## Features
- Archive preview
- Compression
## Installation
### Yazi package manager
```bash
ya pack -a ndtoan96/ouch
```
### Git
```bash
# Linux/macOS
git clone https://github.com/ndtoan96/ouch.yazi.git ~/.config/yazi/plugins/ouch.yazi
# Windows with cmd
git clone https://github.com/ndtoan96/ouch.yazi.git %AppData%\yazi\config\plugins\ouch.yazi
# Windows with powershell
git clone https://github.com/ndtoan96/ouch.yazi.git "$($env:APPDATA)\yazi\config\plugins\ouch.yazi"
```
Make sure you have [ouch](https://github.com/ouch-org/ouch) installed and in your `PATH`.
## Usage
### Preview
For archive preview, add this to your `yazi.toml`:
```toml
[plugin]
prepend_previewers = [
# Archive previewer
{ mime = "application/*zip", run = "ouch" },
{ mime = "application/x-tar", run = "ouch" },
{ mime = "application/x-bzip2", run = "ouch" },
{ mime = "application/x-7z-compressed", run = "ouch" },
{ mime = "application/x-rar", run = "ouch" },
{ mime = "application/x-xz", run = "ouch" },
]
```
Now go to an archive on Yazi, you should see the archive's content in the preview pane. You can use `J` and `K` to roll up and down the preview.
If you want to change the icon or the style of text, you can modify the `peek` function in `init.lua` file (all of them are stored in the `lines` variable).
### Compression
For compession, add this to your `keymap.toml`:
```toml
[[manager.prepend_keymap]]
on = ["C"]
run = "plugin ouch"
desc = "Compress with ouch"
```
The plugin uses `zip` format by default. You can change the format when you name the output file, `ouch` will detect format based on file extension.
And, for example, if you would like to set `7z` as default format, you can use `plugin ouch 7z`.
### Decompression
This plugin does not provide a decompression feature because it already is supported by Yazi.
To decompress with `ouch`, configure the opener in `yazi.toml`.
```toml
[opener]
extract = [
{ run = 'ouch d -y "%*"', desc = "Extract here with ouch", for = "windows" },
{ run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" },
]
```

View File

@@ -1,148 +0,0 @@
local M = {}
function M:peek(job)
local child = Command("ouch")
:args({ "l", "-t", "-y", tostring(job.file.url) })
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:spawn()
local limit = job.area.h
local file_name = string.match(tostring(job.file.url), ".*[/\\](.*)")
local lines = string.format("📁 \x1b[2m%s\x1b[0m\n", file_name)
local num_lines = 1
local num_skip = 0
repeat
local line, event = child:read_line()
if event == 1 then
ya.err(tostring(event))
elseif event ~= 0 then
break
end
if line:find('Archive', 1, true) ~= 1 and line:find('[INFO]', 1, true) ~= 1 then
if num_skip >= job.skip then
lines = lines .. line
num_lines = num_lines + 1
else
num_skip = num_skip + 1
end
end
until num_lines >= limit
child:start_kill()
if job.skip > 0 and num_lines < limit then
ya.manager_emit(
"peek",
{ tostring(math.max(0, job.skip - (limit - num_lines))), only_if = tostring(job.file.url), upper_bound = "" }
)
else
ya.preview_widgets(job, { ui.Text(lines):area(job.area) })
end
end
function M:seek(job)
local h = cx.active.current.hovered
if h and h.url == job.file.url then
local step = math.floor(job.units * job.area.h / 10)
ya.manager_emit("peek", {
math.max(0, cx.active.preview.skip + step),
only_if = tostring(job.file.url),
})
end
end
-- Check if file exists
local function file_exists(name)
local f = io.open(name, "r")
if f ~= nil then
io.close(f)
return true
else
return false
end
end
-- Get the files that need to be compressed and infer a default archive name
local get_compression_target = ya.sync(function()
local tab = cx.active
local default_name
local paths = {}
if #tab.selected == 0 then
if tab.current.hovered then
local name = tab.current.hovered.name
default_name = name
table.insert(paths, name)
else
return
end
else
default_name = tab.current.cwd:name()
for _, url in pairs(tab.selected) do
table.insert(paths, tostring(url))
end
-- The compression targets are aquired, now unselect them
ya.manager_emit("escape", {})
end
return paths, default_name
end)
local function invoke_compress_command(paths, name)
local cmd_output, err_code = Command("ouch")
:args({ "c", "-y" })
:args(paths)
:arg(name)
:stderr(Command.PIPED)
:output()
if err_code ~= nil then
ya.notify({
title = "Failed to run ouch command",
content = "Status: " .. err_code,
timeout = 5.0,
level = "error",
})
elseif not cmd_output.status.success then
ya.notify({
title = "Compression failed: status code " .. cmd_output.status.code,
content = cmd_output.stderr,
timeout = 5.0,
level = "error",
})
end
end
function M:entry(job)
local default_fmt = job.args[1]
if default_fmt == nil then
default_fmt = "zip"
end
ya.manager_emit("escape", { visual = true })
-- Get the files that need to be compressed and infer a default archive name
local paths, default_name = get_compression_target()
-- Get archive name from user
local output_name, name_event = ya.input({
title = "Create archive:",
value = default_name .. "." .. default_fmt,
position = { "top-center", y = 3, w = 40 },
})
if name_event ~= 1 then
return
end
-- Get confirmation if file exists
if file_exists(output_name) then
local confirm, confirm_event = ya.input({
title = "Overwrite " .. output_name .. "? (y/N)",
position = { "top-center", y = 3, w = 40 },
})
if not (confirm_event == 1 and confirm:lower() == "y") then
return
end
end
invoke_compress_command(paths, output_name)
end
return M

View File

@@ -1,661 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

View File

@@ -1,86 +0,0 @@
# restore.yazi
<!--toc:start-->
- [restore.yazi](#restoreyazi)
- [Requirements](#requirements)
- [Installation](#installation)
- [Linux/MacOS](#linuxmacos)
- [Usage](#usage)
<!--toc:end-->
[Yazi](https://github.com/sxyazi/yazi) plugin to restore/recover latest deleted files/folders.
## Requirements
- [yazi >= v25.2.7](https://github.com/sxyazi/yazi)
- [trash-cli](https://github.com/andreafrancia/trash-cli)
- If you have `Can't Get Trash Directory` error and running `trash-cli --volumes`
in terminal throw `AttributeError: 'PrintVolumesList' object has no attribute 'run_action'`.
Remove the old version of trash-cli and install newer version [How to install](https://github.com/andreafrancia/trash-cli?tab=readme-ov-file#the-easy-way).
## Installation
### Linux
```sh
git clone https://github.com/boydaihungst/restore.yazi ~/.config/yazi/plugins/restore.yazi
```
or
```sh
ya pack -a boydaihungst/restore
```
## Usage
1. Key binding
- Add this to your `keymap.toml`:
```toml
[manager]
keymap = [
{ on = "u", run = "plugin restore", desc = "Restore last deleted files/folders" },
# or use "d + u" like me
{ on = ["d", "u"], run = "plugin restore", desc = "Restore last deleted files/folders" },
# ... Other keymaps
]
```
2. Configuration (Optional)
- Default:
```lua
require("restore"):setup({
-- Set the position for confirm and overwrite dialogs.
-- don't forget to set height: `h = xx`
-- https://yazi-rs.github.io/docs/plugins/utils/#ya.input
position = { "center", w = 70, h = 40 }, -- Optional
-- Show confirm dialog before restore.
-- NOTE: even if set this to false, overwrite dialog still pop up
show_confirm = true, -- Optional
-- colors for confirm and overwrite dialogs
theme = { -- Optional
-- Default using style from your flavor or theme.lua -> [confirm] -> title.
-- If you edit flavor or theme.lua you can add more style than just color.
-- Example in theme.lua -> [confirm]: title = { fg = "blue", bg = "green" }
title = "blue", -- Optional. This valid has higher priority than flavor/theme.lua
-- Default using style from your flavor or theme.lua -> [confirm] -> content
-- Sample logic as title above
header = "green", -- Optional. This valid has higher priority than flavor/theme.lua
-- header color for overwrite dialog
-- Default using color "yellow"
header_warning = "yellow", -- Optional
-- Default using style from your flavor or theme.lua -> [confirm] -> list
-- Sample logic as title and header above
list_item = { odd = "blue", even = "blue" }, -- Optional. This valid has higher priority than flavor/theme.lua
},
})
```

View File

@@ -1,273 +0,0 @@
--- @since 25.2.7
local M = {}
local shell = os.getenv("SHELL") or ""
local PackageName = "Restore"
local function success(s, ...)
ya.notify({ title = PackageName, content = string.format(s, ...), timeout = 5, level = "info" })
end
local function fail(s, ...)
ya.notify({ title = PackageName, content = string.format(s, ...), timeout = 5, level = "error" })
end
---@enum STATE
local STATE = {
POSITION = "position",
SHOW_CONFIRM = "show_confirm",
THEME = "theme",
}
local set_state = ya.sync(function(state, key, value)
if state then
state[key] = value
else
state = {}
state[key] = value
end
end)
local get_state = ya.sync(function(state, key)
if state then
return state[key]
else
return nil
end
end)
---@enum File_Type
local File_Type = {
File = "file",
Dir = "dir_all",
None_Exist = "unknown",
}
---@alias TRASHED_ITEM {trash_index: number, trashed_date_time: string, trashed_path: string, type: File_Type} Item in trash list
function get_basename(filepath)
return filepath:match("^.+/(.+)$") or filepath
end
local get_cwd = ya.sync(function()
return tostring(cx.active.current.cwd)
end)
local function path_quote(path)
local result = "'" .. string.gsub(path, "'", "'\\''") .. "'"
return result
end
local function get_file_type(path)
local cha, _ = fs.cha(Url(path))
if cha then
return cha.is_dir and File_Type.Dir or File_Type.File
else
return File_Type.None_Exist
end
end
local function get_trash_volume()
local cwd = get_cwd()
local trash_volumes_stream, cmr_err =
Command("trash-list"):args({ "--volumes" }):stdout(Command.PIPED):stderr(Command.PIPED):output()
local matched_vol_path = nil
if trash_volumes_stream then
local matched_vol_length = 0
for vol in trash_volumes_stream.stdout:gmatch("[^\r\n]+") do
local vol_length = utf8.len(vol) or 0
if cwd:sub(1, vol_length) == vol and vol_length > matched_vol_length then
matched_vol_path = vol
matched_vol_length = vol_length
end
end
if not matched_vol_path then
fail("Can't get trash directory")
end
else
fail("Failed to start `trash-list` with error: `%s`. Do you have `trash-cli` installed?", cmr_err)
end
return matched_vol_path
end
---get list of latest files/folders trashed
---@param curr_working_volume currently working volume
---@return TRASHED_ITEM[]|nil
local function get_latest_trashed_items(curr_working_volume)
---@type TRASHED_ITEM[]
local restorable_items = {}
local fake_enter = Command("printf"):stderr(Command.PIPED):stdout(Command.PIPED):spawn():take_stdout()
local trash_list_stream, err_cmd = Command(shell)
:args({ "-c", "trash-restore " .. path_quote(curr_working_volume) })
:stdin(fake_enter)
:stdout(Command.PIPED)
:stderr(Command.PIPED)
:output()
if trash_list_stream then
---@type TRASHED_ITEM[]
local trash_list = {}
for line in trash_list_stream.stdout:gmatch("[^\r\n]+") do
-- remove leading spaces
line = line:match("^%s*(.+)$")
local trash_index, item_date, item_path = line:match("^(%d+) (%S+ %S+) (.+)$")
if item_date and item_path and trash_index ~= nil then
table.insert(trash_list, {
trash_index = tonumber(trash_index),
trashed_date_time = item_date,
trashed_path = item_path,
type = File_Type.None_Exist,
})
end
end
if #trash_list == 0 then
success("Nothing left to restore")
return
end
local last_item_datetime = trash_list[#trash_list].trashed_date_time
for _, trash_item in ipairs(trash_list) do
if trash_item then
if trash_item.trashed_date_time == last_item_datetime then
trash_item.type = get_file_type(trash_item.trashed_path)
table.insert(restorable_items, trash_item)
end
end
end
else
fail("Failed to start `trash-restore` with error: `%s`. Do you have `trash-cli` installed?", err_cmd)
return
end
return restorable_items
-- return newest_trashed_items
end
---@param trash_list TRASHED_ITEM[]
local function filter_none_exised_paths(trash_list)
---@type TRASHED_ITEM[]
local existed_trash_items = {}
for _, v in ipairs(trash_list) do
if v.type ~= File_Type.None_Exist then
table.insert(existed_trash_items, v)
end
end
return existed_trash_items
end
local function restore_files(curr_working_volume, start_index, end_index)
if type(start_index) ~= "number" or type(end_index) ~= "number" or start_index < 0 or end_index < 0 then
fail("Failed to restore file(s): out of range")
return
end
ya.manager_emit("shell", {
"echo " .. ya.quote(start_index .. "-" .. end_index) .. " | trash-restore --overwrite " .. path_quote(
curr_working_volume
),
confirm = true,
})
local file_to_restore_count = end_index - start_index + 1
success("Restored " .. tostring(file_to_restore_count) .. " file" .. (file_to_restore_count > 1 and "s" or ""))
end
function M:setup(opts)
if opts and opts.position and type(opts.position) == "table" then
set_state(STATE.POSITION, opts.position)
else
set_state(STATE.POSITION, { "center", w = 70, h = 40 })
end
if opts and opts.show_confirm then
set_state(STATE.SHOW_CONFIRM, opts.show_confirm)
else
set_state(STATE.SHOW_CONFIRM, false)
end
if opts and opts.theme and type(opts.theme) == "table" then
set_state(STATE.THEME, opts.theme)
else
set_state(STATE.THEME, {})
end
end
---@param trash_list TRASHED_ITEM[]
local function get_components(trash_list)
local theme = get_state(STATE.THEME) or {}
local item_odd_style = theme.list_item and theme.list_item.odd and ui.Style():fg(theme.list_item.odd)
or (th and th.confirm and th.confirm.list or ui.Style():fg("blue"))
local item_even_style = theme.list_item and theme.list_item.even and ui.Style():fg(theme.list_item.even)
or (th and th.confirm and th.confirm.list or ui.Style():fg("blue"))
local trashed_items_components = {}
for idx, item in pairs(trash_list) do
table.insert(
trashed_items_components,
ui.Line({
ui.Span(" "),
ui.Span(item.trashed_path):style(idx % 2 == 0 and item_even_style or item_odd_style),
}):align(ui.Line.LEFT)
)
end
return trashed_items_components
end
function M:entry()
local curr_working_volume = get_trash_volume()
if not curr_working_volume then
return
end
local trashed_items = get_latest_trashed_items(curr_working_volume)
if trashed_items == nil then
return
end
local collided_items = filter_none_exised_paths(trashed_items)
local overwrite_confirmed = true
local show_confirm = get_state(STATE.SHOW_CONFIRM)
local pos = get_state(STATE.POSITION)
pos = pos or { "center", w = 70, h = 40 }
local theme = get_state(STATE.THEME) or {}
theme.title = theme.title and ui.Style():fg(theme.title):bold() or (th and th.confirm and th.confirm.title)
theme.header = theme.header and ui.Style():fg(theme.header) or (th and th.confirm and th.confirm.content)
theme.header_warning = ui.Style():fg(theme.header_warning or "yellow")
if ya.confirm and show_confirm then
local continue_restore = ya.confirm({
-- title = ui.Line("Restore files/folders"):fg(theme.title):bold(),
title = ui.Line("Restore files/folders"):style(theme.title),
content = ui.Text({
ui.Line(""),
ui.Line("The following files and folders are going to be restored:"):style(theme.header),
ui.Line(""),
table.unpack(get_components(trashed_items)),
})
:align(ui.Text.LEFT)
:wrap(ui.Text.WRAP),
pos = pos,
})
-- stopping
if not continue_restore then
return
end
end
-- show Confirm dialog with list of collided items
if #collided_items > 0 then
overwrite_confirmed = ya.confirm({
title = ui.Line("Restore files/folders"):style(theme.title),
content = ui.Text({
ui.Line(""),
ui.Line("The following files and folders are existed, overwrite?"):style(theme.header_warning),
ui.Line(""),
table.unpack(get_components(collided_items)),
})
:align(ui.Text.LEFT)
:wrap(ui.Text.WRAP),
pos = pos,
})
end
if overwrite_confirmed then
restore_files(curr_working_volume, trashed_items[1].trash_index, trashed_items[#trashed_items].trash_index)
end
end
return M

View File

@@ -1,2 +0,0 @@
[flavor]
use = "vscode-dark-modern"

View File

@@ -0,0 +1,276 @@
# ─────────────────────────────────────────────────────────────────────
# ╭─────────────────────────────────────────────────╮
# │ clang-format config │
# ╰─────────────────────────────────────────────────╯
# ─────────────────────────────────────────────────────────────────────
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Left
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignCaseArrows: false
AlignCaseColons: false
AlignConsecutiveTableGenBreakingDAGArgColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenCondOperatorColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenDefinitionColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments:
Kind: Always
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Never
AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: true
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Always
BreakAfterJavaFieldAnnotations: false
BreakAfterReturnType: None
BreakArrays: true
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Attach
BreakBeforeConceptDeclarations: Always
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakFunctionDefinitionParameters: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
BreakTemplateDeclarations: MultiLine
ColumnLimit: 100
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: ^"(llvm|llvm-c|clang|clang-c)/
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: ^(<|"(gtest|gmock|isl|json)/)
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: .*
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: (Test)?$
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: true
IndentCaseBlocks: true
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: true
AtStartOfFile: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ""
MacroBlockEnd: ""
MainIncludeChar: Quote
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PPIndentWidth: -1
PackConstructorInitializers: BinPack
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 0
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
QualifierAlignment: Left
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: true
RemoveParentheses: MultipleParentheses
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SkipMacroDefinitionBody: false
SortIncludes: CaseSensitive
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true
AfterIfMacros: true
AfterOverloadedOperator: false
AfterPlacementOperator: true
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Custom
SpacesInParensOptions:
ExceptDoubleParentheses: false
InConditionalStatements: true
InCStyleCasts: false
InEmptyParentheses: false
Other: true
SpacesInSquareBrackets: true
Standard: Latest
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
TableGenBreakInsideDAGArg: DontBreak
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE

View File

@@ -0,0 +1,744 @@
import eslint from '@eslint/js';
import globals from 'globals';
import stylistic from '@stylistic/eslint-plugin';
import tseslint from 'typescript-eslint';
import typescript from '@typescript-eslint/eslint-plugin';
import vue from 'eslint-plugin-vue';
const style = {
'plugins': {
'@stylistic': stylistic,
'@stylistic/js': stylistic,
'@stylistic/ts': stylistic
},
'files': [
'**/*.ts',
'**/*.js',
'**/*.mjs',
'**/*.cjs',
'**/*.tsx',
'**/*.jsx'
],
'rules': {
'sort-imports': [
'warn',
{
'ignoreCase': false,
'ignoreDeclarationSort': false,
'ignoreMemberSort': false,
'memberSyntaxSortOrder': [
'none',
'all',
'multiple',
'single'
],
'allowSeparatedGroups': false
}
],
// Formatting
'@stylistic/array-bracket-newline': [
'error',
{
'multiline': false,
'minItems': 2
}
],
'@stylistic/array-bracket-spacing': [
'error',
'always'
],
'@stylistic/array-element-newline': [
'error',
{
'consistent': false,
'multiline': false,
'minItems': 2
}
],
'@stylistic/arrow-parens': [
'error',
'as-needed'
],
'@stylistic/arrow-spacing': [
'error',
{
'before': true,
'after': true
}
],
'@stylistic/block-spacing': [
'error',
'always'
],
'@stylistic/brace-style': [
'error',
'1tbs',
{
'allowSingleLine': false
}
],
'@stylistic/comma-dangle': [
'error',
'never'
],
'@stylistic/comma-spacing': [
'error',
{
'before': false,
'after': true
}
],
'@stylistic/comma-style': [
'error',
'last'
],
'@stylistic/dot-location': [
'error',
'property'
],
'@stylistic/function-call-argument-newline': [
'error',
'consistent'
],
'@stylistic/function-call-spacing': [
'error',
'never'
],
'@stylistic/function-paren-newline': [
'error',
'multiline-arguments'
],
'@stylistic/implicit-arrow-linebreak': [
'error',
'beside'
],
'@stylistic/indent': [
'error',
4
],
'@stylistic/indent-binary-ops': [
'error',
4
],
'@stylistic/key-spacing': [
'error',
{
'beforeColon': false,
'afterColon': true
}
],
'@stylistic/keyword-spacing': [
'error',
{
'before': true,
'after': true
}
],
'@stylistic/lines-between-class-members': [
'error',
'always'
],
'@stylistic/max-len': [
'warn',
{
'code': 140,
'comments': 160,
'ignoreComments': false,
'ignoreUrls': true,
'ignoreStrings': true,
'ignoreTemplateLiterals': true,
'ignoreRegExpLiterals': true
}
],
'@stylistic/max-statements-per-line': [
'error',
{
'max': 1
}
],
'@stylistic/multiline-ternary': [
'error',
'always-multiline'
],
'@stylistic/new-parens': [
'error',
'always'
],
'@stylistic/newline-per-chained-call': 'error',
'@stylistic/no-confusing-arrow': 'error',
'@stylistic/no-extra-parens': [
'error',
'all',
{
'nestedBinaryExpressions': false,
'ternaryOperandBinaryExpressions': false,
'ignoreJSX': 'multi-line',
'nestedConditionalExpressions': false
}
],
'@stylistic/no-extra-semi': 'error',
'@stylistic/no-floating-decimal': 'error',
'@stylistic/no-mixed-operators': 'error',
'@stylistic/no-mixed-spaces-and-tabs': 'error',
'@stylistic/no-multi-spaces': 'error',
'@stylistic/no-multiple-empty-lines': [
'error',
{
'max': 3,
'maxEOF': 2
}
],
'@stylistic/no-tabs': 'error',
'@stylistic/no-trailing-spaces': 'error',
'@stylistic/no-whitespace-before-property': 'error',
'@stylistic/object-curly-newline': [
'error',
{
'multiline': true,
'minProperties': 1
}
],
'@stylistic/object-curly-spacing': [
'error',
'always'
],
'@stylistic/object-property-newline': 'error',
'@stylistic/one-var-declaration-per-line': 'error',
'@stylistic/operator-linebreak': [
'error',
'before'
],
'@stylistic/padded-blocks': [
'error',
{
'blocks': 'never',
'classes': 'always',
'switches': 'never'
}
],
// Padding lines. The most in-depth part of this config
'@stylistic/padding-line-between-statements': [
'error',
// Variables, Constants
{
'blankLine': 'never',
'prev': 'var',
'next': 'var'
},
{
'blankLine': 'never',
'prev': 'let',
'next': 'let'
},
{
'blankLine': 'never',
'prev': 'const',
'next': 'const'
},
{
'blankLine': 'always',
'prev': 'var',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'cjs-import',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'import',
'let',
'return',
'switch',
'throw',
'try',
'var',
'with'
]
},
{
'blankLine': 'always',
'prev': 'let',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'cjs-import',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'import',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
{
'blankLine': 'always',
'prev': 'const',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'cjs-import',
'class',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'import',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
// Import
{
'blankLine': 'never',
'prev': 'import',
'next': 'import'
},
{
'blankLine': 'never',
'prev': 'cjs-import',
'next': 'cjs-import'
},
{
'blankLine': 'always',
'prev': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
],
'next': 'cjs-import'
},
{
'blankLine': 'always',
'prev': 'cjs-import',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
{
'blankLine': 'always',
'prev': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
],
'next': 'import'
},
{
'blankLine': 'always',
'prev': 'import',
'next': [
'block',
'block-like',
'break',
'cjs-export',
'class',
'const',
'continue',
'debugger',
'directive',
'do',
'empty',
'export',
'expression',
'for',
'function',
'if',
'iife',
'let',
'return',
'switch',
'throw',
'try',
'var',
'while',
'with'
]
},
// If
{
'blankLine': 'always',
'prev': '*',
'next': 'if'
},
{
'blankLine': 'always',
'prev': 'if',
'next': '*'
},
// For
{
'blankLine': 'always',
'prev': '*',
'next': 'for'
},
{
'blankLine': 'always',
'prev': 'for',
'next': '*'
},
// While
{
'blankLine': 'always',
'prev': '*',
'next': 'while'
},
{
'blankLine': 'always',
'prev': 'while',
'next': '*'
},
// Functions
{
'blankLine': 'always',
'prev': '*',
'next': 'function'
},
{
'blankLine': 'always',
'prev': 'function',
'next': '*'
},
// Block Statements
{
'blankLine': 'always',
'prev': '*',
'next': 'block-like'
},
{
'blankLine': 'always',
'prev': 'block-like',
'next': '*'
},
// Switch
{
'blankLine': 'always',
'prev': '*',
'next': 'switch'
},
{
'blankLine': 'always',
'prev': 'switch',
'next': '*'
},
// Try-Catch
{
'blankLine': 'always',
'prev': '*',
'next': 'try'
},
{
'blankLine': 'always',
'prev': 'try',
'next': '*'
},
// Throw
{
'blankLine': 'always',
'prev': '*',
'next': 'throw'
},
{
'blankLine': 'always',
'prev': 'throw',
'next': '*'
},
// Return
{
'blankLine': 'never',
'prev': 'return',
'next': '*'
},
{
'blankLine': 'always',
'prev': '*',
'next': 'return'
},
// Export
{
'blankLine': 'always',
'prev': '*',
'next': 'export'
},
{
'blankLine': 'always',
'prev': 'export',
'next': '*'
},
{
'blankLine': 'always',
'prev': '*',
'next': 'cjs-export'
},
{
'blankLine': 'always',
'prev': 'cjs-export',
'next': '*'
},
// Classes
{
'blankLine': 'always',
'prev': '*',
'next': 'class'
},
{
'blankLine': 'always',
'prev': 'class',
'next': '*'
}
],
'@stylistic/quote-props': [
'error',
'always'
],
'@stylistic/quotes': [
'error',
'single'
],
'@stylistic/rest-spread-spacing': [
'error',
'never'
],
'@stylistic/semi': [
'error',
'always'
],
'@stylistic/semi-spacing': [
'error',
{
'before': false,
'after': true
}
],
'@stylistic/semi-style': [
'error',
'last'
],
'@stylistic/space-before-blocks': [
'error',
'always'
],
'@stylistic/space-before-function-paren': [
'error',
'always'
],
'@stylistic/space-in-parens': [
'error',
'always'
],
'@stylistic/space-infix-ops': [
'error',
{
'int32Hint': false
}
],
'@stylistic/space-unary-ops': 'error',
'@stylistic/spaced-comment': [
'error',
'always'
],
'@stylistic/switch-colon-spacing': 'error',
'@stylistic/template-curly-spacing': [
'error',
'always'
],
'@stylistic/template-tag-spacing': [
'error',
'always'
],
'@stylistic/type-generic-spacing': 'error',
'@stylistic/type-named-tuple-spacing': 'error',
'@stylistic/wrap-iife': [
'error',
'inside'
],
'@stylistic/wrap-regex': 'error',
'@stylistic/ts/type-annotation-spacing': 'error'
}
};
/** @type {import('eslint').Linter.Config} */
export default tseslint.config(
// Base JavaScript rules
eslint.configs.recommended,
tseslint.configs.recommended,
style,
// Vue support (including TS and JSX inside SFCs)
{
'files': [ '**/*.vue' ],
'languageOptions': {
'sourceType': 'module',
'ecmaVersion': 'latest',
'globals': globals.browser,
'parserOptions': {
'parser': tseslint.parser
}
},
'plugins': {
'vue': vue,
'@stylistic': stylistic,
'@stylistic/js': stylistic,
'@stylistic/ts': stylistic,
'@typescript-eslint': typescript
},
'extends': [
eslint.configs.recommended,
...vue.configs['flat/recommended']
],
'rules': {
...typescript.configs.recommended.rules,
...style.rules,
// Vue specific rules
'@stylistic/indent': 'off',
'vue/html-indent': [
'error',
4
],
'vue/html-comment-indent': [
'error',
4
],
'vue/script-indent': [
'error',
4,
{
'baseIndent': 1,
'switchCase': 1
}
],
'vue/html-self-closing': [
'error',
{
'html': {
'void': 'never',
'normal': 'never',
'component': 'always'
},
'svg': 'always',
'math': 'never'
}
],
'vue/max-attributes-per-line': [
'error',
{
'singleline': 3,
'multiline': 1
}
]
}
}
);

View File

@@ -0,0 +1,2 @@
paths:
- /home/janis/projects/dotfiles/config/lint/latexfmt.yaml

View File

@@ -0,0 +1,82 @@
# Use spaces for indent (because f*k tabs)
defaultIndent: " "
# Limit Number of backups
maxNumberOfBackups: 3
verbatimEnvironments:
verbatim: 1
lstlisting: 1
minted: 1
code: 1
indentRules:
recall: " "
remarks: " "
remark: " "
guides: " "
properties: " "
restrictions: " "
limitations: " "
terms: " "
notation: " "
usage: " "
task: " "
proof: " "
general: " "
simplebox: " "
definition: " "
theorem: " "
lemma: " "
corollary: " "
axiom: " "
fact: " "
proposition: " "
example: " "
formula: " "
conjugation: " "
forms: " "
lookForAlignDelims:
tables:
delims: 1
alignDoubleBackSlash: 1
spacesBeforeDoubleBackSlash: 1
multiColumnGrouping: 0
alignRowsWithoutMaxDelims: 1
spacesBeforeAmpersand: 1
spacesAfterAmpersand: 1
justification: left
alignFinalDoubleBackSlash: 0
dontMeasure: 0
delimiterRegEx: (?<!\\)(&)
delimiterJustification: left
lookForChildCodeBlocks: 1
alignContentAfterDoubleBackSlash: 0
spacesAfterDoubleBackSlash: 1
specialBeginEnd:
If:
begin: '\\If'
middle:
- '\\ElsIf'
- '\\Else'
end: '\\EndIf'
lookForThis: 1
For:
begin: '\\For'
end: '\\EndFor'
lookForThis: 1
Procedure:
begin: '\\Procedure'
end: '\\EndProcedure'
lookForThis: 1
Function:
begin: '\\Function'
end: '\\EndFunction'
lookForThis: 1
While:
begin: '\\While'
end: '\\EndWhile'
lookForThis: 1
specialBeforeCommand: 1

View File

@@ -0,0 +1,8 @@
{
"devDependencies": {
"@eslint/js": "^9.28.0",
"@stylistic/eslint-plugin": "^4.4.1",
"eslint-plugin-vue": "^10.2.0",
"typescript-eslint": "^8.33.1"
}
}

View File

@@ -3,3 +3,4 @@ $bg-color: {{ colour-background-hex }};
$accent-color: {{ colour-accent-hex }};
$accent-color-2: {{ colour-accent-2-hex }};
$shadow-color: {{ colour-shadow-rgba-03 }};
$monospace-font: {{ font-mono }}

View File

@@ -9,10 +9,6 @@
#██████████████ █████ ███████████████████████████████████████████████████████████████████████████████████████████████████ ██
general {
grace = 15
}
# ┌ ┐
# │ BACKGROUND │
# └ ┘
@@ -49,7 +45,7 @@ label {
monitor =
text = <b>$TIME</b>
color = {{ colour-primary-rgb }}
font_size = 100
font_size = 150
font_family = {{ font-primary }}
position = 0, 80

View File

@@ -18,8 +18,8 @@
border: 1px;
border-radius: 10px;
padding: 0;
location: west;
anchor: west;
location: center;
anchor: center;
margin: 0;
}

View File

View File

@@ -0,0 +1,3 @@
[flavor]
dark = "{{ yazi-theme }}"
light = "{{ yazi-theme }}"

View File

@@ -14,3 +14,5 @@ VKD3D_CONFIG=dxr11,dxr
RADV_PERFTEST_RT=1
ANDROID_HOME=/home/janis/Android/Sdk
EDITOR=nvim
PAGER=nvimpager
MANPAGER=nvimpager

View File

@@ -0,0 +1,18 @@
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1
# The default session, also known as the greeter.
[default_session]
command = "tuigreet --cmd Hyprland --time --remember --remember-user-session --asterisks --user-menu --sessions /usr/share/wayland-sessions"
# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
[initial_session]
command = "Hyprland"
user = "janis"

View File

@@ -0,0 +1,9 @@
#%PAM-1.0
auth required pam_securetty.so
auth requisite pam_nologin.so
auth include system-local-login
auth optional pam_gnome_keyring.so
account include system-local-login
session include system-local-login
session optional pam_gnome_keyring.so auto_start

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,944 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AccountsService?version=1.0' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AccountsService {
/**
* AccountsService-1.0
*/
/**
* Type of user account
*/
/**
* Type of user account
*/
export namespace UserAccountType {
export const $gtype: GObject.GType<UserAccountType>;
}
enum UserAccountType {
/**
* Normal non-administrative user
*/
STANDARD,
/**
* Administrative user
*/
ADMINISTRATOR,
}
/**
* Various error codes returned by the accounts service.
*/
class UserManagerError extends GLib.Error {
static $gtype: GObject.GType<UserManagerError>;
// Static fields
/**
* Generic failure
*/
static FAILED: number;
/**
* The user already exists
*/
static USER_EXISTS: number;
/**
* The user does not exist
*/
static USER_DOES_NOT_EXIST: number;
/**
* Permission denied
*/
static PERMISSION_DENIED: number;
/**
* Operation not supported
*/
static NOT_SUPPORTED: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
static quark(): GLib.Quark;
}
/**
* Mode for setting the user's password.
*/
/**
* Mode for setting the user's password.
*/
export namespace UserPasswordMode {
export const $gtype: GObject.GType<UserPasswordMode>;
}
enum UserPasswordMode {
/**
* Password set normally
*/
REGULAR,
/**
* Password will be chosen at next login
*/
SET_AT_LOGIN,
/**
* No password set
*/
NONE,
}
function user_manager_error_quark(): GLib.Quark;
module User {
// Signal callback interfaces
interface Changed {
(): void;
}
interface SessionsChanged {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
account_type: number;
accountType: number;
automatic_login: boolean;
automaticLogin: boolean;
email: string;
home_directory: string;
homeDirectory: string;
icon_file: string;
iconFile: string;
is_loaded: boolean;
isLoaded: boolean;
language: string;
local_account: boolean;
localAccount: boolean;
location: string;
locked: boolean;
login_frequency: number;
loginFrequency: number;
login_history: GLib.Variant;
loginHistory: GLib.Variant;
login_time: number;
loginTime: number;
nonexistent: boolean;
password_hint: string;
passwordHint: string;
password_mode: number;
passwordMode: number;
real_name: string;
realName: string;
shell: string;
system_account: boolean;
systemAccount: boolean;
uid: number;
user_name: string;
userName: string;
x_session: string;
xSession: string;
}
}
/**
* Represents a user account on the system.
*/
class User extends GObject.Object {
static $gtype: GObject.GType<User>;
// Properties
get account_type(): number;
get accountType(): number;
get automatic_login(): boolean;
get automaticLogin(): boolean;
get email(): string;
get home_directory(): string;
get homeDirectory(): string;
get icon_file(): string;
get iconFile(): string;
get is_loaded(): boolean;
get isLoaded(): boolean;
/**
* The users locale, in the format
* `language[_territory][.codeset][`modifier]``, where `language` is an
* ISO 639 language code, `territory` is an ISO 3166 country code, and
* `codeset` is a character set or encoding identifier like `ISO-8859-1`
* or `UTF-8`; as specified by [`setlocale(3)`](man:setlocale(3)).
*
* The locale may be the empty string, which means the user is using the
* system default locale.
*
* The property may be %NULL if it wasnt possible to load it from the
* daemon.
*/
get language(): string;
get local_account(): boolean;
get localAccount(): boolean;
get location(): string;
get locked(): boolean;
get login_frequency(): number;
get loginFrequency(): number;
get login_history(): GLib.Variant;
get loginHistory(): GLib.Variant;
get login_time(): number;
get loginTime(): number;
get nonexistent(): boolean;
get password_hint(): string;
get passwordHint(): string;
get password_mode(): number;
get passwordMode(): number;
get real_name(): string;
get realName(): string;
get shell(): string;
get system_account(): boolean;
get systemAccount(): boolean;
get uid(): number;
get user_name(): string;
get userName(): string;
get x_session(): string;
get xSession(): string;
// Constructors
constructor(properties?: Partial<User.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'changed', callback: (_source: this) => void): number;
connect_after(signal: 'changed', callback: (_source: this) => void): number;
emit(signal: 'changed'): void;
connect(signal: 'sessions-changed', callback: (_source: this) => void): number;
connect_after(signal: 'sessions-changed', callback: (_source: this) => void): number;
emit(signal: 'sessions-changed'): void;
// Methods
/**
* Organize the user by login frequency and names.
* @param user2 a user
* @returns negative if @user1 is before @user2, zero if equal or positive if @user1 is after @user2
*/
collate(user2: User): number;
/**
* Retrieves the account type of `user`.
* @returns a #ActUserAccountType
*/
get_account_type(): UserAccountType;
/**
* Returns whether or not #ActUser is automatically logged in at boot time.
* @returns %TRUE or %FALSE
*/
get_automatic_login(): boolean;
/**
* Retrieves the email address set by `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_email(): string;
/**
* Retrieves the home directory for `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_home_dir(): string;
/**
* Returns the path to the account icon belonging to `user`.
* @returns a path to an icon
*/
get_icon_file(): string;
/**
* Returns the value of #ActUser:language.
* @returns the users language, or the empty string if they are using the system default language, or %NULL if there is no connection to the daemon
*/
get_language(): string | null;
/**
* Returns the value of #ActUser:languages.
* @returns the users preferred languages, or the empty string if they are using the system default language, or %NULL if there is no connection to the daemon
*/
get_languages(): string[] | null;
/**
* Retrieves the location set by `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_location(): string;
/**
* Returns whether or not the #ActUser account is locked.
* @returns %TRUE or %FALSE
*/
get_locked(): boolean;
/**
* Returns the number of times `user` has logged in.
* @returns the login frequency
*/
get_login_frequency(): number;
/**
* Returns the login history for `user`.
* @returns a pointer to GVariant of type "a(xxa{sv})" which must not be modified or freed, or %NULL.
*/
get_login_history(): GLib.Variant;
/**
* Returns the last login time for `user`.
* @returns the login time
*/
get_login_time(): number;
/**
* Get the number of sessions for a user that are graphical and on the
* same seat as the session of the calling process.
* @returns the number of sessions
*/
get_num_sessions(): number;
/**
* Get the number of sessions for a user on any seat of any type.
* See also act_user_get_num_sessions().
*
* (Currently, this function is only implemented for systemd-logind.
* For ConsoleKit, it is equivalent to act_user_get_num_sessions.)
* @returns the number of sessions
*/
get_num_sessions_anywhere(): number;
/**
* Returns the user accounts service object path of `user,`
* or %NULL if `user` doesn't have an object path associated
* with it.
* @returns the object path of the user
*/
get_object_path(): string;
/**
* Get the password expiration policy for a user.
*
* Note this function is synchronous and ignores errors.
*/
get_password_expiration_policy(): [number, number, number, number, number, number];
/**
* Retrieves the password hint set by `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_password_hint(): string;
/**
* Retrieves the password mode of `user`.
* @returns a #ActUserPasswordMode
*/
get_password_mode(): UserPasswordMode;
/**
* Returns the id of the primary session of `user,` or %NULL if `user`
* has no primary session. The primary session will always be
* graphical and will be chosen from the sessions on the same seat as
* the seat of the session of the calling process.
* @returns the id of the primary session of the user
*/
get_primary_session_id(): string;
/**
* Retrieves the display name of `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_real_name(): string;
/**
* Returns whether or not the #ActUser account has retained state in accountsservice.
* @returns %TRUE or %FALSE
*/
get_saved(): boolean;
/**
* Returns the path to the configured session for `user`.
* @returns a path to an icon
*/
get_session(): string;
/**
* Returns the type of the configured session for `user`.
* @returns a path to an icon
*/
get_session_type(): string;
/**
* Retrieves the shell assigned to `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_shell(): string;
/**
* Retrieves the ID of `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_uid(): number;
/**
* Retrieves the login name of `user`.
* @returns a pointer to an array of characters which must not be modified or freed, or %NULL.
*/
get_user_name(): string;
/**
* Returns the path to the configured X session for `user`.
* @returns a path to an icon
*/
get_x_session(): string;
/**
* Retrieves whether the user is a local account or not.
* @returns %TRUE if the user is local
*/
is_local_account(): boolean;
/**
* Returns whether or not #ActUser is currently graphically logged in
* on the same seat as the seat of the session of the calling process.
* @returns %TRUE or %FALSE
*/
is_logged_in(): boolean;
/**
* Returns whether or not #ActUser is currently logged in in any way
* whatsoever. See also act_user_is_logged_in().
*
* (Currently, this function is only implemented for systemd-logind.
* For ConsoleKit, it is equivalent to act_user_is_logged_in.)
* @returns %TRUE or %FALSE
*/
is_logged_in_anywhere(): boolean;
/**
* Retrieves whether the user is nonexistent or not.
* @returns %TRUE if the user is nonexistent
*/
is_nonexistent(): boolean;
/**
* Returns whether or not #ActUser represents a 'system account' like
* 'root' or 'nobody'.
* @returns %TRUE or %FALSE
*/
is_system_account(): boolean;
/**
* Changes the account type of `user`.
*
* Note this function is synchronous and ignores errors.
* @param account_type a #ActUserAccountType
*/
set_account_type(account_type: UserAccountType | null): void;
/**
* If enabled is set to %TRUE then this user will automatically be logged in
* at boot up time. Only one user can be configured to auto login at any given
* time, so subsequent calls to act_user_set_automatic_login() override previous
* calls.
*
* Note this function is synchronous and ignores errors.
* @param enabled whether or not to autologin for user.
*/
set_automatic_login(enabled: boolean): void;
/**
* Assigns a new email to `user`.
*
* Note this function is synchronous and ignores errors.
* @param email an email address
*/
set_email(email: string): void;
/**
* Assigns a new icon for `user`.
*
* Note this function is synchronous and ignores errors.
* @param icon_file path to an icon
*/
set_icon_file(icon_file: string): void;
/**
* Assigns a new locale for `user,` setting #ActUser:language.
*
* Note this function is synchronous and ignores errors.
* @param language a locale (for example, `en_US.utf8`), or the empty string to use the system default locale
*/
set_language(language: string): void;
/**
* Assigns preferred languages for `user,` setting #ActUser:languages, and
* overriding #ActUser:language with the first item in the list if there is one.
*
* Note this function is synchronous and ignores errors.
* @param languages an array of locale (for example, `en_US.utf8`), or the empty string to use the system default locale
*/
set_languages(languages: string[]): void;
/**
* Assigns a new location for `user`.
*
* Note this function is synchronous and ignores errors.
* @param location a location
*/
set_location(location: string): void;
/**
* Note this function is synchronous and ignores errors.
* @param locked whether or not the account is locked
*/
set_locked(locked: boolean): void;
/**
* Changes the password of `user` to `password`.
* `hint` is displayed to the user if they forget the password.
*
* Note this function is synchronous and ignores errors.
* @param password a password
* @param hint a hint to help user recall password
*/
set_password(password: string, hint: string): void;
/**
* Set the password expiration policy for a user.
*
* Note this function is synchronous and ignores errors.
* @param min_days_between_changes location to write minimum number of days needed between password changes.
* @param max_days_between_changes location to write maximum number of days password can stay unchanged.
* @param days_to_warn location to write number of days to warn user password is about to expire.
* @param days_after_expiration_until_lock location to write number of days account will be locked after password expires.
*/
set_password_expiration_policy(
min_days_between_changes: number,
max_days_between_changes: number,
days_to_warn: number,
days_after_expiration_until_lock: number,
): void;
set_password_hint(hint: string): void;
/**
* Changes the password of `user`. If `password_mode` is
* ACT_USER_PASSWORD_MODE_SET_AT_LOGIN then the user will
* be asked for a new password at the next login. If `password_mode`
* is ACT_USER_PASSWORD_MODE_NONE then the user will not require
* a password to log in.
*
* Note this function is synchronous and ignores errors.
* @param password_mode a #ActUserPasswordMode
*/
set_password_mode(password_mode: UserPasswordMode | null): void;
/**
* Assigns a new name for `user`.
*
* Note this function is synchronous and ignores errors.
* @param real_name a new name
*/
set_real_name(real_name: string): void;
/**
* Assigns a new session for `user`.
*
* Note this function is synchronous and ignores errors.
* @param session a session (e.g. gnome)
*/
set_session(session: string): void;
/**
* Assigns a type to the session for `user`.
*
* Note this function is synchronous and ignores errors.
* @param session_type a type of session (e.g. "wayland" or "x11")
*/
set_session_type(session_type: string): void;
/**
* Set the user expiration policy for a user.
*
* Note this function is synchronous and ignores errors.
* @param expiration_time location to write users expires timestamp
*/
set_user_expiration_policy(expiration_time: number): void;
/**
* Assigns a new username for `user`.
*
* Note this function is synchronous and ignores errors.
* @param user_name a new user name
*/
set_user_name(user_name: string): void;
/**
* Assigns a new x session for `user`.
*
* Note this function is synchronous and ignores errors.
* @param x_session an x session (e.g. gnome)
*/
set_x_session(x_session: string): void;
}
module UserManager {
// Signal callback interfaces
interface UserAdded {
(user: User): void;
}
interface UserChanged {
(user: User): void;
}
interface UserIsLoggedInChanged {
(user: User): void;
}
interface UserRemoved {
(user: User): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
exclude_usernames_list: any;
excludeUsernamesList: any;
has_multiple_users: boolean;
hasMultipleUsers: boolean;
include_usernames_list: any;
includeUsernamesList: any;
is_loaded: boolean;
isLoaded: boolean;
}
}
/**
* A user manager object.
*/
class UserManager extends GObject.Object {
static $gtype: GObject.GType<UserManager>;
// Properties
get exclude_usernames_list(): any;
set exclude_usernames_list(val: any);
get excludeUsernamesList(): any;
set excludeUsernamesList(val: any);
get has_multiple_users(): boolean;
set has_multiple_users(val: boolean);
get hasMultipleUsers(): boolean;
set hasMultipleUsers(val: boolean);
get include_usernames_list(): any;
set include_usernames_list(val: any);
get includeUsernamesList(): any;
set includeUsernamesList(val: any);
get is_loaded(): boolean;
get isLoaded(): boolean;
// Constructors
constructor(properties?: Partial<UserManager.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'user-added', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-added', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-added', user: User): void;
connect(signal: 'user-changed', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-changed', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-changed', user: User): void;
connect(signal: 'user-is-logged-in-changed', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-is-logged-in-changed', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-is-logged-in-changed', user: User): void;
connect(signal: 'user-removed', callback: (_source: this, user: User) => void): number;
connect_after(signal: 'user-removed', callback: (_source: this, user: User) => void): number;
emit(signal: 'user-removed', user: User): void;
// Static methods
/**
* Returns the user manager singleton instance. Calling this function will
* automatically being loading the user list if it isn't loaded already.
* The #ActUserManager:is-loaded property will be set to %TRUE when the users
* are finished loading and then act_user_manager_list_users() can be called.
*/
static get_default(): UserManager;
// Virtual methods
vfunc_user_added(user: User): void;
vfunc_user_changed(user: User): void;
vfunc_user_is_logged_in_changed(user: User): void;
vfunc_user_removed(user: User): void;
// Methods
/**
* Activate the session for a given user.
* @param user the user to activate
* @returns whether successfully activated
*/
activate_user_session(user: User): boolean;
/**
* Caches a user account so it shows up via act_user_manager_list_users().
* @param username a user name
* @returns user object
*/
cache_user(username: string): User;
/**
* Asynchronously caches a user account so it shows up via
* act_user_manager_list_users().
*
* For more details, see act_user_manager_cache_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param cancellable optional #GCancellable object, %NULL to ignore
*/
cache_user_async(username: string, cancellable?: Gio.Cancellable | null): Promise<User>;
/**
* Asynchronously caches a user account so it shows up via
* act_user_manager_list_users().
*
* For more details, see act_user_manager_cache_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
cache_user_async(
username: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
/**
* Asynchronously caches a user account so it shows up via
* act_user_manager_list_users().
*
* For more details, see act_user_manager_cache_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
cache_user_async(
username: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<User> | void;
/**
* Finishes an asynchronous user caching.
*
* See act_user_manager_cache_user_async().
* @param result a #GAsyncResult
* @returns user object
*/
cache_user_finish(result: Gio.AsyncResult): User;
/**
* Check whether the user can switch to another session.
* @returns whether we can switch to another session
*/
can_switch(): boolean;
/**
* Creates a user account on the system.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @returns user object
*/
create_user(username: string, fullname: string, accounttype: UserAccountType | null): User;
/**
* Asynchronously creates a user account on the system.
*
* For more details, see act_user_manager_create_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @param cancellable optional #GCancellable object, %NULL to ignore
*/
create_user_async(
username: string,
fullname: string,
accounttype: UserAccountType | null,
cancellable?: Gio.Cancellable | null,
): Promise<User>;
/**
* Asynchronously creates a user account on the system.
*
* For more details, see act_user_manager_create_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
create_user_async(
username: string,
fullname: string,
accounttype: UserAccountType | null,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
/**
* Asynchronously creates a user account on the system.
*
* For more details, see act_user_manager_create_user(), which
* is the synchronous version of this call.
* @param username a unix user name
* @param fullname a unix GECOS value
* @param accounttype a #ActUserAccountType
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
create_user_async(
username: string,
fullname: string,
accounttype: UserAccountType | null,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<User> | void;
/**
* Finishes an asynchronous user creation.
*
* See act_user_manager_create_user_async().
* @param result a #GAsyncResult
* @returns user object
*/
create_user_finish(result: Gio.AsyncResult): User;
/**
* Deletes a user account on the system.
* @param user an #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @returns %TRUE if the user account was successfully deleted
*/
delete_user(user: User, remove_files: boolean): boolean;
/**
* Asynchronously deletes a user account from the system.
*
* For more details, see act_user_manager_delete_user(), which
* is the synchronous version of this call.
* @param user a #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @param cancellable optional #GCancellable object, %NULL to ignore
*/
delete_user_async(
user: User,
remove_files: boolean,
cancellable?: Gio.Cancellable | null,
): Promise<boolean>;
/**
* Asynchronously deletes a user account from the system.
*
* For more details, see act_user_manager_delete_user(), which
* is the synchronous version of this call.
* @param user a #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_user_async(
user: User,
remove_files: boolean,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
/**
* Asynchronously deletes a user account from the system.
*
* For more details, see act_user_manager_delete_user(), which
* is the synchronous version of this call.
* @param user a #ActUser object
* @param remove_files %TRUE to delete the users home directory
* @param cancellable optional #GCancellable object, %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_user_async(
user: User,
remove_files: boolean,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<boolean> | void;
/**
* Finishes an asynchronous user account deletion.
*
* See act_user_manager_delete_user_async().
* @param result a #GAsyncResult
* @returns %TRUE if the user account was successfully deleted
*/
delete_user_finish(result: Gio.AsyncResult): boolean;
/**
* Retrieves a pointer to the #ActUser object for the login `username`
* from `manager`. Trying to use this object before its
* #ActUser:is-loaded property is %TRUE will result in undefined
* behavior.
* @param username the login name of the user to get.
* @returns #ActUser object
*/
get_user(username: string): User;
/**
* Retrieves a pointer to the #ActUser object for the user with the
* given uid from `manager`. Trying to use this object before its
* #ActUser:is-loaded property is %TRUE will result in undefined
* behavior.
* @param id the uid of the user to get.
* @returns #ActUser object
*/
get_user_by_id(id: number): User;
/**
* Switch the display to the login manager.
* @returns whether successful or not
*/
goto_login_session(): boolean;
/**
* Get a list of system user accounts
* @returns List of #ActUser objects
*/
list_users(): User[];
/**
* Check whether or not the accounts service is running.
* @returns whether or not accounts service is running
*/
no_service(): boolean;
/**
* Releases all metadata about a user account, including icon,
* language and session. If the user account is from a remote
* server and the user has never logged in before, then that
* account will no longer show up in ListCachedUsers() output.
* @param username a user name
* @returns %TRUE if successful, otherwise %FALSE
*/
uncache_user(username: string): boolean;
uncache_user_async(username: string, cancellable?: Gio.Cancellable | null): Promise<boolean>;
uncache_user_async(
username: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback<this> | null,
): void;
uncache_user_async(
username: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback<this> | null,
): Promise<boolean> | void;
/**
* Finishes an asynchronous user uncaching.
*
* See act_user_manager_uncache_user_async().
* @param result a #GAsyncResult
* @returns %TRUE if the user account was successfully uncached
*/
uncache_user_finish(result: Gio.AsyncResult): boolean;
}
type UserClass = typeof User;
type UserManagerClass = typeof UserManager;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AccountsService;
}
declare module 'gi://AccountsService' {
import AccountsService10 from 'gi://AccountsService?version=1.0';
export default AccountsService10;
}
// END

117691
configs/userland/ags/@girs/adw-1.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,648 @@
/// <reference path="./gtk-3.0.d.ts" />
/// <reference path="./xlib-2.0.d.ts" />
/// <reference path="./gdk-3.0.d.ts" />
/// <reference path="./cairo-1.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./pango-1.0.d.ts" />
/// <reference path="./harfbuzz-0.0.d.ts" />
/// <reference path="./freetype2-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/// <reference path="./gdkpixbuf-2.0.d.ts" />
/// <reference path="./atk-1.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AppIndicator3?version=0.1' {
// Module dependencies
import type Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'gi://cairo?version=1.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace AppIndicator3 {
/**
* AppIndicator3-0.1
*/
/**
* The category provides grouping for the indicators so that
* users can find indicators that are similar together.
*/
/**
* The category provides grouping for the indicators so that
* users can find indicators that are similar together.
*/
export namespace IndicatorCategory {
export const $gtype: GObject.GType<IndicatorCategory>;
}
enum IndicatorCategory {
/**
* The indicator is used to display the status of the application.
*/
APPLICATION_STATUS,
/**
* The application is used for communication with other people.
*/
COMMUNICATIONS,
/**
* A system indicator relating to something in the user's system.
*/
SYSTEM_SERVICES,
/**
* An indicator relating to the user's hardware.
*/
HARDWARE,
/**
* Something not defined in this enum, please don't use unless you really need it.
*/
OTHER,
}
/**
* These are the states that the indicator can be on in
* the user's panel. The indicator by default starts
* in the state `APP_INDICATOR_STATUS_PASSIVE` and can be
* shown by setting it to `APP_INDICATOR_STATUS_ACTIVE`.
*/
/**
* These are the states that the indicator can be on in
* the user's panel. The indicator by default starts
* in the state `APP_INDICATOR_STATUS_PASSIVE` and can be
* shown by setting it to `APP_INDICATOR_STATUS_ACTIVE`.
*/
export namespace IndicatorStatus {
export const $gtype: GObject.GType<IndicatorStatus>;
}
enum IndicatorStatus {
/**
* The indicator should not be shown to the user.
*/
PASSIVE,
/**
* The indicator should be shown in it's default state.
*/
ACTIVE,
/**
* The indicator should show it's attention icon.
*/
ATTENTION,
}
/**
* String identifier for the #AppIndicator::connection-changed signal.
*/
const INDICATOR_SIGNAL_CONNECTION_CHANGED: string;
/**
* String identifier for the #AppIndicator::new-attention-icon signal.
*/
const INDICATOR_SIGNAL_NEW_ATTENTION_ICON: string;
/**
* String identifier for the #AppIndicator::new-icon signal.
*/
const INDICATOR_SIGNAL_NEW_ICON: string;
/**
* String identifier for the #AppIndicator::new-icon-theme-path signal.
*/
const INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: string;
/**
* String identifier for the #AppIndicator::new-label signal.
*/
const INDICATOR_SIGNAL_NEW_LABEL: string;
/**
* String identifier for the #AppIndicator::new-status signal.
*/
const INDICATOR_SIGNAL_NEW_STATUS: string;
/**
* String identifier for the #AppIndicator::scroll-event signal.
*/
const INDICATOR_SIGNAL_SCROLL_EVENT: string;
module Indicator {
// Signal callback interfaces
interface ConnectionChanged {
(arg1: boolean): void;
}
interface NewAttentionIcon {
(): void;
}
interface NewIcon {
(): void;
}
interface NewIconThemePath {
(object: string): void;
}
interface NewLabel {
(object: string, p0: string): void;
}
interface NewStatus {
(arg1: string): void;
}
interface ScrollEvent {
(arg1: number, arg2: Gdk.ScrollDirection): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
attention_icon_desc: string;
attentionIconDesc: string;
attention_icon_name: string;
attentionIconName: string;
category: string;
connected: boolean;
icon_desc: string;
iconDesc: string;
icon_name: string;
iconName: string;
icon_theme_path: string;
iconThemePath: string;
id: string;
label: string;
label_guide: string;
labelGuide: string;
ordering_index: number;
orderingIndex: number;
status: string;
title: string;
}
}
/**
* A application indicator represents the values that are needed to show a
* unique status in the panel for an application. In general, applications
* should try to fit in the other indicators that are available on the
* panel before using this. But, sometimes it is necissary.
*
* Private fields
*/
class Indicator extends GObject.Object {
static $gtype: GObject.GType<Indicator>;
// Properties
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this textual description of the icon shown.
*/
get attention_icon_desc(): string;
set attention_icon_desc(val: string);
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this textual description of the icon shown.
*/
get attentionIconDesc(): string;
set attentionIconDesc(val: string);
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this icon is shown.
*/
get attention_icon_name(): string;
set attention_icon_name(val: string);
/**
* If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION
* then this icon is shown.
*/
get attentionIconName(): string;
set attentionIconName(val: string);
/**
* The type of indicator that this represents. Please don't use 'Other'.
* Defaults to 'ApplicationStatus'.
*/
get category(): string;
/**
* Pretty simple, %TRUE if we have a reasonable expectation of being
* displayed through this object. You should hide your TrayIcon if so.
*/
get connected(): boolean;
/**
* The description of the regular icon that is shown for the indicator.
*/
get icon_desc(): string;
set icon_desc(val: string);
/**
* The description of the regular icon that is shown for the indicator.
*/
get iconDesc(): string;
set iconDesc(val: string);
/**
* The name of the regular icon that is shown for the indicator.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* The name of the regular icon that is shown for the indicator.
*/
get iconName(): string;
set iconName(val: string);
/**
* An additional place to look for icon names that may be installed by the
* application.
*/
get icon_theme_path(): string;
set icon_theme_path(val: string);
/**
* An additional place to look for icon names that may be installed by the
* application.
*/
get iconThemePath(): string;
set iconThemePath(val: string);
/**
* The ID for this indicator, which should be unique, but used consistently
* by this program and its indicator.
*/
get id(): string;
/**
* A label that can be shown next to the string in the application
* indicator. The label will not be shown unless there is an icon
* as well. The label is useful for numerical and other frequently
* updated information. In general, it shouldn't be shown unless a
* user requests it as it can take up a significant amount of space
* on the user's panel. This may not be shown in all visualizations.
*/
get label(): string;
set label(val: string);
/**
* An optional string to provide guidance to the panel on how big
* the #AppIndicator:label string could get. If this is set correctly
* then the panel should never 'jiggle' as the string adjusts through
* out the range of options. For instance, if you were providing a
* percentage like "54% thrust" in #AppIndicator:label you'd want to
* set this string to "100% thrust" to ensure space when Scotty can
* get you enough power.
*/
get label_guide(): string;
set label_guide(val: string);
/**
* An optional string to provide guidance to the panel on how big
* the #AppIndicator:label string could get. If this is set correctly
* then the panel should never 'jiggle' as the string adjusts through
* out the range of options. For instance, if you were providing a
* percentage like "54% thrust" in #AppIndicator:label you'd want to
* set this string to "100% thrust" to ensure space when Scotty can
* get you enough power.
*/
get labelGuide(): string;
set labelGuide(val: string);
/**
* The ordering index is an odd parameter, and if you think you don't need
* it you're probably right. In general, the application indicator try
* to place the applications in a recreatable place taking into account
* which category they're in to try and group them. But, there are some
* cases where you'd want to ensure indicators are next to each other.
* To do that you can override the generated ordering index and replace it
* with a new one. Again, you probably don't want to be doing this, but
* in case you do, this is the way.
*/
get ordering_index(): number;
set ordering_index(val: number);
/**
* The ordering index is an odd parameter, and if you think you don't need
* it you're probably right. In general, the application indicator try
* to place the applications in a recreatable place taking into account
* which category they're in to try and group them. But, there are some
* cases where you'd want to ensure indicators are next to each other.
* To do that you can override the generated ordering index and replace it
* with a new one. Again, you probably don't want to be doing this, but
* in case you do, this is the way.
*/
get orderingIndex(): number;
set orderingIndex(val: number);
/**
* Whether the indicator is shown or requests attention. Defaults to
* 'Passive'.
*/
get status(): string;
set status(val: string);
/**
* Provides a way to refer to this application indicator in a human
* readable form. This is used in the Unity desktop in the HUD as
* the first part of the menu entries to distinguish them from the
* focused application's entries.
*/
get title(): string;
set title(val: string);
// Constructors
constructor(properties?: Partial<Indicator.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](id: string, icon_name: string, category: IndicatorCategory): Indicator;
static new_with_path(
id: string,
icon_name: string,
category: IndicatorCategory,
icon_theme_path: string,
): Indicator;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'connection-changed', callback: (_source: this, arg1: boolean) => void): number;
connect_after(signal: 'connection-changed', callback: (_source: this, arg1: boolean) => void): number;
emit(signal: 'connection-changed', arg1: boolean): void;
connect(signal: 'new-attention-icon', callback: (_source: this) => void): number;
connect_after(signal: 'new-attention-icon', callback: (_source: this) => void): number;
emit(signal: 'new-attention-icon'): void;
connect(signal: 'new-icon', callback: (_source: this) => void): number;
connect_after(signal: 'new-icon', callback: (_source: this) => void): number;
emit(signal: 'new-icon'): void;
connect(signal: 'new-icon-theme-path', callback: (_source: this, object: string) => void): number;
connect_after(signal: 'new-icon-theme-path', callback: (_source: this, object: string) => void): number;
emit(signal: 'new-icon-theme-path', object: string): void;
connect(signal: 'new-label', callback: (_source: this, object: string, p0: string) => void): number;
connect_after(signal: 'new-label', callback: (_source: this, object: string, p0: string) => void): number;
emit(signal: 'new-label', object: string, p0: string): void;
connect(signal: 'new-status', callback: (_source: this, arg1: string) => void): number;
connect_after(signal: 'new-status', callback: (_source: this, arg1: string) => void): number;
emit(signal: 'new-status', arg1: string): void;
connect(
signal: 'scroll-event',
callback: (_source: this, arg1: number, arg2: Gdk.ScrollDirection) => void,
): number;
connect_after(
signal: 'scroll-event',
callback: (_source: this, arg1: number, arg2: Gdk.ScrollDirection) => void,
): number;
emit(signal: 'scroll-event', arg1: number, arg2: Gdk.ScrollDirection): void;
// Virtual methods
/**
* Slot for #AppIndicator::connection-changed.
* @param connected
*/
vfunc_connection_changed(connected: boolean): void;
/**
* Slot for #AppIndicator::new-attention-icon.
*/
vfunc_new_attention_icon(): void;
/**
* Slot for #AppIndicator::new-icon.
*/
vfunc_new_icon(): void;
/**
* Slot for #AppIndicator::new-icon-theme-path
* @param icon_theme_path
*/
vfunc_new_icon_theme_path(icon_theme_path: string): void;
/**
* Slot for #AppIndicator::new-label.
* @param label
* @param guide
*/
vfunc_new_label(label: string, guide: string): void;
/**
* Slot for #AppIndicator::new-status.
* @param status
*/
vfunc_new_status(status: string): void;
/**
* Slot for #AppIndicator::scroll-event
* @param delta
* @param direction
*/
vfunc_scroll_event(delta: number, direction: Gdk.ScrollDirection): void;
/**
* The function that gets called if an Application
* Indicator area appears after the fallback has been created.
* @param status_icon
*/
vfunc_unfallback(status_icon: Gtk.StatusIcon): void;
// Methods
/**
* This function allows for building the Application Indicator menu
* from a static desktop file.
* @param desktop_file A path to the desktop file to build the menu from
* @param desktop_profile Which entries should be used from the desktop file
*/
build_menu_from_desktop(desktop_file: string, desktop_profile: string): void;
/**
* Wrapper function for property #AppIndicator:attention-icon-name.
* @returns The current attention icon name.
*/
get_attention_icon(): string;
/**
* Wrapper function for property #AppIndicator:attention-icon-desc.
* @returns The current attention icon description.
*/
get_attention_icon_desc(): string;
/**
* Wrapper function for property #AppIndicator:category.
* @returns The current category.
*/
get_category(): IndicatorCategory;
/**
* Wrapper function for property #AppIndicator:icon-name.
* @returns The current icon name.
*/
get_icon(): string;
/**
* Wrapper function for property #AppIndicator:icon-desc.
* @returns The current icon description.
*/
get_icon_desc(): string;
/**
* Wrapper function for property #AppIndicator:icon-theme-path.
* @returns The current icon theme path.
*/
get_icon_theme_path(): string;
/**
* Wrapper function for property #AppIndicator:id.
* @returns The current ID
*/
get_id(): string;
/**
* Wrapper function for property #AppIndicator:label.
* @returns The current label.
*/
get_label(): string;
/**
* Wrapper function for property #AppIndicator:label-guide.
* @returns The current label guide.
*/
get_label_guide(): string;
/**
* Gets the menu being used for this application indicator.
* Wrapper function for property #AppIndicator:menu.
* @returns A #GtkMenu object or %NULL if one hasn't been set.
*/
get_menu(): Gtk.Menu;
/**
* Wrapper function for property #AppIndicator:ordering-index.
* @returns The current ordering index.
*/
get_ordering_index(): number;
/**
* Gets the menuitem being called on secondary-activate event.
* @returns A #GtkWidget object or %NULL if none has been set.
*/
get_secondary_activate_target(): Gtk.Widget;
/**
* Wrapper function for property #AppIndicator:status.
* @returns The current status.
*/
get_status(): IndicatorStatus;
/**
* Gets the title of the application indicator. See the function
* app_indicator_set_title() for information on the title.
* @returns The current title.
*/
get_title(): string;
/**
* Wrapper for app_indicator_set_attention_icon_full() with a NULL
* description.
* @param icon_name The name of the attention icon to set for this indicator
*/
set_attention_icon(icon_name: string): void;
/**
* Wrapper function for property #AppIndicator:attention-icon-name.
* @param icon_name The name of the attention icon to set for this indicator
* @param icon_desc A textual description of the icon
*/
set_attention_icon_full(icon_name: string, icon_desc: string): void;
/**
* Wrapper function for app_indicator_set_icon_full() with a NULL
* description.
* @param icon_name The icon name to set.
*/
set_icon(icon_name: string): void;
/**
* Sets the default icon to use when the status is active but
* not set to attention. In most cases, this should be the
* application icon for the program.
*
* Wrapper function for property #AppIndicator:icon-name and
* #AppIndicator::icon-desc.
* @param icon_name The icon name to set.
* @param icon_desc A textual description of the icon for accessibility
*/
set_icon_full(icon_name: string, icon_desc: string): void;
/**
* Sets the path to use when searching for icons.
* @param icon_theme_path The icon theme path to set.
*/
set_icon_theme_path(icon_theme_path: string): void;
/**
* This is a wrapper function for the #AppIndicator:label and
* #AppIndicator:guide properties. This function can take #NULL
* as either `label` or `guide` and will clear the entries.
* @param label The label to show next to the icon.
* @param guide A guide to size the label correctly.
*/
set_label(label: string, guide: string): void;
/**
* Sets the menu that should be shown when the Application Indicator
* is clicked on in the panel. An application indicator will not
* be rendered unless it has a menu.
*
* Wrapper function for property #AppIndicator:menu.
* @param menu A #GtkMenu to set
*/
set_menu(menu?: Gtk.Menu | null): void;
/**
* Sets the ordering index for the app indicator which effects the
* placement of it on the panel. For almost all app indicator
* this is not the function you're looking for.
*
* Wrapper function for property #AppIndicator:ordering-index.
* @param ordering_index A value for the ordering of this app indicator
*/
set_ordering_index(ordering_index: number): void;
/**
* Set the `menuitem` to be activated when a secondary activation event (i.e. a
* middle-click) is emitted over the #AppIndicator icon/label.
*
* The `menuitem` can be also a complex #GtkWidget, but to get activated when
* a secondary activation occurs in the #Appindicator, it must be a visible and
* active child (or inner-child) of the #AppIndicator:menu.
*
* Setting `menuitem` to %NULL causes to disable this feature.
* @param menuitem A #GtkWidget to be activated on secondary activation
*/
set_secondary_activate_target(menuitem?: Gtk.Widget | null): void;
/**
* Wrapper function for property #AppIndicator:status.
* @param status The status to set for this indicator
*/
set_status(status: IndicatorStatus | null): void;
/**
* Sets the title of the application indicator, or how it should be referred
* in a human readable form. This string should be UTF-8 and localized as it
* expected that users will set it.
*
* In the Unity desktop the most prominent place that this is show will be
* in the HUD. HUD listings for this application indicator will start with
* the title as the first part of the line for the menu items.
*
* Setting `title` to %NULL removes the title.
* @param title Title of the app indicator
*/
set_title(title?: string | null): void;
}
type IndicatorClass = typeof Indicator;
/**
* All of the private data in an instance of an application indicator.
* Private Fields
*/
abstract class IndicatorPrivate {
static $gtype: GObject.GType<IndicatorPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AppIndicator3;
}
declare module 'gi://AppIndicator3' {
import AppIndicator301 from 'gi://AppIndicator3?version=0.1';
export default AppIndicator301;
}
// END

View File

@@ -0,0 +1,83 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AppmenuGLibTranslator?version=24.02' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AppmenuGLibTranslator {
/**
* AppmenuGLibTranslator-24.02
*/
module Importer {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
action_group: Gio.ActionGroup;
actionGroup: Gio.ActionGroup;
bus_name: string;
busName: string;
model: Gio.MenuModel;
object_path: string;
objectPath: string;
}
}
class Importer extends GObject.Object {
static $gtype: GObject.GType<Importer>;
// Properties
get action_group(): Gio.ActionGroup;
get actionGroup(): Gio.ActionGroup;
set bus_name(val: string);
set busName(val: string);
get model(): Gio.MenuModel;
set object_path(val: string);
set objectPath(val: string);
// Constructors
constructor(properties?: Partial<Importer.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](bus_name: string, object_path: string): Importer;
}
type ImporterClass = typeof Importer;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AppmenuGLibTranslator;
}
declare module 'gi://AppmenuGLibTranslator' {
import AppmenuGLibTranslator2402 from 'gi://AppmenuGLibTranslator?version=24.02';
export default AppmenuGLibTranslator2402;
}
// END

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

2169
configs/userland/ags/@girs/astal-3.0.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

1485
configs/userland/ags/@girs/astal-4.0.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,384 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalApps?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalApps {
/**
* AstalApps-0.1
*/
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
module Application {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
app: never;
frequency: number;
name: string;
entry: string;
description: string;
wm_class: string;
wmClass: string;
executable: string;
icon_name: string;
iconName: string;
keywords: string[];
categories: string[];
}
}
/**
* Object representing an applications .desktop file.
*/
class Application extends GObject.Object {
static $gtype: GObject.GType<Application>;
// Properties
/**
* The underlying DesktopAppInfo.
*/
get app(): never;
set app(val: never);
/**
* The number of times [method`AstalApps`.Application.launch] was called on this Application.
*/
get frequency(): number;
set frequency(val: number);
/**
* The name of this Application.
*/
get name(): string;
/**
* Name of the .desktop of this Application.
*/
get entry(): string;
/**
* Description of this Application.
*/
get description(): string;
/**
* `StartupWMClass` field from the desktop file. This represents the `WM_CLASS` property of the main window of the application.
*/
get wm_class(): string;
/**
* `StartupWMClass` field from the desktop file. This represents the `WM_CLASS` property of the main window of the application.
*/
get wmClass(): string;
/**
* `Exec` field from the desktop file. Note that if you want to launch this Application you should use the [method@
* AstalApps.Application.launch] method.
*/
get executable(): string;
/**
* `Icon` field from the desktop file. This is usually a named icon or a path to a file.
*/
get icon_name(): string;
/**
* `Icon` field from the desktop file. This is usually a named icon or a path to a file.
*/
get iconName(): string;
/**
* `Keywords` field from the desktop file.
*/
get keywords(): string[];
/**
* `Categories` field from the desktop file.
*/
get categories(): string[];
// Constructors
constructor(properties?: Partial<Application.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* Get a value from the .desktop file by its key.
* @param key
*/
get_key(key: string): string;
/**
* Launches this application. The launched application inherits the environment of the launching process
*/
launch(): boolean;
/**
* Calculate a score for an application using fuzzy matching algorithm.
* @param term
*/
fuzzy_match(term: string): Score;
/**
* Calculate a score using exact string algorithm.
* @param term
*/
exact_match(term: string): Score;
get_app(): never;
set_app(value: never): void;
get_frequency(): number;
set_frequency(value: number): void;
get_name(): string;
get_entry(): string;
get_description(): string;
get_wm_class(): string;
get_executable(): string;
get_icon_name(): string;
get_keywords(): string[];
get_categories(): string[];
}
module Apps {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
show_hidden: boolean;
showHidden: boolean;
list: Application[];
min_score: number;
minScore: number;
name_multiplier: number;
nameMultiplier: number;
entry_multiplier: number;
entryMultiplier: number;
executable_multiplier: number;
executableMultiplier: number;
description_multiplier: number;
descriptionMultiplier: number;
keywords_multiplier: number;
keywordsMultiplier: number;
categories_multiplier: number;
categoriesMultiplier: number;
}
}
/**
* This object can be used to query applications. Multipliers can be set to customize [struct`AstalApps`.Score] results from queries which
* then are summed and sorted accordingly.
*/
class Apps extends GObject.Object {
static $gtype: GObject.GType<Apps>;
// Properties
/**
* Indicates wether hidden applications should included in queries.
*/
get show_hidden(): boolean;
set show_hidden(val: boolean);
/**
* Indicates wether hidden applications should included in queries.
*/
get showHidden(): boolean;
set showHidden(val: boolean);
/**
* Full list of available applications.
*/
get list(): Application[];
/**
* The minimum score the application has to meet in order to be included in queries.
*/
get min_score(): number;
set min_score(val: number);
/**
* The minimum score the application has to meet in order to be included in queries.
*/
get minScore(): number;
set minScore(val: number);
/**
* Extra multiplier to apply when matching the `name` of an application. Defaults to `2`
*/
get name_multiplier(): number;
set name_multiplier(val: number);
/**
* Extra multiplier to apply when matching the `name` of an application. Defaults to `2`
*/
get nameMultiplier(): number;
set nameMultiplier(val: number);
/**
* Extra multiplier to apply when matching the entry of an application. Defaults to `0`
*/
get entry_multiplier(): number;
set entry_multiplier(val: number);
/**
* Extra multiplier to apply when matching the entry of an application. Defaults to `0`
*/
get entryMultiplier(): number;
set entryMultiplier(val: number);
/**
* Extra multiplier to apply when matching the executable of an application. Defaults to `0.5`
*/
get executable_multiplier(): number;
set executable_multiplier(val: number);
/**
* Extra multiplier to apply when matching the executable of an application. Defaults to `0.5`
*/
get executableMultiplier(): number;
set executableMultiplier(val: number);
/**
* Extra multiplier to apply when matching the description of an application. Defaults to `0`
*/
get description_multiplier(): number;
set description_multiplier(val: number);
/**
* Extra multiplier to apply when matching the description of an application. Defaults to `0`
*/
get descriptionMultiplier(): number;
set descriptionMultiplier(val: number);
/**
* Extra multiplier to apply when matching the keywords of an application. Defaults to `0.5`
*/
get keywords_multiplier(): number;
set keywords_multiplier(val: number);
/**
* Extra multiplier to apply when matching the keywords of an application. Defaults to `0.5`
*/
get keywordsMultiplier(): number;
set keywordsMultiplier(val: number);
/**
* Extra multiplier to apply when matching the categories of an application. Defaults to `0`
*/
get categories_multiplier(): number;
set categories_multiplier(val: number);
/**
* Extra multiplier to apply when matching the categories of an application. Defaults to `0`
*/
get categoriesMultiplier(): number;
set categoriesMultiplier(val: number);
// Constructors
constructor(properties?: Partial<Apps.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Apps;
// Methods
/**
* Calculate a score for an application using fuzzy matching algorithm. Taking this Apps' include settings into consideration .
* @param search
* @param a
*/
fuzzy_score(search: string, a: Application): number;
/**
* Calculate a score for an application using exact string algorithm. Taking this Apps' include settings into consideration .
* @param search
* @param a
*/
exact_score(search: string, a: Application): number;
/**
* Query the `list` of applications with a fuzzy matching algorithm.
* @param search
*/
fuzzy_query(search?: string | null): Application[];
/**
* Query the `list` of applications with a simple string matching algorithm.
* @param search
*/
exact_query(search?: string | null): Application[];
/**
* Reload the `list` of Applications.
*/
reload(): void;
get_show_hidden(): boolean;
set_show_hidden(value: boolean): void;
get_list(): Application[];
get_min_score(): number;
set_min_score(value: number): void;
get_name_multiplier(): number;
set_name_multiplier(value: number): void;
get_entry_multiplier(): number;
set_entry_multiplier(value: number): void;
get_executable_multiplier(): number;
set_executable_multiplier(value: number): void;
get_description_multiplier(): number;
set_description_multiplier(value: number): void;
get_keywords_multiplier(): number;
set_keywords_multiplier(value: number): void;
get_categories_multiplier(): number;
set_categories_multiplier(value: number): void;
}
type ApplicationClass = typeof Application;
abstract class ApplicationPrivate {
static $gtype: GObject.GType<ApplicationPrivate>;
// Constructors
_init(...args: any[]): void;
}
type AppsClass = typeof Apps;
abstract class AppsPrivate {
static $gtype: GObject.GType<AppsPrivate>;
// Constructors
_init(...args: any[]): void;
}
class Score {
static $gtype: GObject.GType<Score>;
// Fields
name: number;
entry: number;
executable: number;
description: number;
keywords: number;
categories: number;
// Constructors
constructor(
properties?: Partial<{
name: number;
entry: number;
executable: number;
description: number;
keywords: number;
categories: number;
}>,
);
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalApps;
}
declare module 'gi://AstalApps' {
import AstalApps01 from 'gi://AstalApps?version=0.1';
export default AstalApps01;
}
// END

View File

@@ -0,0 +1,217 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalAuth?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalAuth {
/**
* AstalAuth-0.1
*/
const MAJOR_VERSION: number;
const MICRO_VERSION: number;
const MINOR_VERSION: number;
const VERSION: string;
module Pam {
// Signal callback interfaces
interface AuthError {
(msg: string): void;
}
interface AuthInfo {
(msg: string): void;
}
interface AuthPromptHidden {
(msg: string): void;
}
interface AuthPromptVisible {
(msg: string): void;
}
interface Fail {
(msg: string): void;
}
interface Success {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
service: string;
username: string;
}
}
/**
* For simple authentication using only a password, using the [func`AstalAuth`.Pam.authenticate]
* method is recommended. Look at the simple examples for how to use it.
*
* There is also a way to get access to the pam conversation, to allow for a more complex
* authentication process, like using multiple factor authentication. Generally it can be used like
* this:
*
* 1. create the Pam object.
* 2. set username and service if so required. It has sane defaults, so in most cases you can skip
* this.
* 3. connect to the signals.
* After an `auth-*` signal is emitted, it has to be responded with exactly one
* [method`AstalAuth`.Pam.supply_secret] call. The secret is a string containing the user input. For
* [auth-info][signal`AstalAuth`.Pam::auth-info:] and [auth-error][signal`AstalAuth`.Pam::auth-error:]
* it should be `NULL`. Not connecting those signals, is equivalent to calling
* [method`AstalAuth`.Pam.supply_secret] with `NULL` immediately after the signal is emitted.
* 4. start authentication process using [method`AstalAuth`.Pam.start_authenticate].
* 5. it is possible to reuse the same Pam object for multiple sequential authentication attempts.
* Just call [method`AstalAuth`.Pam.start_authenticate] again after the `success` or `fail` signal
* was emitted.
*/
class Pam extends GObject.Object {
static $gtype: GObject.GType<Pam>;
// Properties
/**
* The pam service used for authentication.
* Changing the value of this property has no affect on an already started authentication
* process.
*
* Defaults to the astal-auth pam service.
*/
get service(): string;
set service(val: string);
/**
* The username used for authentication.
* Changing the value of this property has no affect on an already started authentication
* process.
*
* Defaults to the user that owns this process.
*/
get username(): string;
set username(val: string);
// Constructors
constructor(properties?: Partial<Pam.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'auth-error', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-error', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-error', msg: string): void;
connect(signal: 'auth-info', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-info', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-info', msg: string): void;
connect(signal: 'auth-prompt-hidden', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-prompt-hidden', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-prompt-hidden', msg: string): void;
connect(signal: 'auth-prompt-visible', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'auth-prompt-visible', callback: (_source: this, msg: string) => void): number;
emit(signal: 'auth-prompt-visible', msg: string): void;
connect(signal: 'fail', callback: (_source: this, msg: string) => void): number;
connect_after(signal: 'fail', callback: (_source: this, msg: string) => void): number;
emit(signal: 'fail', msg: string): void;
connect(signal: 'success', callback: (_source: this) => void): number;
connect_after(signal: 'success', callback: (_source: this) => void): number;
emit(signal: 'success'): void;
// Static methods
/**
* Requests authentication of the provided password using the PAM (Pluggable Authentication Modules)
* system.
* @param password the password to be authenticated
* @param result_callback a GAsyncReadyCallback to call when the request is satisfied
*/
static authenticate(password: string, result_callback?: Gio.AsyncReadyCallback<Pam> | null): boolean;
static authenticate_finish(res: Gio.AsyncResult): number;
// Methods
/**
* Fetches the service from AsalAuthPam object.
* @returns the service of the AsalAuthPam object. This string is owned by the object and must not be modified or freed.
*/
get_service(): string;
/**
* Fetches the username from AsalAuthPam object.
* @returns the username of the AsalAuthPam object. This string is owned by the object and must not be modified or freed.
*/
get_username(): string;
/**
* Sets the service to be used for authentication. This must be set to
* before calling start_authenticate.
* Changing it afterwards has no effect on the authentication process.
*
* Defaults to `astal-auth`.
* @param service the pam service used for authentication
*/
set_service(service: string): void;
/**
* Sets the username to be used for authentication. This must be set to
* before calling start_authenticate.
* Changing it afterwards has no effect on the authentication process.
*
* Defaults to the owner of the process.
* @param username the new username
*/
set_username(username: string): void;
/**
* starts a new authentication process using the PAM (Pluggable Authentication Modules) system.
* Note that this will cancel an already running authentication process
* associated with this AstalAuthPam object.
*/
start_authenticate(): boolean;
/**
* provides pam with a secret. This method must be called exactly once after a
* auth-* signal is emitted.
* @param secret the secret to be provided to pam. Can be NULL.
*/
supply_secret(secret?: string | null): void;
}
type PamClass = typeof Pam;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalAuth;
}
declare module 'gi://AstalAuth' {
import AstalAuth01 from 'gi://AstalAuth?version=0.1';
export default AstalAuth01;
}
// END

View File

@@ -0,0 +1,696 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalBattery?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalBattery {
/**
* AstalBattery-0.1
*/
export namespace State {
export const $gtype: GObject.GType<State>;
}
enum State {
UNKNOWN,
CHARGING,
DISCHARGING,
EMPTY,
FULLY_CHARGED,
PENDING_CHARGE,
PENDING_DISCHARGE,
}
export namespace Technology {
export const $gtype: GObject.GType<Technology>;
}
enum Technology {
UNKNOWN,
LITHIUM_ION,
LITHIUM_POLYMER,
LITHIUM_IRON_PHOSPHATE,
LEAD_ACID,
NICKEL_CADMIUM,
NICKEL_METAL_HYDRIDE,
}
export namespace WarningLevel {
export const $gtype: GObject.GType<WarningLevel>;
}
enum WarningLevel {
UNKNOWN,
NONE,
DISCHARGING,
LOW,
CRITICIAL,
ACTION,
}
export namespace BatteryLevel {
export const $gtype: GObject.GType<BatteryLevel>;
}
enum BatteryLevel {
UNKNOWN,
NONE,
LOW,
CRITICIAL,
NORMAL,
HIGH,
FULL,
}
export namespace Type {
export const $gtype: GObject.GType<Type>;
}
enum Type {
UNKNOWN,
LINE_POWER,
BATTERY,
UPS,
MONITOR,
MOUSE,
KEYBOARD,
PDA,
PHONE,
MEDIA_PLAYER,
TABLET,
COMPUTER,
GAMING_INPUT,
PEN,
TOUCHPAD,
MODEM,
NETWORK,
HEADSET,
SPEAKERS,
HEADPHONES,
VIDEO,
OTHER_AUDIO,
REMOVE_CONTROL,
PRINTER,
SCANNER,
CAMERA,
WEARABLE,
TOY,
BLUETOOTH_GENERIC,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Get the DisplayDevice.
*/
function get_default(): Device;
module Device {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
device_type: Type;
deviceType: Type;
native_path: string;
nativePath: string;
vendor: string;
model: string;
serial: string;
update_time: number;
updateTime: number;
power_supply: boolean;
powerSupply: boolean;
online: boolean;
energy: number;
energy_empty: number;
energyEmpty: number;
energy_full: number;
energyFull: number;
energy_full_design: number;
energyFullDesign: number;
energy_rate: number;
energyRate: number;
voltage: number;
charge_cycles: number;
chargeCycles: number;
luminosity: number;
time_to_empty: number;
timeToEmpty: number;
time_to_full: number;
timeToFull: number;
percentage: number;
temperature: number;
is_present: boolean;
isPresent: boolean;
state: State;
is_rechargable: boolean;
isRechargable: boolean;
capacity: number;
technology: Technology;
warning_level: WarningLevel;
warningLevel: WarningLevel;
battery_level: BatteryLevel;
batteryLevel: BatteryLevel;
icon_name: string;
iconName: string;
charging: boolean;
is_battery: boolean;
isBattery: boolean;
battery_icon_name: string;
batteryIconName: string;
device_type_name: string;
deviceTypeName: string;
device_type_icon: string;
deviceTypeIcon: string;
}
}
/**
* Client for a UPower [device](https://upower.freedesktop.org/docs/Device.html).
*/
class Device extends GObject.Object {
static $gtype: GObject.GType<Device>;
// Properties
/**
* If it is [enum`AstalBattery`.Type.BATTERY], you will need to verify that the property power-supply has the value `true` before
* considering it as a laptop battery. Otherwise it will likely be the battery for a device of an unknown type.
*/
get device_type(): Type;
set device_type(val: Type);
/**
* If it is [enum`AstalBattery`.Type.BATTERY], you will need to verify that the property power-supply has the value `true` before
* considering it as a laptop battery. Otherwise it will likely be the battery for a device of an unknown type.
*/
get deviceType(): Type;
set deviceType(val: Type);
/**
* Native path of the power source. This is the sysfs path, for example /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. It is
* blank if the device is being driven by a user space driver.
*/
get native_path(): string;
set native_path(val: string);
/**
* Native path of the power source. This is the sysfs path, for example /sys/devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0. It is
* blank if the device is being driven by a user space driver.
*/
get nativePath(): string;
set nativePath(val: string);
/**
* Name of the vendor of the battery.
*/
get vendor(): string;
set vendor(val: string);
/**
* Name of the model of this battery.
*/
get model(): string;
set model(val: string);
/**
* Unique serial number of the battery.
*/
get serial(): string;
set serial(val: string);
/**
* The point in time (seconds since the Epoch) that data was read from the power source.
*/
get update_time(): number;
set update_time(val: number);
/**
* The point in time (seconds since the Epoch) that data was read from the power source.
*/
get updateTime(): number;
set updateTime(val: number);
/**
* If the power device is used to supply the system. This would be set `true` for laptop batteries and UPS devices, but set to `false` for
* wireless mice or PDAs.
*/
get power_supply(): boolean;
set power_supply(val: boolean);
/**
* If the power device is used to supply the system. This would be set `true` for laptop batteries and UPS devices, but set to `false` for
* wireless mice or PDAs.
*/
get powerSupply(): boolean;
set powerSupply(val: boolean);
/**
* Whether power is currently being provided through line power.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.LINE_POWER].
*/
get online(): boolean;
set online(val: boolean);
/**
* Amount of energy (measured in Wh) currently available in the power source.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy(): number;
set energy(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered to be empty.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_empty(): number;
set energy_empty(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered to be empty.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyEmpty(): number;
set energyEmpty(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_full(): number;
set energy_full(val: number);
/**
* Amount of energy (measured in Wh) in the power source when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyFull(): number;
set energyFull(val: number);
/**
* Amount of energy (measured in Wh) the power source is designed to hold when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_full_design(): number;
set energy_full_design(val: number);
/**
* Amount of energy (measured in Wh) the power source is designed to hold when it's considered full.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyFullDesign(): number;
set energyFullDesign(val: number);
/**
* Amount of energy being drained from the source, measured in W. If positive, the source is being discharged, if negative it's being charged.
*
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energy_rate(): number;
set energy_rate(val: number);
/**
* Amount of energy being drained from the source, measured in W. If positive, the source is being discharged, if negative it's being charged.
*
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get energyRate(): number;
set energyRate(val: number);
/**
* Voltage in the Cell or being recorded by the meter.
*/
get voltage(): number;
set voltage(val: number);
/**
* The number of charge cycles as defined by the TCO certification, or -1 if that value is unknown or not applicable.
*/
get charge_cycles(): number;
set charge_cycles(val: number);
/**
* The number of charge cycles as defined by the TCO certification, or -1 if that value is unknown or not applicable.
*/
get chargeCycles(): number;
set chargeCycles(val: number);
/**
* Luminosity being recorded by the meter.
*/
get luminosity(): number;
set luminosity(val: number);
/**
* Number of seconds until the power source is considered empty. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get time_to_empty(): number;
set time_to_empty(val: number);
/**
* Number of seconds until the power source is considered empty. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get timeToEmpty(): number;
set timeToEmpty(val: number);
/**
* Number of seconds until the power source is considered full. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get time_to_full(): number;
set time_to_full(val: number);
/**
* Number of seconds until the power source is considered full. Is set to 0 if unknown.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get timeToFull(): number;
set timeToFull(val: number);
/**
* The amount of energy left in the power source expressed as a percentage between 0 and 1.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY]. The percentage
* will be an approximation if [property`AstalBattery`.Device:battery_level] is set to something other than None.
*/
get percentage(): number;
set percentage(val: number);
/**
* The temperature of the device in degrees Celsius.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get temperature(): number;
set temperature(val: number);
/**
* If the power source is present in the bay.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get is_present(): boolean;
set is_present(val: boolean);
/**
* If the power source is present in the bay.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get isPresent(): boolean;
set isPresent(val: boolean);
/**
* The battery power state.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get state(): State;
set state(val: State);
/**
* If the power source is rechargeable.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get is_rechargable(): boolean;
set is_rechargable(val: boolean);
/**
* If the power source is rechargeable.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get isRechargable(): boolean;
set isRechargable(val: boolean);
/**
* The capacity of the power source expressed as a percentage between 0 and 1.
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get capacity(): number;
set capacity(val: number);
/**
* Technology used in the battery:
* This property is only valid if [property`AstalBattery`.Device:device_type] is [enum`AstalBattery`.Type.BATTERY].
*/
get technology(): Technology;
set technology(val: Technology);
/**
* Warning level of the battery.
*/
get warning_level(): WarningLevel;
set warning_level(val: WarningLevel);
/**
* Warning level of the battery.
*/
get warningLevel(): WarningLevel;
set warningLevel(val: WarningLevel);
/**
* The level of the battery for devices which do not report a percentage but rather a coarse battery level. If the value is None. then the device
* does not support coarse battery reporting, and the [property`AstalBattery`.Device:percentage] should be used instead.
*/
get battery_level(): BatteryLevel;
set battery_level(val: BatteryLevel);
/**
* The level of the battery for devices which do not report a percentage but rather a coarse battery level. If the value is None. then the device
* does not support coarse battery reporting, and the [property`AstalBattery`.Device:percentage] should be used instead.
*/
get batteryLevel(): BatteryLevel;
set batteryLevel(val: BatteryLevel);
/**
* An icon name representing this Device.
* NOTE: [property`AstalBattery`.Device:battery_icon_name] might be a better fit as it is calculated from percentage.
*/
get icon_name(): string;
set icon_name(val: string);
/**
* An icon name representing this Device.
* NOTE: [property`AstalBattery`.Device:battery_icon_name] might be a better fit as it is calculated from percentage.
*/
get iconName(): string;
set iconName(val: string);
/**
* Indicates if [property`AstalBattery`.Device:state] is charging or fully charged.
*/
get charging(): boolean;
set charging(val: boolean);
/**
* Indicates if [property`AstalBattery`.Device:device_type] is not line power or unknown.
*/
get is_battery(): boolean;
set is_battery(val: boolean);
/**
* Indicates if [property`AstalBattery`.Device:device_type] is not line power or unknown.
*/
get isBattery(): boolean;
set isBattery(val: boolean);
/**
* An icon name in the form of "battery-level-$percentage-$state-symbolic".
*/
get battery_icon_name(): string;
set battery_icon_name(val: string);
/**
* An icon name in the form of "battery-level-$percentage-$state-symbolic".
*/
get batteryIconName(): string;
set batteryIconName(val: string);
/**
* A string representation of this device's [property`AstalBattery`.Device:device_type].
*/
get device_type_name(): string;
set device_type_name(val: string);
/**
* A string representation of this device's [property`AstalBattery`.Device:device_type].
*/
get deviceTypeName(): string;
set deviceTypeName(val: string);
/**
* An icon name that can be used to represent this device's [property`AstalBattery`.Device:device_type].
*/
get device_type_icon(): string;
set device_type_icon(val: string);
/**
* An icon name that can be used to represent this device's [property`AstalBattery`.Device:device_type].
*/
get deviceTypeIcon(): string;
set deviceTypeIcon(val: string);
// Constructors
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](path: never): Device;
// Static methods
/**
* Get the DisplayDevice.
*/
static get_default(): Device | null;
// Methods
get_device_type(): Type;
get_native_path(): string;
get_vendor(): string;
get_model(): string;
get_serial(): string;
get_update_time(): number;
get_power_supply(): boolean;
get_online(): boolean;
get_energy(): number;
get_energy_empty(): number;
get_energy_full(): number;
get_energy_full_design(): number;
get_energy_rate(): number;
get_voltage(): number;
get_charge_cycles(): number;
get_luminosity(): number;
get_time_to_empty(): number;
get_time_to_full(): number;
get_percentage(): number;
get_temperature(): number;
get_is_present(): boolean;
get_state(): State;
get_is_rechargable(): boolean;
get_capacity(): number;
get_technology(): Technology;
get_warning_level(): WarningLevel;
get_battery_level(): BatteryLevel;
get_icon_name(): string;
get_charging(): boolean;
get_is_battery(): boolean;
get_battery_icon_name(): string;
get_device_type_name(): string;
get_device_type_icon(): string;
}
module UPower {
// Signal callback interfaces
interface DeviceAdded {
(device: Device): void;
}
interface DeviceRemoved {
(device: Device): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
devices: Device[];
display_device: Device;
displayDevice: Device;
daemon_version: string;
daemonVersion: string;
on_battery: boolean;
onBattery: boolean;
lid_is_closed: boolean;
lidIsClosed: boolean;
lid_is_present: boolean;
lidIsPresent: boolean;
critical_action: string;
criticalAction: string;
}
}
/**
* Client for the UPower [dbus interface](https://upower.freedesktop.org/docs/UPower.html).
*/
class UPower extends GObject.Object {
static $gtype: GObject.GType<UPower>;
// Properties
/**
* List of UPower devices.
*/
get devices(): Device[];
/**
* A composite device that represents the battery status.
*/
get display_device(): Device;
/**
* A composite device that represents the battery status.
*/
get displayDevice(): Device;
get daemon_version(): string;
get daemonVersion(): string;
/**
* Indicates whether the system is running on battery power.
*/
get on_battery(): boolean;
/**
* Indicates whether the system is running on battery power.
*/
get onBattery(): boolean;
/**
* Indicates if the laptop lid is closed where the display cannot be seen.
*/
get lid_is_closed(): boolean;
/**
* Indicates if the laptop lid is closed where the display cannot be seen.
*/
get lidIsClosed(): boolean;
/**
* Indicates if the system has a lid device.
*/
get lid_is_present(): boolean;
/**
* Indicates if the system has a lid device.
*/
get lidIsPresent(): boolean;
/**
* When the system's power supply is critical (critically low batteries or UPS), the system will take this action.
*/
get critical_action(): string;
/**
* When the system's power supply is critical (critically low batteries or UPS), the system will take this action.
*/
get criticalAction(): string;
// Constructors
constructor(properties?: Partial<UPower.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): UPower;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-added', device: Device): void;
connect(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-removed', device: Device): void;
// Methods
get_devices(): Device[];
get_display_device(): Device;
get_daemon_version(): string;
get_on_battery(): boolean;
get_lid_is_closed(): boolean;
get_lid_is_present(): boolean;
get_critical_action(): string;
}
type DeviceClass = typeof Device;
abstract class DevicePrivate {
static $gtype: GObject.GType<DevicePrivate>;
// Constructors
_init(...args: any[]): void;
}
type UPowerClass = typeof UPower;
abstract class UPowerPrivate {
static $gtype: GObject.GType<UPowerPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalBattery;
}
declare module 'gi://AstalBattery' {
import AstalBattery01 from 'gi://AstalBattery?version=0.1';
export default AstalBattery01;
}
// END

View File

@@ -0,0 +1,551 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalBluetooth?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalBluetooth {
/**
* AstalBluetooth-0.1
*/
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Gets the default singleton Bluetooth object.
*/
function get_default(): Bluetooth;
module Adapter {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
uuids: string[];
discovering: boolean;
modalias: string;
name: string;
class: number;
address: string;
discoverable: boolean;
pairable: boolean;
powered: boolean;
alias: string;
discoverable_timeout: number;
discoverableTimeout: number;
pairable_timeout: number;
pairableTimeout: number;
}
}
/**
* Object representing an [adapter](https://github.com/RadiusNetworks/bluez/blob/master/doc/adapter-api.txt).
*/
class Adapter extends GObject.Object {
static $gtype: GObject.GType<Adapter>;
// Properties
/**
* List of 128-bit UUIDs that represents the available local services.
*/
get uuids(): string[];
/**
* Indicates that a device discovery procedure is active.
*/
get discovering(): boolean;
/**
* Local Device ID information in modalias format used by the kernel and udev.
*/
get modalias(): string;
/**
* The Bluetooth system name (pretty hostname).
*/
get name(): string;
/**
* The Bluetooth class of device.
*/
get class(): number;
/**
* The Bluetooth device address.
*/
get address(): string;
/**
* Switch an adapter to discoverable or non-discoverable to either make it visible or hide it.
*/
get discoverable(): boolean;
set discoverable(val: boolean);
/**
* Switch an adapter to pairable or non-pairable.
*/
get pairable(): boolean;
set pairable(val: boolean);
/**
* Switch an adapter on or off.
*/
get powered(): boolean;
set powered(val: boolean);
/**
* The Bluetooth friendly name.
* In case no alias is set, it will return [property`AstalBluetooth`.Adapter:name].
*/
get alias(): string;
set alias(val: string);
/**
* The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever
* until [method`AstalBluetooth`.Adapter.stop_discovery] is invoked. The default value for the discoverable timeout should be `180`.
*/
get discoverable_timeout(): number;
set discoverable_timeout(val: number);
/**
* The discoverable timeout in seconds. A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever
* until [method`AstalBluetooth`.Adapter.stop_discovery] is invoked. The default value for the discoverable timeout should be `180`.
*/
get discoverableTimeout(): number;
set discoverableTimeout(val: number);
/**
* The pairable timeout in seconds.
* A value of zero means that the timeout is disabled and it will stay in pairable mode forever. The default value for pairable timeout should be
* disabled `0`.
*/
get pairable_timeout(): number;
set pairable_timeout(val: number);
/**
* The pairable timeout in seconds.
* A value of zero means that the timeout is disabled and it will stay in pairable mode forever. The default value for pairable timeout should be
* disabled `0`.
*/
get pairableTimeout(): number;
set pairableTimeout(val: number);
// Constructors
constructor(properties?: Partial<Adapter.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This removes the remote device and the pairing information.
* Possible errors: `InvalidArguments`, `Failed`.
* @param device
*/
remove_device(device: Device): void;
/**
* This method starts the device discovery procedure.
* Possible errors: `NotReady`, `Failed`.
*/
start_discovery(): void;
/**
* This method will cancel any previous [method`AstalBluetooth`.Adapter.start_discovery] procedure.
* Possible errors: `NotReady`, `Failed`, `NotAuthorized`.
*/
stop_discovery(): void;
get_uuids(): string[];
get_discovering(): boolean;
get_modalias(): string;
get_name(): string;
get_class(): number;
get_address(): string;
get_discoverable(): boolean;
set_discoverable(value: boolean): void;
get_pairable(): boolean;
set_pairable(value: boolean): void;
get_powered(): boolean;
set_powered(value: boolean): void;
get_alias(): string;
set_alias(value: string): void;
get_discoverable_timeout(): number;
set_discoverable_timeout(value: number): void;
get_pairable_timeout(): number;
set_pairable_timeout(value: number): void;
}
module Bluetooth {
// Signal callback interfaces
interface DeviceAdded {
(device: Device): void;
}
interface DeviceRemoved {
(device: Device): void;
}
interface AdapterAdded {
(adapter: Adapter): void;
}
interface AdapterRemoved {
(adapter: Adapter): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
is_powered: boolean;
isPowered: boolean;
is_connected: boolean;
isConnected: boolean;
adapter: Adapter;
adapters: Adapter[];
devices: Device[];
}
}
/**
* Manager object for `org.bluez`.
*/
class Bluetooth extends GObject.Object {
static $gtype: GObject.GType<Bluetooth>;
// Properties
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:adapters] are powered.
*/
get is_powered(): boolean;
set is_powered(val: boolean);
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:adapters] are powered.
*/
get isPowered(): boolean;
set isPowered(val: boolean);
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:devices] is connected.
*/
get is_connected(): boolean;
set is_connected(val: boolean);
/**
* `true` if any of the [property`AstalBluetooth`.Bluetooth:devices] is connected.
*/
get isConnected(): boolean;
set isConnected(val: boolean);
/**
* The first registered adapter which is usually the only adapter.
*/
get adapter(): Adapter;
/**
* List of adapters available on the host device.
*/
get adapters(): Adapter[];
/**
* List of registered devices on the `org.bluez` bus.
*/
get devices(): Device[];
// Constructors
constructor(properties?: Partial<Bluetooth.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Bluetooth;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-added', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-added', device: Device): void;
connect(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
connect_after(signal: 'device-removed', callback: (_source: this, device: Device) => void): number;
emit(signal: 'device-removed', device: Device): void;
connect(signal: 'adapter-added', callback: (_source: this, adapter: Adapter) => void): number;
connect_after(signal: 'adapter-added', callback: (_source: this, adapter: Adapter) => void): number;
emit(signal: 'adapter-added', adapter: Adapter): void;
connect(signal: 'adapter-removed', callback: (_source: this, adapter: Adapter) => void): number;
connect_after(signal: 'adapter-removed', callback: (_source: this, adapter: Adapter) => void): number;
emit(signal: 'adapter-removed', adapter: Adapter): void;
// Static methods
/**
* Gets the default singleton Bluetooth object.
*/
static get_default(): Bluetooth;
// Methods
/**
* Toggle the [property`AstalBluetooth`.Adapter:powered] property of the [property`AstalBluetooth`.Bluetooth:adapter].
*/
toggle(): void;
get_is_powered(): boolean;
get_is_connected(): boolean;
get_adapter(): Adapter | null;
get_adapters(): Adapter[];
get_devices(): Device[];
}
module Device {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
uuids: string[];
connected: boolean;
legacy_pairing: boolean;
legacyPairing: boolean;
paired: boolean;
rssi: number;
adapter: never;
address: string;
icon: string;
modalias: string;
name: string;
appearance: number;
class: number;
connecting: boolean;
blocked: boolean;
trusted: boolean;
battery_percentage: number;
batteryPercentage: number;
alias: string;
}
}
/**
* Object representing a [device](https://github.com/luetzel/bluez/blob/master/doc/device-api.txt).
*/
class Device extends GObject.Object {
static $gtype: GObject.GType<Device>;
// Properties
/**
* List of 128-bit UUIDs that represents the available remote services.
*/
get uuids(): string[];
/**
* Indicates if the remote device is currently connected.
*/
get connected(): boolean;
/**
* `true` if the device only supports the pre-2.1 pairing mechanism.
*/
get legacy_pairing(): boolean;
/**
* `true` if the device only supports the pre-2.1 pairing mechanism.
*/
get legacyPairing(): boolean;
/**
* Indicates if the remote device is paired.
*/
get paired(): boolean;
/**
* Received Signal Strength Indicator of the remote device (inquiry or advertising).
*/
get rssi(): number;
/**
* The object path of the adapter the device belongs to.
*/
get adapter(): never;
/**
* The Bluetooth device address of the remote device.
*/
get address(): string;
/**
* Proposed icon name.
*/
get icon(): string;
/**
* Remote Device ID information in modalias format used by the kernel and udev.
*/
get modalias(): string;
/**
* The Bluetooth remote name.
* It is always better to use [property`AstalBluetooth`.Device:alias].
*/
get name(): string;
/**
* External appearance of device, as found on GAP service.
*/
get appearance(): number;
/**
* The Bluetooth class of device of the remote device.
*/
get class(): number;
/**
* Indicates if this device is currently trying to be connected.
*/
get connecting(): boolean;
set connecting(val: boolean);
/**
* If set to `true` any incoming connections from the device will be immediately rejected.
*/
get blocked(): boolean;
set blocked(val: boolean);
/**
* Indicates if the remote is seen as trusted.
*/
get trusted(): boolean;
set trusted(val: boolean);
/**
* The percentage of battery left on the device if it has one, else -1.
*/
get battery_percentage(): number;
/**
* The percentage of battery left on the device if it has one, else -1.
*/
get batteryPercentage(): number;
/**
* The name alias for the remote device.
* In case no alias is set, it will return the remote device [property`AstalBluetooth`.Device:name].
*/
get alias(): string;
set alias(val: string);
// Constructors
constructor(properties?: Partial<Device.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
/**
* This is a generic method to connect any profiles the remote device supports that can be connected to.
* Possible errors: `NotReady`, `Failed`, `InProgress`, `AlreadyConnected`.
*/
connect_device(): Promise<void>;
/**
* This is a generic method to connect any profiles the remote device supports that can be connected to.
* Possible errors: `NotReady`, `Failed`, `InProgress`, `AlreadyConnected`.
* @param _callback_
*/
connect_device(_callback_: Gio.AsyncReadyCallback<this> | null): void;
/**
* This is a generic method to connect any profiles the remote device supports that can be connected to.
* Possible errors: `NotReady`, `Failed`, `InProgress`, `AlreadyConnected`.
* @param _callback_
*/
connect_device(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
connect_device_finish(_res_: Gio.AsyncResult): void;
/**
* This method gracefully disconnects all connected profiles.
* Possible errors: `NotConnected`.
*/
disconnect_device(): Promise<void>;
/**
* This method gracefully disconnects all connected profiles.
* Possible errors: `NotConnected`.
* @param _callback_
*/
disconnect_device(_callback_: Gio.AsyncReadyCallback<this> | null): void;
/**
* This method gracefully disconnects all connected profiles.
* Possible errors: `NotConnected`.
* @param _callback_
*/
disconnect_device(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
disconnect_device_finish(_res_: Gio.AsyncResult): void;
/**
* This method connects a specific profile of this device. The UUID provided is the remote service UUID for the profile.
* Possible errors: `Failed`, `InProgress`, `InvalidArguments`, `NotAvailable`, `NotReady`.
* @param uuid the remote service UUID.
*/
connect_profile(uuid: string): void;
/**
* This method disconnects a specific profile of this device.
* Possible errors: `Failed`, `InProgress`, `InvalidArguments`, `NotSupported`.
* @param uuid the remote service UUID.
*/
disconnect_profile(uuid: string): void;
/**
* This method will connect to the remote device and initiate pairing.
* Possible errors: `InvalidArguments`, `Failed`, `AlreadyExists`, `AuthenticationCanceled`, `AuthenticationFailed`, `AuthenticationRejected`,
* `AuthenticationTimeout`, `ConnectionAttemptFailed`.
*/
pair(): void;
/**
* This method can be used to cancel a pairing operation initiated by [method`AstalBluetooth`.Device.pair].
* Possible errors: `DoesNotExist`, `Failed`.
*/
cancel_pairing(): void;
get_uuids(): string[];
get_connected(): boolean;
get_legacy_pairing(): boolean;
get_paired(): boolean;
get_rssi(): number;
get_adapter(): never;
get_address(): string;
get_icon(): string;
get_modalias(): string;
get_name(): string;
get_appearance(): number;
get_class(): number;
get_connecting(): boolean;
get_blocked(): boolean;
set_blocked(value: boolean): void;
get_trusted(): boolean;
set_trusted(value: boolean): void;
get_battery_percentage(): number;
get_alias(): string;
set_alias(value: string): void;
}
type AdapterClass = typeof Adapter;
abstract class AdapterPrivate {
static $gtype: GObject.GType<AdapterPrivate>;
// Constructors
_init(...args: any[]): void;
}
type BluetoothClass = typeof Bluetooth;
abstract class BluetoothPrivate {
static $gtype: GObject.GType<BluetoothPrivate>;
// Constructors
_init(...args: any[]): void;
}
type DeviceClass = typeof Device;
abstract class DevicePrivate {
static $gtype: GObject.GType<DevicePrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalBluetooth;
}
declare module 'gi://AstalBluetooth' {
import AstalBluetooth01 from 'gi://AstalBluetooth?version=0.1';
export default AstalBluetooth01;
}
// END

View File

@@ -0,0 +1,222 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalCava?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalCava {
/**
* AstalCava-0.1
*/
export namespace Input {
export const $gtype: GObject.GType<Input>;
}
enum Input {
FIFO,
PORTAUDIO,
PIPEWIRE,
ALSA,
PULSE,
SNDIO,
SHMEM,
WINSCAP,
}
/**
* gets the default Cava object.
*/
function get_default(): Cava | null;
module Cava {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
active: boolean;
autosens: boolean;
bars: number;
channels: number;
framerate: number;
high_cutoff: number;
highCutoff: number;
input: Input;
low_cutoff: number;
lowCutoff: number;
noise_reduction: number;
noiseReduction: number;
samplerate: number;
source: string;
stereo: boolean;
values: number[];
}
}
class Cava extends GObject.Object {
static $gtype: GObject.GType<Cava>;
// Properties
/**
* whether or not the audio capture and visualization is running. if false the values array will
* not be updated.
*/
get active(): boolean;
set active(val: boolean);
/**
* When set, the sensitivity will automatically be adjusted.
*/
get autosens(): boolean;
set autosens(val: boolean);
/**
* the number of bars the visualizer should create.
*/
get bars(): number;
set bars(val: number);
/**
* how many input channels to consider
*/
get channels(): number;
set channels(val: number);
/**
* how often the values should be updated
*/
get framerate(): number;
set framerate(val: number);
/**
* cut off frequencies above this value
*/
get high_cutoff(): number;
set high_cutoff(val: number);
/**
* cut off frequencies above this value
*/
get highCutoff(): number;
set highCutoff(val: number);
/**
* specifies which audio server should be used.
*/
get input(): Input;
set input(val: Input);
/**
* cut off frequencies below this value
*/
get low_cutoff(): number;
set low_cutoff(val: number);
/**
* cut off frequencies below this value
*/
get lowCutoff(): number;
set lowCutoff(val: number);
/**
* adjusts the noise-reduction filter. low values are fast and noisy, large values are slow and
* smooth.
*/
get noise_reduction(): number;
set noise_reduction(val: number);
/**
* adjusts the noise-reduction filter. low values are fast and noisy, large values are slow and
* smooth.
*/
get noiseReduction(): number;
set noiseReduction(val: number);
/**
* the samplerate of the input
*/
get samplerate(): number;
set samplerate(val: number);
/**
* specifies which audio source should be used. Refer to the cava docs on how to use this
* property.
*/
get source(): string;
set source(val: string);
get stereo(): boolean;
set stereo(val: boolean);
/**
* A list of values, each represent the height of one bar. The values are generally between 0
* and 1 but can overshoot occasionally, in which case the sensitivity will be decreased
* automatically if [property`AstalCava`.Cava:autosens] is set. The array will have
* [property`AstalCava`.Cava:bars] entries. If [property`AstalCava`.Cava:stereo] is set, the first
* half of the array will represent the left channel and the second half the right channel, so
* there will be only bars/2 bars per channel. If the number of bars is odd, the last value will
* be 0.
*/
get values(): number[];
// Constructors
constructor(properties?: Partial<Cava.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Static methods
/**
* gets the default Cava object.
*/
static get_default(): Cava | null;
// Methods
get_active(): boolean;
get_autosens(): boolean;
get_bars(): number;
get_channels(): number;
get_framerate(): number;
get_high_cutoff(): number;
get_input(): Input;
get_low_cutoff(): number;
get_noise_reduction(): number;
get_samplerate(): number;
get_source(): string;
get_stereo(): boolean;
get_values(): number[];
set_active(active: boolean): void;
set_autosens(autosens: boolean): void;
set_bars(bars: number): void;
set_channels(channels: number): void;
set_framerate(framerate: number): void;
set_high_cutoff(high_cutoff: number): void;
set_input(input: Input | null): void;
set_low_cutoff(low_cutoff: number): void;
set_noise_reduction(noise: number): void;
set_samplerate(samplerate: number): void;
set_source(source: string): void;
set_stereo(stereo: boolean): void;
}
type CavaClass = typeof Cava;
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalCava;
}
declare module 'gi://AstalCava' {
import AstalCava01 from 'gi://AstalCava?version=0.1';
export default AstalCava01;
}
// END

View File

@@ -0,0 +1,533 @@
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalGreet?version=0.1' {
// Module dependencies
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalGreet {
/**
* AstalGreet-0.1
*/
export namespace ErrorType {
export const $gtype: GObject.GType<ErrorType>;
}
enum ErrorType {
/**
* Indicates that authentication failed. This is not a fatal error, and is likely caused by incorrect credentials.
*/
AUTH_ERROR,
/**
* A general error. See the error description for more information.
*/
ERROR,
}
export namespace AuthMessageType {
export const $gtype: GObject.GType<AuthMessageType>;
}
enum AuthMessageType {
/**
* Indicates that input from the user should be visible when they answer this question.
*/
VISIBLE,
/**
* Indicates that input from the user should be considered secret when they answer this question.
*/
SECRET,
/**
* Indicates that this message is informative, not a question.
*/
INFO,
/**
* Indicates that this message is an error, not a question.
*/
ERROR,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Shorthand for creating a session, posting the password, and starting the session with the given `cmd` which is parsed with [func@
* GLib.shell_parse_argv].
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
*/
function login(username: string, password: string, cmd: string): Promise<void>;
/**
* Shorthand for creating a session, posting the password, and starting the session with the given `cmd` which is parsed with [func@
* GLib.shell_parse_argv].
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param _callback_
*/
function login(
username: string,
password: string,
cmd: string,
_callback_: Gio.AsyncReadyCallback<string> | null,
): void;
/**
* Shorthand for creating a session, posting the password, and starting the session with the given `cmd` which is parsed with [func@
* GLib.shell_parse_argv].
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param _callback_
*/
function login(
username: string,
password: string,
cmd: string,
_callback_?: Gio.AsyncReadyCallback<string> | null,
): Promise<void> | void;
function login_finish(_res_: Gio.AsyncResult): void;
/**
* Same as [func`AstalGreet`.login] but allow for setting additonal env in the form of `name=value` pairs.
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param env Additonal env vars to set for the session
*/
function login_with_env(username: string, password: string, cmd: string, env: string[]): Promise<void>;
/**
* Same as [func`AstalGreet`.login] but allow for setting additonal env in the form of `name=value` pairs.
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param env Additonal env vars to set for the session
* @param _callback_
*/
function login_with_env(
username: string,
password: string,
cmd: string,
env: string[],
_callback_: Gio.AsyncReadyCallback<string> | null,
): void;
/**
* Same as [func`AstalGreet`.login] but allow for setting additonal env in the form of `name=value` pairs.
* @param username User to login to
* @param password Password of the user
* @param cmd Command to start the session with
* @param env Additonal env vars to set for the session
* @param _callback_
*/
function login_with_env(
username: string,
password: string,
cmd: string,
env: string[],
_callback_?: Gio.AsyncReadyCallback<string> | null,
): Promise<void> | void;
function login_with_env_finish(_res_: Gio.AsyncResult): void;
module Request {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
type_name: string;
typeName: string;
}
}
/**
* Base Request type.
*/
abstract class Request extends GObject.Object {
static $gtype: GObject.GType<Request>;
// Properties
get type_name(): string;
get typeName(): string;
// Constructors
constructor(properties?: Partial<Request.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Virtual methods
vfunc_get_type_name(): string;
// Methods
/**
* Send this request to greetd.
*/
send(): Promise<Response>;
/**
* Send this request to greetd.
* @param _callback_
*/
send(_callback_: Gio.AsyncReadyCallback<this> | null): void;
/**
* Send this request to greetd.
* @param _callback_
*/
send(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<Response> | void;
send_finish(_res_: Gio.AsyncResult): Response;
get_type_name(): string;
}
module CreateSession {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {
username: string;
}
}
/**
* Creates a session and initiates a login attempted for the given user. The session is ready to be started if a success is returned.
*/
class CreateSession extends Request {
static $gtype: GObject.GType<CreateSession>;
// Properties
get username(): string;
set username(val: string);
// Constructors
constructor(properties?: Partial<CreateSession.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](username: string): CreateSession;
// Methods
get_username(): string;
set_username(value: string): void;
}
module PostAuthMesssage {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {
response: string;
}
}
/**
* Answers an authentication message. If the message was informative (info, error), then a response does not need to be set in this
* message. The session is ready to be started if a success is returned.
*/
class PostAuthMesssage extends Request {
static $gtype: GObject.GType<PostAuthMesssage>;
// Properties
get response(): string;
set response(val: string);
// Constructors
constructor(properties?: Partial<PostAuthMesssage.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](response: string): PostAuthMesssage;
// Methods
get_response(): string;
set_response(value: string): void;
}
module StartSession {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {
cmd: string[];
env: string[];
}
}
/**
* Requests for the session to be started using the provided command line, adding the supplied environment to that created by PAM. The session
* will start after the greeter process terminates
*/
class StartSession extends Request {
static $gtype: GObject.GType<StartSession>;
// Properties
get cmd(): string[];
set cmd(val: string[]);
get env(): string[];
set env(val: string[]);
// Constructors
constructor(properties?: Partial<StartSession.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](cmd: string[], env: string[]): StartSession;
// Methods
get_cmd(): string[];
set_cmd(value: string[]): void;
get_env(): string[];
set_env(value: string[]): void;
}
module CancelSession {
// Constructor properties interface
interface ConstructorProps extends Request.ConstructorProps {}
}
/**
* Cancels the session that is currently under configuration.
*/
class CancelSession extends Request {
static $gtype: GObject.GType<CancelSession>;
// Constructors
constructor(properties?: Partial<CancelSession.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): CancelSession;
}
module Response {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Base Response type.
*/
abstract class Response extends GObject.Object {
static $gtype: GObject.GType<Response>;
// Constructors
constructor(properties?: Partial<Response.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
module Success {
// Constructor properties interface
interface ConstructorProps extends Response.ConstructorProps {}
}
/**
* Indicates that the request succeeded.
*/
class Success extends Response {
static $gtype: GObject.GType<Success>;
// Constructors
constructor(properties?: Partial<Success.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
}
module Error {
// Constructor properties interface
interface ConstructorProps extends Response.ConstructorProps {
error_type: ErrorType;
errorType: ErrorType;
description: string;
}
}
/**
* Indicates that the request succeeded.
*/
class Error extends Response {
static $gtype: GObject.GType<Error>;
// Properties
get error_type(): ErrorType;
set error_type(val: ErrorType);
get errorType(): ErrorType;
set errorType(val: ErrorType);
get description(): string;
set description(val: string);
// Constructors
constructor(properties?: Partial<Error.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_error_type(): ErrorType;
get_description(): string;
}
module AuthMessage {
// Constructor properties interface
interface ConstructorProps extends Response.ConstructorProps {
message_type: AuthMessageType;
messageType: AuthMessageType;
message: string;
}
}
/**
* Indicates that the request succeeded.
*/
class AuthMessage extends Response {
static $gtype: GObject.GType<AuthMessage>;
// Properties
get message_type(): AuthMessageType;
set message_type(val: AuthMessageType);
get messageType(): AuthMessageType;
set messageType(val: AuthMessageType);
get message(): string;
set message(val: string);
// Constructors
constructor(properties?: Partial<AuthMessage.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
// Methods
get_message_type(): AuthMessageType;
get_message(): string;
}
type RequestClass = typeof Request;
abstract class RequestPrivate {
static $gtype: GObject.GType<RequestPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CreateSessionClass = typeof CreateSession;
abstract class CreateSessionPrivate {
static $gtype: GObject.GType<CreateSessionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type PostAuthMesssageClass = typeof PostAuthMesssage;
abstract class PostAuthMesssagePrivate {
static $gtype: GObject.GType<PostAuthMesssagePrivate>;
// Constructors
_init(...args: any[]): void;
}
type StartSessionClass = typeof StartSession;
abstract class StartSessionPrivate {
static $gtype: GObject.GType<StartSessionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type CancelSessionClass = typeof CancelSession;
abstract class CancelSessionPrivate {
static $gtype: GObject.GType<CancelSessionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ResponseClass = typeof Response;
abstract class ResponsePrivate {
static $gtype: GObject.GType<ResponsePrivate>;
// Constructors
_init(...args: any[]): void;
}
type SuccessClass = typeof Success;
abstract class SuccessPrivate {
static $gtype: GObject.GType<SuccessPrivate>;
// Constructors
_init(...args: any[]): void;
}
type ErrorClass = typeof Error;
abstract class ErrorPrivate {
static $gtype: GObject.GType<ErrorPrivate>;
// Constructors
_init(...args: any[]): void;
}
type AuthMessageClass = typeof AuthMessage;
abstract class AuthMessagePrivate {
static $gtype: GObject.GType<AuthMessagePrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalGreet;
}
declare module 'gi://AstalGreet' {
import AstalGreet01 from 'gi://AstalGreet?version=0.1';
export default AstalGreet01;
}
// END

View File

@@ -0,0 +1,887 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gio-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/// <reference path="./gmodule-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalHyprland?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
export namespace AstalHyprland {
/**
* AstalHyprland-0.1
*/
export namespace MonitorTransform {
export const $gtype: GObject.GType<MonitorTransform>;
}
enum MonitorTransform {
NORMAL,
ROTATE_90_DEG,
ROTATE_180_DEG,
ROTATE_270_DEG,
FLIPPED,
FLIPPED_ROTATE_90_DEG,
FLIPPED_ROTATE_180_DEG,
FLIPPED_ROTATE_270_DEG,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
function get_default(): Hyprland;
export namespace Fullscreen {
export const $gtype: GObject.GType<Fullscreen>;
}
enum Fullscreen {
CURRENT,
NONE,
MAXIMIZED,
FULLSCREEN,
}
module Client {
// Signal callback interfaces
interface Removed {
(): void;
}
interface MovedTo {
(workspace: Workspace): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
address: string;
mapped: boolean;
hidden: boolean;
x: number;
y: number;
width: number;
height: number;
workspace: Workspace;
floating: boolean;
monitor: Monitor;
class: string;
title: string;
initial_class: string;
initialClass: string;
initial_title: string;
initialTitle: string;
pid: number;
xwayland: boolean;
pinned: boolean;
fullscreen: Fullscreen;
fullscreen_client: Fullscreen;
fullscreenClient: Fullscreen;
swallowing: string;
focus_history_id: number;
focusHistoryId: number;
}
}
class Client extends GObject.Object {
static $gtype: GObject.GType<Client>;
// Properties
get address(): string;
set address(val: string);
get mapped(): boolean;
set mapped(val: boolean);
get hidden(): boolean;
set hidden(val: boolean);
get x(): number;
set x(val: number);
get y(): number;
set y(val: number);
get width(): number;
set width(val: number);
get height(): number;
set height(val: number);
get workspace(): Workspace;
set workspace(val: Workspace);
get floating(): boolean;
set floating(val: boolean);
get monitor(): Monitor;
set monitor(val: Monitor);
get class(): string;
set class(val: string);
get title(): string;
set title(val: string);
get initial_class(): string;
set initial_class(val: string);
get initialClass(): string;
set initialClass(val: string);
get initial_title(): string;
set initial_title(val: string);
get initialTitle(): string;
set initialTitle(val: string);
get pid(): number;
set pid(val: number);
get xwayland(): boolean;
set xwayland(val: boolean);
get pinned(): boolean;
set pinned(val: boolean);
get fullscreen(): Fullscreen;
set fullscreen(val: Fullscreen);
get fullscreen_client(): Fullscreen;
set fullscreen_client(val: Fullscreen);
get fullscreenClient(): Fullscreen;
set fullscreenClient(val: Fullscreen);
get swallowing(): string;
set swallowing(val: string);
get focus_history_id(): number;
set focus_history_id(val: number);
get focusHistoryId(): number;
set focusHistoryId(val: number);
// Constructors
constructor(properties?: Partial<Client.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Client;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
connect(signal: 'moved-to', callback: (_source: this, workspace: Workspace) => void): number;
connect_after(signal: 'moved-to', callback: (_source: this, workspace: Workspace) => void): number;
emit(signal: 'moved-to', workspace: Workspace): void;
// Methods
kill(): void;
focus(): void;
move_to(ws: Workspace): void;
toggle_floating(): void;
get_address(): string;
get_mapped(): boolean;
get_hidden(): boolean;
get_x(): number;
get_y(): number;
get_width(): number;
get_height(): number;
get_workspace(): Workspace;
get_floating(): boolean;
get_monitor(): Monitor;
get_class(): string;
get_title(): string;
get_initial_class(): string;
get_initial_title(): string;
get_pid(): number;
get_xwayland(): boolean;
get_pinned(): boolean;
get_fullscreen(): Fullscreen;
get_fullscreen_client(): Fullscreen;
get_swallowing(): string;
get_focus_history_id(): number;
}
module Hyprland {
// Signal callback interfaces
interface Event {
(event: string, args: string): void;
}
interface Minimize {
(client: Client, minimize: boolean): void;
}
interface Floating {
(client: Client, floating: boolean): void;
}
interface Urgent {
(client: Client): void;
}
interface ClientMoved {
(client: Client, ws: Workspace): void;
}
interface Submap {
(name: string): void;
}
interface KeyboardLayout {
(keyboard: string, layout: string): void;
}
interface ConfigReloaded {
(): void;
}
interface ClientAdded {
(client: Client): void;
}
interface ClientRemoved {
(address: string): void;
}
interface WorkspaceAdded {
(workspace: Workspace): void;
}
interface WorkspaceRemoved {
(id: number): void;
}
interface MonitorAdded {
(monitor: Monitor): void;
}
interface MonitorRemoved {
(id: number): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
monitors: Monitor[];
workspaces: Workspace[];
clients: Client[];
focused_workspace: Workspace;
focusedWorkspace: Workspace;
focused_monitor: Monitor;
focusedMonitor: Monitor;
focused_client: Client;
focusedClient: Client;
binds: Bind[];
cursor_position: Position;
cursorPosition: Position;
}
}
class Hyprland extends GObject.Object {
static $gtype: GObject.GType<Hyprland>;
// Properties
get monitors(): Monitor[];
get workspaces(): Workspace[];
get clients(): Client[];
get focused_workspace(): Workspace;
set focused_workspace(val: Workspace);
get focusedWorkspace(): Workspace;
set focusedWorkspace(val: Workspace);
get focused_monitor(): Monitor;
set focused_monitor(val: Monitor);
get focusedMonitor(): Monitor;
set focusedMonitor(val: Monitor);
get focused_client(): Client;
set focused_client(val: Client);
get focusedClient(): Client;
set focusedClient(val: Client);
get binds(): Bind[];
get cursor_position(): Position;
get cursorPosition(): Position;
// Constructors
constructor(properties?: Partial<Hyprland.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Hyprland;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'event', callback: (_source: this, event: string, args: string) => void): number;
connect_after(signal: 'event', callback: (_source: this, event: string, args: string) => void): number;
emit(signal: 'event', event: string, args: string): void;
connect(signal: 'minimize', callback: (_source: this, client: Client, minimize: boolean) => void): number;
connect_after(
signal: 'minimize',
callback: (_source: this, client: Client, minimize: boolean) => void,
): number;
emit(signal: 'minimize', client: Client, minimize: boolean): void;
connect(signal: 'floating', callback: (_source: this, client: Client, floating: boolean) => void): number;
connect_after(
signal: 'floating',
callback: (_source: this, client: Client, floating: boolean) => void,
): number;
emit(signal: 'floating', client: Client, floating: boolean): void;
connect(signal: 'urgent', callback: (_source: this, client: Client) => void): number;
connect_after(signal: 'urgent', callback: (_source: this, client: Client) => void): number;
emit(signal: 'urgent', client: Client): void;
connect(signal: 'client-moved', callback: (_source: this, client: Client, ws: Workspace) => void): number;
connect_after(
signal: 'client-moved',
callback: (_source: this, client: Client, ws: Workspace) => void,
): number;
emit(signal: 'client-moved', client: Client, ws: Workspace): void;
connect(signal: 'submap', callback: (_source: this, name: string) => void): number;
connect_after(signal: 'submap', callback: (_source: this, name: string) => void): number;
emit(signal: 'submap', name: string): void;
connect(
signal: 'keyboard-layout',
callback: (_source: this, keyboard: string, layout: string) => void,
): number;
connect_after(
signal: 'keyboard-layout',
callback: (_source: this, keyboard: string, layout: string) => void,
): number;
emit(signal: 'keyboard-layout', keyboard: string, layout: string): void;
connect(signal: 'config-reloaded', callback: (_source: this) => void): number;
connect_after(signal: 'config-reloaded', callback: (_source: this) => void): number;
emit(signal: 'config-reloaded'): void;
connect(signal: 'client-added', callback: (_source: this, client: Client) => void): number;
connect_after(signal: 'client-added', callback: (_source: this, client: Client) => void): number;
emit(signal: 'client-added', client: Client): void;
connect(signal: 'client-removed', callback: (_source: this, address: string) => void): number;
connect_after(signal: 'client-removed', callback: (_source: this, address: string) => void): number;
emit(signal: 'client-removed', address: string): void;
connect(signal: 'workspace-added', callback: (_source: this, workspace: Workspace) => void): number;
connect_after(signal: 'workspace-added', callback: (_source: this, workspace: Workspace) => void): number;
emit(signal: 'workspace-added', workspace: Workspace): void;
connect(signal: 'workspace-removed', callback: (_source: this, id: number) => void): number;
connect_after(signal: 'workspace-removed', callback: (_source: this, id: number) => void): number;
emit(signal: 'workspace-removed', id: number): void;
connect(signal: 'monitor-added', callback: (_source: this, monitor: Monitor) => void): number;
connect_after(signal: 'monitor-added', callback: (_source: this, monitor: Monitor) => void): number;
emit(signal: 'monitor-added', monitor: Monitor): void;
connect(signal: 'monitor-removed', callback: (_source: this, id: number) => void): number;
connect_after(signal: 'monitor-removed', callback: (_source: this, id: number) => void): number;
emit(signal: 'monitor-removed', id: number): void;
// Static methods
static get_default(): Hyprland | null;
// Methods
get_monitor(id: number): Monitor;
get_workspace(id: number): Workspace;
get_client(address: string): Client | null;
get_monitor_by_name(name: string): Monitor | null;
get_workspace_by_name(name: string): Workspace | null;
message(message: string): string;
message_async(message: string): Promise<string>;
message_async(message: string, _callback_: Gio.AsyncReadyCallback<this> | null): void;
message_async(message: string, _callback_?: Gio.AsyncReadyCallback<this> | null): Promise<string> | void;
message_finish(_res_: Gio.AsyncResult): string;
dispatch(dispatcher: string, args: string): void;
move_cursor(x: number, y: number): void;
sync_monitors(): Promise<void>;
sync_monitors(_callback_: Gio.AsyncReadyCallback<this> | null): void;
sync_monitors(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
sync_monitors_finish(_res_: Gio.AsyncResult): void;
sync_workspaces(): Promise<void>;
sync_workspaces(_callback_: Gio.AsyncReadyCallback<this> | null): void;
sync_workspaces(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
sync_workspaces_finish(_res_: Gio.AsyncResult): void;
sync_clients(): Promise<void>;
sync_clients(_callback_: Gio.AsyncReadyCallback<this> | null): void;
sync_clients(_callback_?: Gio.AsyncReadyCallback<this> | null): Promise<void> | void;
sync_clients_finish(_res_: Gio.AsyncResult): void;
get_monitors(): Monitor[];
get_workspaces(): Workspace[];
get_clients(): Client[];
get_focused_workspace(): Workspace;
get_focused_monitor(): Monitor;
get_focused_client(): Client;
get_binds(): Bind[];
get_cursor_position(): Position;
}
module Monitor {
// Signal callback interfaces
interface Removed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: number;
name: string;
description: string;
make: string;
model: string;
serial: string;
width: number;
height: number;
refresh_rate: number;
refreshRate: number;
x: number;
y: number;
active_workspace: Workspace;
activeWorkspace: Workspace;
special_workspace: Workspace;
specialWorkspace: Workspace;
reserved_top: number;
reservedTop: number;
reserved_bottom: number;
reservedBottom: number;
reserved_left: number;
reservedLeft: number;
reserved_right: number;
reservedRight: number;
scale: number;
transform: MonitorTransform;
focused: boolean;
dpms_status: boolean;
dpmsStatus: boolean;
vrr: boolean;
actively_tearing: boolean;
activelyTearing: boolean;
disabled: boolean;
current_format: string;
currentFormat: string;
available_modes: string[];
availableModes: string[];
}
}
class Monitor extends GObject.Object {
static $gtype: GObject.GType<Monitor>;
// Properties
get id(): number;
set id(val: number);
get name(): string;
set name(val: string);
get description(): string;
set description(val: string);
get make(): string;
set make(val: string);
get model(): string;
set model(val: string);
get serial(): string;
set serial(val: string);
get width(): number;
set width(val: number);
get height(): number;
set height(val: number);
get refresh_rate(): number;
set refresh_rate(val: number);
get refreshRate(): number;
set refreshRate(val: number);
get x(): number;
set x(val: number);
get y(): number;
set y(val: number);
get active_workspace(): Workspace;
set active_workspace(val: Workspace);
get activeWorkspace(): Workspace;
set activeWorkspace(val: Workspace);
get special_workspace(): Workspace;
set special_workspace(val: Workspace);
get specialWorkspace(): Workspace;
set specialWorkspace(val: Workspace);
get reserved_top(): number;
set reserved_top(val: number);
get reservedTop(): number;
set reservedTop(val: number);
get reserved_bottom(): number;
set reserved_bottom(val: number);
get reservedBottom(): number;
set reservedBottom(val: number);
get reserved_left(): number;
set reserved_left(val: number);
get reservedLeft(): number;
set reservedLeft(val: number);
get reserved_right(): number;
set reserved_right(val: number);
get reservedRight(): number;
set reservedRight(val: number);
get scale(): number;
set scale(val: number);
get transform(): MonitorTransform;
set transform(val: MonitorTransform);
get focused(): boolean;
set focused(val: boolean);
get dpms_status(): boolean;
set dpms_status(val: boolean);
get dpmsStatus(): boolean;
set dpmsStatus(val: boolean);
get vrr(): boolean;
set vrr(val: boolean);
get actively_tearing(): boolean;
set actively_tearing(val: boolean);
get activelyTearing(): boolean;
set activelyTearing(val: boolean);
get disabled(): boolean;
set disabled(val: boolean);
get current_format(): string;
set current_format(val: string);
get currentFormat(): string;
set currentFormat(val: string);
get available_modes(): string[];
set available_modes(val: string[]);
get availableModes(): string[];
set availableModes(val: string[]);
// Constructors
constructor(properties?: Partial<Monitor.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Monitor;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
// Methods
focus(): void;
get_id(): number;
get_name(): string;
get_description(): string;
get_make(): string;
get_model(): string;
get_serial(): string;
get_width(): number;
get_height(): number;
get_refresh_rate(): number;
get_x(): number;
get_y(): number;
get_active_workspace(): Workspace;
get_special_workspace(): Workspace;
get_reserved_top(): number;
get_reserved_bottom(): number;
get_reserved_left(): number;
get_reserved_right(): number;
get_scale(): number;
get_transform(): MonitorTransform;
get_focused(): boolean;
get_dpms_status(): boolean;
get_vrr(): boolean;
get_actively_tearing(): boolean;
get_disabled(): boolean;
get_current_format(): string;
get_available_modes(): string[];
}
module Bind {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
locked: boolean;
mouse: boolean;
release: boolean;
repeat: boolean;
long_press: boolean;
longPress: boolean;
non_consuming: boolean;
nonConsuming: boolean;
has_description: boolean;
hasDescription: boolean;
modmask: number;
submap: string;
key: string;
keycode: number;
catch_all: boolean;
catchAll: boolean;
description: string;
dispatcher: string;
arg: string;
}
}
class Bind extends GObject.Object {
static $gtype: GObject.GType<Bind>;
// Properties
get locked(): boolean;
set locked(val: boolean);
get mouse(): boolean;
set mouse(val: boolean);
get release(): boolean;
set release(val: boolean);
get repeat(): boolean;
set repeat(val: boolean);
get long_press(): boolean;
set long_press(val: boolean);
get longPress(): boolean;
set longPress(val: boolean);
get non_consuming(): boolean;
set non_consuming(val: boolean);
get nonConsuming(): boolean;
set nonConsuming(val: boolean);
get has_description(): boolean;
set has_description(val: boolean);
get hasDescription(): boolean;
set hasDescription(val: boolean);
get modmask(): number;
set modmask(val: number);
get submap(): string;
set submap(val: string);
get key(): string;
set key(val: string);
get keycode(): number;
set keycode(val: number);
get catch_all(): boolean;
set catch_all(val: boolean);
get catchAll(): boolean;
set catchAll(val: boolean);
get description(): string;
set description(val: string);
get dispatcher(): string;
set dispatcher(val: string);
get arg(): string;
set arg(val: string);
// Constructors
constructor(properties?: Partial<Bind.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Bind;
// Methods
get_locked(): boolean;
set_locked(value: boolean): void;
get_mouse(): boolean;
set_mouse(value: boolean): void;
get_release(): boolean;
set_release(value: boolean): void;
get_repeat(): boolean;
set_repeat(value: boolean): void;
get_long_press(): boolean;
set_long_press(value: boolean): void;
get_non_consuming(): boolean;
set_non_consuming(value: boolean): void;
get_has_description(): boolean;
set_has_description(value: boolean): void;
get_modmask(): number;
set_modmask(value: number): void;
get_submap(): string;
set_submap(value: string): void;
get_key(): string;
set_key(value: string): void;
get_keycode(): number;
set_keycode(value: number): void;
get_catch_all(): boolean;
set_catch_all(value: boolean): void;
get_description(): string;
set_description(value: string): void;
get_dispatcher(): string;
set_dispatcher(value: string): void;
get_arg(): string;
set_arg(value: string): void;
}
module Position {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
x: number;
y: number;
}
}
class Position extends GObject.Object {
static $gtype: GObject.GType<Position>;
// Properties
get x(): number;
set x(val: number);
get y(): number;
set y(val: number);
// Constructors
constructor(properties?: Partial<Position.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Position;
// Methods
get_x(): number;
set_x(value: number): void;
get_y(): number;
set_y(value: number): void;
}
module Workspace {
// Signal callback interfaces
interface Removed {
(): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: number;
name: string;
monitor: Monitor;
clients: Client[];
has_fullscreen: boolean;
hasFullscreen: boolean;
last_client: Client;
lastClient: Client;
}
}
class Workspace extends GObject.Object {
static $gtype: GObject.GType<Workspace>;
// Properties
get id(): number;
set id(val: number);
get name(): string;
set name(val: string);
get monitor(): Monitor;
set monitor(val: Monitor);
get clients(): Client[];
get has_fullscreen(): boolean;
set has_fullscreen(val: boolean);
get hasFullscreen(): boolean;
set hasFullscreen(val: boolean);
get last_client(): Client;
set last_client(val: Client);
get lastClient(): Client;
set lastClient(val: Client);
// Constructors
constructor(properties?: Partial<Workspace.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static dummy(id: number, monitor?: Monitor | null): Workspace;
static ['new'](): Workspace;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'removed', callback: (_source: this) => void): number;
connect_after(signal: 'removed', callback: (_source: this) => void): number;
emit(signal: 'removed'): void;
// Methods
focus(): void;
move_to(m: Monitor): void;
get_id(): number;
get_name(): string;
get_monitor(): Monitor;
get_clients(): Client[];
get_has_fullscreen(): boolean;
get_last_client(): Client;
}
type ClientClass = typeof Client;
abstract class ClientPrivate {
static $gtype: GObject.GType<ClientPrivate>;
// Constructors
_init(...args: any[]): void;
}
type HyprlandClass = typeof Hyprland;
abstract class HyprlandPrivate {
static $gtype: GObject.GType<HyprlandPrivate>;
// Constructors
_init(...args: any[]): void;
}
type MonitorClass = typeof Monitor;
abstract class MonitorPrivate {
static $gtype: GObject.GType<MonitorPrivate>;
// Constructors
_init(...args: any[]): void;
}
type BindClass = typeof Bind;
abstract class BindPrivate {
static $gtype: GObject.GType<BindPrivate>;
// Constructors
_init(...args: any[]): void;
}
type PositionClass = typeof Position;
abstract class PositionPrivate {
static $gtype: GObject.GType<PositionPrivate>;
// Constructors
_init(...args: any[]): void;
}
type WorkspaceClass = typeof Workspace;
abstract class WorkspacePrivate {
static $gtype: GObject.GType<WorkspacePrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalHyprland;
}
declare module 'gi://AstalHyprland' {
import AstalHyprland01 from 'gi://AstalHyprland?version=0.1';
export default AstalHyprland01;
}
// END

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,651 @@
/// <reference path="./glib-2.0.d.ts" />
/// <reference path="./gobject-2.0.d.ts" />
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://AstalMpris?version=0.1' {
// Module dependencies
import type GLib from 'gi://GLib?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
export namespace AstalMpris {
/**
* AstalMpris-0.1
*/
export namespace PlaybackStatus {
export const $gtype: GObject.GType<PlaybackStatus>;
}
enum PlaybackStatus {
PLAYING,
PAUSED,
STOPPED,
}
export namespace Loop {
export const $gtype: GObject.GType<Loop>;
}
enum Loop {
UNSUPPORTED,
/**
* The playback will stop when there are no more tracks to play.
*/
NONE,
/**
* The current track will start again from the begining once it has finished playing.
*/
TRACK,
/**
* The playback loops through a list of tracks.
*/
PLAYLIST,
}
export namespace Shuffle {
export const $gtype: GObject.GType<Shuffle>;
}
enum Shuffle {
UNSUPPORTED,
/**
* Playback is progressing through a playlist in some other order.
*/
ON,
/**
* Playback is progressing linearly through a playlist.
*/
OFF,
}
const MAJOR_VERSION: number;
const MINOR_VERSION: number;
const MICRO_VERSION: number;
const VERSION: string;
/**
* Gets the default singleton Mpris instance.
*/
function get_default(): Mpris;
module Mpris {
// Signal callback interfaces
interface PlayerAdded {
(player: Player): void;
}
interface PlayerClosed {
(player: Player): void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
players: Player[];
}
}
/**
* Object that monitors dbus for players to appear and disappear.
*/
class Mpris extends GObject.Object {
static $gtype: GObject.GType<Mpris>;
// Properties
/**
* List of currently available players.
*/
get players(): Player[];
// Constructors
constructor(properties?: Partial<Mpris.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): Mpris;
// Signals
connect(id: string, callback: (...args: any[]) => any): number;
connect_after(id: string, callback: (...args: any[]) => any): number;
emit(id: string, ...args: any[]): void;
connect(signal: 'player-added', callback: (_source: this, player: Player) => void): number;
connect_after(signal: 'player-added', callback: (_source: this, player: Player) => void): number;
emit(signal: 'player-added', player: Player): void;
connect(signal: 'player-closed', callback: (_source: this, player: Player) => void): number;
connect_after(signal: 'player-closed', callback: (_source: this, player: Player) => void): number;
emit(signal: 'player-closed', player: Player): void;
// Static methods
/**
* Gets the default singleton Mpris instance.
*/
static get_default(): Mpris;
// Methods
get_players(): Player[];
}
module Player {
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
bus_name: string;
busName: string;
available: boolean;
can_quit: boolean;
canQuit: boolean;
fullscreen: boolean;
can_set_fullscreen: boolean;
canSetFullscreen: boolean;
can_raise: boolean;
canRaise: boolean;
identity: string;
entry: string;
supported_uri_schemes: string[];
supportedUriSchemes: string[];
supported_mime_types: string[];
supportedMimeTypes: string[];
loop_status: Loop;
loopStatus: Loop;
rate: number;
shuffle_status: Shuffle;
shuffleStatus: Shuffle;
volume: number;
position: number;
playback_status: PlaybackStatus;
playbackStatus: PlaybackStatus;
minimum_rate: number;
minimumRate: number;
maximum_rate: number;
maximumRate: number;
can_go_next: boolean;
canGoNext: boolean;
can_go_previous: boolean;
canGoPrevious: boolean;
can_play: boolean;
canPlay: boolean;
can_pause: boolean;
canPause: boolean;
can_seek: boolean;
canSeek: boolean;
can_control: boolean;
canControl: boolean;
metadata: GLib.HashTable<string, GLib.Variant>;
trackid: string;
length: number;
art_url: string;
artUrl: string;
album: string;
album_artist: string;
albumArtist: string;
artist: string;
lyrics: string;
title: string;
composer: string;
comments: string;
cover_art: string;
coverArt: string;
}
}
/**
* Object which tracks players through their mpris dbus interface. The most simple way is to use [class`AstalMpris`.Mpris] which tracks
* every player, but [class`AstalMpris`.Player] can be constructed for a dedicated players too.
*/
class Player extends GObject.Object {
static $gtype: GObject.GType<Player>;
// Properties
/**
* Full dbus namae of this player.
*/
get bus_name(): string;
set bus_name(val: string);
/**
* Full dbus namae of this player.
*/
get busName(): string;
set busName(val: string);
/**
* Indicates if [property`AstalMpris`.Player:bus_name] is available on dbus.
*/
get available(): boolean;
set available(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.quit] has any effect.
*/
get can_quit(): boolean;
set can_quit(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.quit] has any effect.
*/
get canQuit(): boolean;
set canQuit(val: boolean);
/**
* Indicates if the player is occupying the fullscreen. This is typically used for videos. Use [method`AstalMpris`.Player.toggle_fullscreen]
* to toggle fullscreen state.
*/
get fullscreen(): boolean;
set fullscreen(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.toggle_fullscreen] has any effect.
*/
get can_set_fullscreen(): boolean;
set can_set_fullscreen(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.toggle_fullscreen] has any effect.
*/
get canSetFullscreen(): boolean;
set canSetFullscreen(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.raise] has any effect.
*/
get can_raise(): boolean;
set can_raise(val: boolean);
/**
* Indicates if [method`AstalMpris`.Player.raise] has any effect.
*/
get canRaise(): boolean;
set canRaise(val: boolean);
/**
* A human friendly name to identify the player.
*/
get identity(): string;
set identity(val: string);
/**
* The base name of a .desktop file
*/
get entry(): string;
set entry(val: string);
/**
* The URI schemes supported by the media player.
* This can be viewed as protocols supported by the player in almost all cases. Almost every media player will include support for the "file
* " scheme. Other common schemes are "http" and "rtsp".
*/
get supported_uri_schemes(): string[];
set supported_uri_schemes(val: string[]);
/**
* The URI schemes supported by the media player.
* This can be viewed as protocols supported by the player in almost all cases. Almost every media player will include support for the "file
* " scheme. Other common schemes are "http" and "rtsp".
*/
get supportedUriSchemes(): string[];
set supportedUriSchemes(val: string[]);
/**
* The mime-types supported by the player.
*/
get supported_mime_types(): string[];
set supported_mime_types(val: string[]);
/**
* The mime-types supported by the player.
*/
get supportedMimeTypes(): string[];
set supportedMimeTypes(val: string[]);
/**
* The current loop/repeat status.
*/
get loop_status(): Loop;
set loop_status(val: Loop);
/**
* The current loop/repeat status.
*/
get loopStatus(): Loop;
set loopStatus(val: Loop);
/**
* The current playback rate.
*/
get rate(): number;
set rate(val: number);
/**
* The current shuffle status.
*/
get shuffle_status(): Shuffle;
set shuffle_status(val: Shuffle);
/**
* The current shuffle status.
*/
get shuffleStatus(): Shuffle;
set shuffleStatus(val: Shuffle);
/**
* The current volume level between 0 and 1.
*/
get volume(): number;
set volume(val: number);
/**
* The current position of the track in seconds. To get a progress percentage simply divide this with [property`AstalMpris`.Player:length].
*/
get position(): number;
set position(val: number);
/**
* The current playback status.
*/
get playback_status(): PlaybackStatus;
set playback_status(val: PlaybackStatus);
/**
* The current playback status.
*/
get playbackStatus(): PlaybackStatus;
set playbackStatus(val: PlaybackStatus);
/**
* The minimum value which the [property`AstalMpris`.Player:rate] can take.
*/
get minimum_rate(): number;
set minimum_rate(val: number);
/**
* The minimum value which the [property`AstalMpris`.Player:rate] can take.
*/
get minimumRate(): number;
set minimumRate(val: number);
/**
* The maximum value which the [property`AstalMpris`.Player:rate] can take.
*/
get maximum_rate(): number;
set maximum_rate(val: number);
/**
* The maximum value which the [property`AstalMpris`.Player:rate] can take.
*/
get maximumRate(): number;
set maximumRate(val: number);
/**
* Indicates if invoking [method`AstalMpris`.Player.next] has effect.
*/
get can_go_next(): boolean;
set can_go_next(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.next] has effect.
*/
get canGoNext(): boolean;
set canGoNext(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.previous] has effect.
*/
get can_go_previous(): boolean;
set can_go_previous(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.previous] has effect.
*/
get canGoPrevious(): boolean;
set canGoPrevious(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.play] has effect.
*/
get can_play(): boolean;
set can_play(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.play] has effect.
*/
get canPlay(): boolean;
set canPlay(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.pause] has effect.
*/
get can_pause(): boolean;
set can_pause(val: boolean);
/**
* Indicates if invoking [method`AstalMpris`.Player.pause] has effect.
*/
get canPause(): boolean;
set canPause(val: boolean);
/**
* Indicates if setting [property`AstalMpris`.Player:position] has effect.
*/
get can_seek(): boolean;
set can_seek(val: boolean);
/**
* Indicates if setting [property`AstalMpris`.Player:position] has effect.
*/
get canSeek(): boolean;
set canSeek(val: boolean);
/**
* Indicates if the player can be controlled with methods such as [method`AstalMpris`.Player.play_pause].
*/
get can_control(): boolean;
set can_control(val: boolean);
/**
* Indicates if the player can be controlled with methods such as [method`AstalMpris`.Player.play_pause].
*/
get canControl(): boolean;
set canControl(val: boolean);
/**
* Metadata hashtable of this player. In languages that cannot introspect this use [method`AstalMpris`.Player.get_meta].
*/
get metadata(): GLib.HashTable<string, GLib.Variant>;
set metadata(val: GLib.HashTable<string, GLib.Variant>);
/**
* Currently playing track's id.
*/
get trackid(): string;
set trackid(val: string);
/**
* Length of the currently playing track in seconds.
*/
get length(): number;
set length(val: number);
/**
* The location of an image representing the track or album. You should always prefer to use [property`AstalMpris`.Player:cover_art].
*/
get art_url(): string;
set art_url(val: string);
/**
* The location of an image representing the track or album. You should always prefer to use [property`AstalMpris`.Player:cover_art].
*/
get artUrl(): string;
set artUrl(val: string);
/**
* Title of the currently playing album.
*/
get album(): string;
set album(val: string);
/**
* Artists of the currently playing album.
*/
get album_artist(): string;
set album_artist(val: string);
/**
* Artists of the currently playing album.
*/
get albumArtist(): string;
set albumArtist(val: string);
/**
* Artists of the currently playing track.
*/
get artist(): string;
set artist(val: string);
/**
* Lyrics of the currently playing track.
*/
get lyrics(): string;
set lyrics(val: string);
/**
* Title of the currently playing track.
*/
get title(): string;
set title(val: string);
/**
* Composers of the currently playing track.
*/
get composer(): string;
set composer(val: string);
/**
* Comments of the currently playing track.
*/
get comments(): string;
set comments(val: string);
/**
* Path of the cached [property`AstalMpris`.Player:art_url].
*/
get cover_art(): string;
set cover_art(val: string);
/**
* Path of the cached [property`AstalMpris`.Player:art_url].
*/
get coverArt(): string;
set coverArt(val: string);
// Constructors
constructor(properties?: Partial<Player.ConstructorProps>, ...args: any[]);
_init(...args: any[]): void;
static ['new'](name: string): Player;
// Methods
/**
* Brings the player's user interface to the front using any appropriate mechanism available.
* The media player may be unable to control how its user interface is displayed, or it may not have a graphical user interface at all. In this
* case, the [property`AstalMpris`.Player:can_raise] is `false` and this method does nothing.
*/
raise(): void;
/**
* Causes the media player to stop running.
* The media player may refuse to allow clients to shut it down. In this case, the [property`AstalMpris`.Player:can_quit] property is false
* and this method does nothing.
*/
quit(): void;
/**
* Toggle [property`AstalMpris`.Player:fullscreen] state.
*/
toggle_fullscreen(): void;
/**
* Skips to the next track in the tracklist. If there is no next track (and endless playback and track repeat are both off), stop
* playback. If [property`AstalMpris`.Player:can_go_next] is `false` this method has no effect.
*/
next(): void;
/**
* Skips to the previous track in the tracklist. If there is no previous track (and endless playback and track repeat are both off),
* stop playback. If [property`AstalMpris`.Player:can_go_previous] is `false` this method has no effect.
*/
previous(): void;
/**
* Pauses playback. If playback is already paused, this has no effect. If [property`AstalMpris`.Player:can_pause] is `false` this method has
* no effect.
*/
pause(): void;
/**
* Pauses playback. If playback is already paused, resumes playback. If playback is stopped, starts playback.
*/
play_pause(): void;
/**
* Stops playback. If playback is already stopped, this has no effect. If [property`AstalMpris`.Player:can_control] is `false` this method
* has no effect.
*/
stop(): void;
/**
* Starts or resumes playback. If already playing, this has no effect. If paused, playback resumes from the current position. If [property@
* AstalMpris.Player:can_play] is `false` this method has no effect.
*/
play(): void;
/**
* uri scheme should be an element of [property`AstalMpris`.Player:supported_uri_schemes] and the mime-type should match one of the elements
* of [property`AstalMpris`.Player:supported_mime_types].
* @param uri Uri of the track to load.
*/
open_uri(uri: string): void;
/**
* Change [property`AstalMpris`.Player:loop_status] from none to track, from track to playlist, from playlist to none.
*/
loop(): void;
/**
* Toggle [property`AstalMpris`.Player:shuffle_status].
*/
shuffle(): void;
/**
* Lookup a key from [property`AstalMpris`.Player:metadata]. This method is useful for languages that fail to introspect hashtables.
* @param key
*/
get_meta(key: string): GLib.Variant | null;
get_bus_name(): string;
get_available(): boolean;
get_can_quit(): boolean;
get_fullscreen(): boolean;
get_can_set_fullscreen(): boolean;
get_can_raise(): boolean;
get_identity(): string;
get_entry(): string;
get_supported_uri_schemes(): string[];
get_supported_mime_types(): string[];
get_loop_status(): Loop;
set_loop_status(value: Loop | null): void;
get_rate(): number;
set_rate(value: number): void;
get_shuffle_status(): Shuffle;
set_shuffle_status(value: Shuffle | null): void;
get_volume(): number;
set_volume(value: number): void;
get_position(): number;
set_position(value: number): void;
get_playback_status(): PlaybackStatus;
get_minimum_rate(): number;
get_maximum_rate(): number;
get_can_go_next(): boolean;
get_can_go_previous(): boolean;
get_can_play(): boolean;
get_can_pause(): boolean;
get_can_seek(): boolean;
get_can_control(): boolean;
get_metadata(): GLib.HashTable<string, GLib.Variant>;
get_trackid(): string;
get_length(): number;
get_art_url(): string;
get_album(): string;
get_album_artist(): string;
get_artist(): string;
get_lyrics(): string;
get_title(): string;
get_composer(): string;
get_comments(): string;
get_cover_art(): string;
}
type MprisClass = typeof Mpris;
abstract class MprisPrivate {
static $gtype: GObject.GType<MprisPrivate>;
// Constructors
_init(...args: any[]): void;
}
type PlayerClass = typeof Player;
abstract class PlayerPrivate {
static $gtype: GObject.GType<PlayerPrivate>;
// Constructors
_init(...args: any[]): void;
}
/**
* Name of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
*/
const __name__: string;
/**
* Version of the imported GIR library
* `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
*/
const __version__: string;
}
export default AstalMpris;
}
declare module 'gi://AstalMpris' {
import AstalMpris01 from 'gi://AstalMpris?version=0.1';
export default AstalMpris01;
}
// END

Some files were not shown because too many files have changed in this diff Show More