tangled
alpha
login
or
join now
isabelroses.com
/
dotfiles
12
fork
atom
my over complex system configurations
dotfiles.isabelroses.com/
nixos
nix
flake
dotfiles
linux
12
fork
atom
overview
issues
pulls
pipelines
style: formating
isabelroses.com
2 years ago
6bb295e8
be2bf7ed
+7621
-7840
127 changed files
expand all
collapse all
unified
split
.editorconfig
flake
templates
node
package.json
tsconfig.json
home
isabel
programs
configs
editors
vscode
keybindings.json
settings.json
gui
bars
ags
config
config.js
icons.js
misc
Avatar.js
BatteryIcon.js
Clock.js
FontIcon.js
HoverRevealer.js
IconBrowser.js
Notification.js
OSD.js
PopupWindow.js
Progress.js
Spinner.js
mpris.js
options.js
scss
common
button.scss
floating-widget.scss
hidden.scss
menu.scss
scrollable.scss
slider.scss
spacing.scss
switch.scss
text-border.scss
tooltip.scss
unset.scss
widget.scss
variables.scss
widgets
applauncher.scss
bar.scss
dashboard.scss
desktop.scss
media.scss
notifications.scss
osd.scss
powermenu.scss
quicksettings.scss
settings.scss
services
brightness.js
colorpicker.js
onScreenIndicator.js
powermenu.js
settings
SettingsDialog.js
globals.js
hyprland.js
option.js
scss.js
setup.js
theme.js
wallpaper.js
themes.js
utils.js
variables.js
windows
applauncher
AppItem.js
Applauncher.js
bar
LeftBar.js
PanelButton.js
TopBar.js
buttons
ApplauncherButton.js
BatteryBar.js
ColorPicker.js
DateButton.js
MediaIndicator.js
NotificationIndicator.js
PowerMenu.js
SubMenu.js
SysTray.js
SystemIndicators.js
Workspaces.js
dashboard
Dashboard.js
DateColumn.js
NotificationColumn.js
notifications
Notifications.js
powermenu
PowerMenu.js
ShadedPopup.js
quicksettings
QuickSettings.js
ToggleButton.js
widgets
Bluetooth.js
Brightness.js
DND.js
Header.js
Media.js
MicMute.js
Network.js
Theme.js
Volume.js
eww
config
eww.scss
scripts
host
apps.js
battery.js
bluetooth.js
dbus.js
lib.js
main.js
media.js
network.js
notifications.js
todo
scss
common.scss
variables.scss
widgets
bar_widget.scss
calendar.scss
events.scss
media.scss
notification.scss
sys_sliders.scss
toggle_button.scss
user.scss
weather.scss
windows
app_laucher.scss
datemenu.scss
desktop.scss
dock.scss
hbar.scss
media.scss
noti_center.scss
notifications.scss
osd.scss
powermenu.scss
quicksettings.scss
screenshot.scss
vbar.scss
modules
base
common
services
monitoring
grafana
dashboards
uptime-02.json
+5
-27
.editorconfig
···
3
3
[*]
4
4
charset = utf-8
5
5
end_of_line = lf
6
6
-
indent_style = tab
7
7
-
indent_size = 4
8
8
-
insert_final_newline = true
9
9
-
tab_width = 4
10
10
-
trim_trailing_whitespace = false
11
11
-
12
12
-
[*.md]
13
6
indent_style = space
14
7
indent_size = 2
8
8
+
insert_final_newline = true
9
9
+
tab_width = 4
15
10
trim_trailing_whitespace = false
16
11
17
17
-
[*.{nix,yml,yaml}]
18
18
-
indent_style = space
19
19
-
indent_size = 2
20
20
-
tab_width = 2
21
21
-
22
22
-
[*.yuck]
23
23
-
indent_style = spaces
24
24
-
indent_size = 4
25
25
-
26
26
-
[*.{js, sh}]
27
27
-
indent_style = spaces
28
28
-
indent_size = 2
29
29
-
30
30
-
[*.{diff,patch}]
12
12
+
[*.{diff,patch,lock}]
13
13
+
indent_size = unset
14
14
+
indent_size = unset
31
15
end_of_line = unset
32
16
insert_final_newline = unset
33
17
trim_trailing_whitespace = unset
34
34
-
35
35
-
[secrets.yaml]
36
36
-
indent_size = unset
37
37
-
38
38
-
[*.lock]
39
39
-
indent_size = unset
+17
-17
flake/templates/node/package.json
···
1
1
{
2
2
-
"name": "sample-nodejs",
3
3
-
"version": "0.0.1",
4
4
-
"description": "Sample node program",
5
5
-
"bin": {
6
6
-
"sample-node": "build/index.js"
7
7
-
},
8
8
-
"scripts": {
9
9
-
"build": "tsc",
10
10
-
"start": "npm run build && node build/index.js"
11
11
-
},
12
12
-
"author": "NotAShelf",
13
13
-
"license": "MIT",
14
14
-
"devDependencies": {
15
15
-
"@types/node": "^20.1.2",
16
16
-
"typescript": "^5.0.4",
17
17
-
"typescript-language-server": "^3.3.2"
18
18
-
}
2
2
+
"name": "sample-nodejs",
3
3
+
"version": "0.0.1",
4
4
+
"description": "Sample node program",
5
5
+
"bin": {
6
6
+
"sample-node": "build/index.js"
7
7
+
},
8
8
+
"scripts": {
9
9
+
"build": "tsc",
10
10
+
"start": "npm run build && node build/index.js"
11
11
+
},
12
12
+
"author": "NotAShelf",
13
13
+
"license": "MIT",
14
14
+
"devDependencies": {
15
15
+
"@types/node": "^20.1.2",
16
16
+
"typescript": "^5.0.4",
17
17
+
"typescript-language-server": "^3.3.2"
18
18
+
}
19
19
}
+14
-14
flake/templates/node/tsconfig.json
···
1
1
{
2
2
-
"compilerOptions": {
3
3
-
"target": "es2016",
4
4
-
"lib": ["es6"],
5
5
-
"module": "commonjs",
6
6
-
"rootDir": "src",
7
7
-
"resolveJsonModule": true,
8
8
-
"allowJs": true,
9
9
-
"outDir": "build",
10
10
-
"esModuleInterop": true,
11
11
-
"forceConsistentCasingInFileNames": true,
12
12
-
"strict": true,
13
13
-
"noImplicitAny": true,
14
14
-
"skipLibCheck": true
15
15
-
}
2
2
+
"compilerOptions": {
3
3
+
"target": "es2016",
4
4
+
"lib": ["es6"],
5
5
+
"module": "commonjs",
6
6
+
"rootDir": "src",
7
7
+
"resolveJsonModule": true,
8
8
+
"allowJs": true,
9
9
+
"outDir": "build",
10
10
+
"esModuleInterop": true,
11
11
+
"forceConsistentCasingInFileNames": true,
12
12
+
"strict": true,
13
13
+
"noImplicitAny": true,
14
14
+
"skipLibCheck": true
15
15
+
}
16
16
}
+14
-14
home/isabel/programs/configs/editors/vscode/keybindings.json
···
1
1
[
2
2
-
{
3
3
-
"key": "ctrl+alt+up",
4
4
-
"command": "-editor.action.copyLinesUpAction",
5
5
-
"when": "editorTextFocus"
6
6
-
},
7
7
-
{
8
8
-
"key": "ctrl+alt+down",
9
9
-
"command": "-editor.action.copyLinesDownAction",
10
10
-
"when": "editorTextFocus"
11
11
-
},
12
12
-
{
13
13
-
"key": "ctrl+m",
14
14
-
"command": "-editor.action.toggleTabFocusMode"
15
15
-
}
2
2
+
{
3
3
+
"key": "ctrl+alt+up",
4
4
+
"command": "-editor.action.copyLinesUpAction",
5
5
+
"when": "editorTextFocus"
6
6
+
},
7
7
+
{
8
8
+
"key": "ctrl+alt+down",
9
9
+
"command": "-editor.action.copyLinesDownAction",
10
10
+
"when": "editorTextFocus"
11
11
+
},
12
12
+
{
13
13
+
"key": "ctrl+m",
14
14
+
"command": "-editor.action.toggleTabFocusMode"
15
15
+
}
16
16
]
+48
-48
home/isabel/programs/configs/editors/vscode/settings.json
···
1
1
{
2
2
-
"security.workspace.trust.untrustedFiles": "open",
3
3
-
"editor.suggestSelection": "first",
4
4
-
"editor.formatOnPaste": true,
5
5
-
"explorer.confirmDragAndDrop": false,
6
6
-
"files.autoSave": "onWindowChange",
7
7
-
"editor.multiCursorModifier": "ctrlCmd",
8
8
-
"git.autofetch": true,
9
9
-
"git.confirmSync": false,
10
10
-
"git.ignoreRebaseWarning": true,
11
11
-
"git.enableSmartCommit": true,
12
12
-
"editor.guides.bracketPairs": true,
13
13
-
"editor.guides.bracketPairsHorizontal": true,
14
14
-
"emmet.triggerExpansionOnTab": true,
15
15
-
"editor.inlineSuggest.enabled": true,
16
16
-
"github.copilot.enable": {
17
17
-
"*": true
18
18
-
},
19
19
-
"editor.accessibilitySupport": "off",
20
20
-
"editor.fontFamily": "JetBrainsMono Nerd Font Mono",
21
21
-
"terminal.integrated.fontSize": 16,
22
22
-
"editor.linkedEditing": true,
23
23
-
"workbench.startupEditor": "none",
24
24
-
"markdown-preview-enhanced.liveUpdate": true,
25
25
-
"editor.formatOnSave": true,
26
26
-
"explorer.confirmDelete": false,
27
27
-
"workbench.settings.applyToAllProfiles": [],
28
28
-
"workbench.iconTheme": "catppuccin-mocha",
29
29
-
"window.titleBarStyle": "custom",
30
30
-
"nix.enableLanguageServer": true,
31
31
-
"nix.serverPath": "nil",
32
32
-
// using flakes with `formatter = pkgs.alejandra;`
33
33
-
"nix.formatterPath": ["nix", "fmt", "--", "-"],
34
34
-
"nix.serverSettings": {
35
35
-
// settings for 'nil' LSP
36
36
-
"nil": {
37
37
-
"formatting": {
38
38
-
"command": ["alejandra"]
39
39
-
}
40
40
-
}
41
41
-
},
42
42
-
"workbench.editor.empty.hint": "hidden",
43
43
-
"arduino.useArduinoCli": true,
44
44
-
"arduino.enableUSBDetection": true,
45
45
-
"[css]": {
46
46
-
"editor.defaultFormatter": "stylelint.vscode-stylelint"
47
47
-
},
48
48
-
"workbench.colorTheme": "Catppuccin Mocha",
49
49
-
"catppuccin.accentColor": "sapphire"
2
2
+
"security.workspace.trust.untrustedFiles": "open",
3
3
+
"editor.suggestSelection": "first",
4
4
+
"editor.formatOnPaste": true,
5
5
+
"explorer.confirmDragAndDrop": false,
6
6
+
"files.autoSave": "onWindowChange",
7
7
+
"editor.multiCursorModifier": "ctrlCmd",
8
8
+
"git.autofetch": true,
9
9
+
"git.confirmSync": false,
10
10
+
"git.ignoreRebaseWarning": true,
11
11
+
"git.enableSmartCommit": true,
12
12
+
"editor.guides.bracketPairs": true,
13
13
+
"editor.guides.bracketPairsHorizontal": true,
14
14
+
"emmet.triggerExpansionOnTab": true,
15
15
+
"editor.inlineSuggest.enabled": true,
16
16
+
"github.copilot.enable": {
17
17
+
"*": true
18
18
+
},
19
19
+
"editor.accessibilitySupport": "off",
20
20
+
"editor.fontFamily": "JetBrainsMono Nerd Font Mono",
21
21
+
"terminal.integrated.fontSize": 16,
22
22
+
"editor.linkedEditing": true,
23
23
+
"workbench.startupEditor": "none",
24
24
+
"markdown-preview-enhanced.liveUpdate": true,
25
25
+
"editor.formatOnSave": true,
26
26
+
"explorer.confirmDelete": false,
27
27
+
"workbench.settings.applyToAllProfiles": [],
28
28
+
"workbench.iconTheme": "catppuccin-mocha",
29
29
+
"window.titleBarStyle": "custom",
30
30
+
"nix.enableLanguageServer": true,
31
31
+
"nix.serverPath": "nil",
32
32
+
// using flakes with `formatter = pkgs.alejandra;`
33
33
+
"nix.formatterPath": ["nix", "fmt", "--", "-"],
34
34
+
"nix.serverSettings": {
35
35
+
// settings for 'nil' LSP
36
36
+
"nil": {
37
37
+
"formatting": {
38
38
+
"command": ["alejandra"]
39
39
+
}
40
40
+
}
41
41
+
},
42
42
+
"workbench.editor.empty.hint": "hidden",
43
43
+
"arduino.useArduinoCli": true,
44
44
+
"arduino.enableUSBDetection": true,
45
45
+
"[css]": {
46
46
+
"editor.defaultFormatter": "stylelint.vscode-stylelint"
47
47
+
},
48
48
+
"workbench.colorTheme": "Catppuccin Mocha",
49
49
+
"catppuccin.accentColor": "sapphire"
50
50
}
+16
-16
home/isabel/programs/configs/gui/bars/ags/config/config.js
···
14
14
initWallpaper();
15
15
16
16
const windows = () => [
17
17
-
forMonitors(TopBar),
18
18
-
// forMonitors(LeftBar),
19
19
-
forMonitors(OSD),
20
20
-
forMonitors(Notifications),
21
21
-
Applauncher(),
22
22
-
Dashboard(),
23
23
-
QuickSettings(),
24
24
-
PowerMenu(),
17
17
+
forMonitors(TopBar),
18
18
+
// forMonitors(LeftBar),
19
19
+
forMonitors(OSD),
20
20
+
forMonitors(Notifications),
21
21
+
Applauncher(),
22
22
+
Dashboard(),
23
23
+
QuickSettings(),
24
24
+
PowerMenu(),
25
25
];
26
26
27
27
export default {
28
28
-
onConfigParsed: init,
29
29
-
windows: windows().flat(1),
30
30
-
maxStreamVolume: 1.05,
31
31
-
cacheNotificationActions: true,
32
32
-
closeWindowDelay: {
33
33
-
quicksettings: options.transition.value,
34
34
-
dashboard: options.transition.value,
35
35
-
},
28
28
+
onConfigParsed: init,
29
29
+
windows: windows().flat(1),
30
30
+
maxStreamVolume: 1.05,
31
31
+
cacheNotificationActions: true,
32
32
+
closeWindowDelay: {
33
33
+
quicksettings: options.transition.value,
34
34
+
dashboard: options.transition.value,
35
35
+
},
36
36
};
+111
-111
home/isabel/programs/configs/gui/bars/ags/config/icons.js
···
1
1
export default {
2
2
-
lock: "system-lock-screen-symbolic",
3
3
-
fallback: {
4
4
-
executable: "application-x-executable-symbolic",
2
2
+
lock: "system-lock-screen-symbolic",
3
3
+
fallback: {
4
4
+
executable: "application-x-executable-symbolic",
5
5
+
},
6
6
+
audio: {
7
7
+
mic: {
8
8
+
muted: "microphone-disabled-symbolic",
9
9
+
low: "microphone-sensitivity-low-symbolic",
10
10
+
medium: "microphone-sensitivity-medium-symbolic",
11
11
+
high: "microphone-sensitivity-high-symbolic",
5
12
},
6
6
-
audio: {
7
7
-
mic: {
8
8
-
muted: "microphone-disabled-symbolic",
9
9
-
low: "microphone-sensitivity-low-symbolic",
10
10
-
medium: "microphone-sensitivity-medium-symbolic",
11
11
-
high: "microphone-sensitivity-high-symbolic",
12
12
-
},
13
13
-
volume: {
14
14
-
muted: "audio-volume-muted-symbolic",
15
15
-
low: "audio-volume-low-symbolic",
16
16
-
medium: "audio-volume-medium-symbolic",
17
17
-
high: "audio-volume-high-symbolic",
18
18
-
overamplified: "audio-volume-overamplified-symbolic",
19
19
-
},
20
20
-
type: {
21
21
-
headset: "audio-headphones-symbolic",
22
22
-
speaker: "audio-speakers-symbolic",
23
23
-
card: "audio-card-symbolic",
24
24
-
},
25
25
-
mixer: "",
13
13
+
volume: {
14
14
+
muted: "audio-volume-muted-symbolic",
15
15
+
low: "audio-volume-low-symbolic",
16
16
+
medium: "audio-volume-medium-symbolic",
17
17
+
high: "audio-volume-high-symbolic",
18
18
+
overamplified: "audio-volume-overamplified-symbolic",
26
19
},
27
27
-
asusctl: {
28
28
-
profile: {
29
29
-
Balanced: "power-profile-balanced-symbolic",
30
30
-
Quiet: "power-profile-power-saver-symbolic",
31
31
-
Performance: "power-profile-performance-symbolic",
32
32
-
},
33
33
-
mode: {
34
34
-
Integrated: "",
35
35
-
Hybrid: "",
36
36
-
},
20
20
+
type: {
21
21
+
headset: "audio-headphones-symbolic",
22
22
+
speaker: "audio-speakers-symbolic",
23
23
+
card: "audio-card-symbolic",
37
24
},
38
38
-
apps: {
39
39
-
apps: "view-app-grid-symbolic",
40
40
-
search: "folder-saved-search-symbolic",
41
41
-
},
42
42
-
battery: {
43
43
-
charging: "",
44
44
-
warning: "battery-empty-symbolic",
45
45
-
},
46
46
-
bluetooth: {
47
47
-
enabled: "bluetooth-active-symbolic",
48
48
-
disabled: "bluetooth-disabled-symbolic",
49
49
-
},
50
50
-
brightness: {
51
51
-
indicator: "display-brightness-symbolic",
52
52
-
keyboard: "keyboard-brightness-symbolic",
53
53
-
screen: "display-brightness-symbolic",
54
54
-
},
55
55
-
powermenu: {
56
56
-
sleep: "weather-clear-night-symbolic",
57
57
-
reboot: "system-reboot-symbolic",
58
58
-
logout: "system-log-out-symbolic",
59
59
-
shutdown: "system-shutdown-symbolic",
25
25
+
mixer: "",
26
26
+
},
27
27
+
asusctl: {
28
28
+
profile: {
29
29
+
Balanced: "power-profile-balanced-symbolic",
30
30
+
Quiet: "power-profile-power-saver-symbolic",
31
31
+
Performance: "power-profile-performance-symbolic",
60
32
},
61
61
-
recorder: {
62
62
-
recording: "media-record-symbolic",
63
63
-
},
64
64
-
notifications: {
65
65
-
noisy: "preferences-system-notifications-symbolic",
66
66
-
silent: "notifications-disabled-symbolic",
67
67
-
},
68
68
-
trash: {
69
69
-
full: "user-trash-full-symbolic",
70
70
-
empty: "user-trash-symbolic",
71
71
-
},
72
72
-
mpris: {
73
73
-
fallback: "audio-x-generic-symbolic",
74
74
-
shuffle: {
75
75
-
enabled: "",
76
76
-
disabled: "",
77
77
-
},
78
78
-
loop: {
79
79
-
none: "",
80
80
-
track: "",
81
81
-
playlist: "",
82
82
-
},
83
83
-
playing: "",
84
84
-
paused: "",
85
85
-
stopped: "",
86
86
-
prev: "",
87
87
-
next: "",
33
33
+
mode: {
34
34
+
Integrated: "",
35
35
+
Hybrid: "",
88
36
},
89
89
-
ui: {
90
90
-
close: "window-close-symbolic",
91
91
-
info: "info-symbolic",
92
92
-
menu: "open-menu-symbolic",
93
93
-
link: "external-link-symbolic",
94
94
-
settings: "emblem-system-symbolic",
95
95
-
tick: "object-select-symbolic",
96
96
-
arrow: {
97
97
-
right: "pan-end-symbolic",
98
98
-
left: "pan-start-symbolic",
99
99
-
down: "pan-down-symbolic",
100
100
-
up: "pan-up-symbolic",
101
101
-
},
37
37
+
},
38
38
+
apps: {
39
39
+
apps: "view-app-grid-symbolic",
40
40
+
search: "folder-saved-search-symbolic",
41
41
+
},
42
42
+
battery: {
43
43
+
charging: "",
44
44
+
warning: "battery-empty-symbolic",
45
45
+
},
46
46
+
bluetooth: {
47
47
+
enabled: "bluetooth-active-symbolic",
48
48
+
disabled: "bluetooth-disabled-symbolic",
49
49
+
},
50
50
+
brightness: {
51
51
+
indicator: "display-brightness-symbolic",
52
52
+
keyboard: "keyboard-brightness-symbolic",
53
53
+
screen: "display-brightness-symbolic",
54
54
+
},
55
55
+
powermenu: {
56
56
+
sleep: "weather-clear-night-symbolic",
57
57
+
reboot: "system-reboot-symbolic",
58
58
+
logout: "system-log-out-symbolic",
59
59
+
shutdown: "system-shutdown-symbolic",
60
60
+
},
61
61
+
recorder: {
62
62
+
recording: "media-record-symbolic",
63
63
+
},
64
64
+
notifications: {
65
65
+
noisy: "preferences-system-notifications-symbolic",
66
66
+
silent: "notifications-disabled-symbolic",
67
67
+
},
68
68
+
trash: {
69
69
+
full: "user-trash-full-symbolic",
70
70
+
empty: "user-trash-symbolic",
71
71
+
},
72
72
+
mpris: {
73
73
+
fallback: "audio-x-generic-symbolic",
74
74
+
shuffle: {
75
75
+
enabled: "",
76
76
+
disabled: "",
102
77
},
103
103
-
system: {
104
104
-
cpu: "org.gnome.SystemMonitor-symbolic",
105
105
-
ram: "drive-harddisk-solidstate-symbolic",
106
106
-
temp: "temperature-symbolic",
78
78
+
loop: {
79
79
+
none: "",
80
80
+
track: "",
81
81
+
playlist: "",
107
82
},
108
108
-
dialog: {
109
109
-
Search: "",
110
110
-
Applauncher: "",
111
111
-
Bar: "",
112
112
-
Border: "",
113
113
-
Color: "",
114
114
-
Desktop: "",
115
115
-
Font: "",
116
116
-
General: "",
117
117
-
Miscellaneous: "",
118
118
-
Theme: "",
119
119
-
Notifications: " ",
83
83
+
playing: "",
84
84
+
paused: "",
85
85
+
stopped: "",
86
86
+
prev: "",
87
87
+
next: "",
88
88
+
},
89
89
+
ui: {
90
90
+
close: "window-close-symbolic",
91
91
+
info: "info-symbolic",
92
92
+
menu: "open-menu-symbolic",
93
93
+
link: "external-link-symbolic",
94
94
+
settings: "emblem-system-symbolic",
95
95
+
tick: "object-select-symbolic",
96
96
+
arrow: {
97
97
+
right: "pan-end-symbolic",
98
98
+
left: "pan-start-symbolic",
99
99
+
down: "pan-down-symbolic",
100
100
+
up: "pan-up-symbolic",
120
101
},
102
102
+
},
103
103
+
system: {
104
104
+
cpu: "org.gnome.SystemMonitor-symbolic",
105
105
+
ram: "drive-harddisk-solidstate-symbolic",
106
106
+
temp: "temperature-symbolic",
107
107
+
},
108
108
+
dialog: {
109
109
+
Search: "",
110
110
+
Applauncher: "",
111
111
+
Bar: "",
112
112
+
Border: "",
113
113
+
Color: "",
114
114
+
Desktop: "",
115
115
+
Font: "",
116
116
+
General: "",
117
117
+
Miscellaneous: "",
118
118
+
Theme: "",
119
119
+
Notifications: " ",
120
120
+
},
121
121
};
+18
-18
home/isabel/programs/configs/gui/bars/ags/config/misc/Avatar.js
···
3
3
4
4
/** @param {import('types/widgets/box').BoxProps=} props */
5
5
export default (props) =>
6
6
-
Widget.Box({
7
7
-
...props,
8
8
-
class_name: "avatar",
9
9
-
connections: [
10
10
-
[
11
11
-
options.desktop.avatar,
12
12
-
(box) =>
13
13
-
box.setCss(`
6
6
+
Widget.Box({
7
7
+
...props,
8
8
+
class_name: "avatar",
9
9
+
connections: [
10
10
+
[
11
11
+
options.desktop.avatar,
12
12
+
(box) =>
13
13
+
box.setCss(`
14
14
background-image: url('${options.desktop.avatar.value}');
15
15
background-size: cover;
16
16
`),
17
17
-
],
18
18
-
[
19
19
-
"draw",
20
20
-
(box) => {
21
21
-
const h = box.get_allocated_height();
22
22
-
box.set_size_request(h, -1);
23
23
-
},
24
24
-
],
25
25
-
],
26
26
-
});
17
17
+
],
18
18
+
[
19
19
+
"draw",
20
20
+
(box) => {
21
21
+
const h = box.get_allocated_height();
22
22
+
box.set_size_request(h, -1);
23
23
+
},
24
24
+
],
25
25
+
],
26
26
+
});
+14
-14
home/isabel/programs/configs/gui/bars/ags/config/misc/BatteryIcon.js
···
2
2
import Battery from "resource:///com/github/Aylur/ags/service/battery.js";
3
3
4
4
export default () =>
5
5
-
Widget.Icon({
6
6
-
class_name: "battery",
7
7
-
binds: [["icon", Battery, "icon-name"]],
8
8
-
connections: [
9
9
-
[
10
10
-
Battery,
11
11
-
(icon) => {
12
12
-
icon.toggleClassName("charging", Battery.charging);
13
13
-
icon.toggleClassName("charged", Battery.charged);
14
14
-
icon.toggleClassName("low", Battery.percent < 30);
15
15
-
},
16
16
-
],
17
17
-
],
18
18
-
});
5
5
+
Widget.Icon({
6
6
+
class_name: "battery",
7
7
+
binds: [["icon", Battery, "icon-name"]],
8
8
+
connections: [
9
9
+
[
10
10
+
Battery,
11
11
+
(icon) => {
12
12
+
icon.toggleClassName("charging", Battery.charging);
13
13
+
icon.toggleClassName("charged", Battery.charged);
14
14
+
icon.toggleClassName("low", Battery.percent < 30);
15
15
+
},
16
16
+
],
17
17
+
],
18
18
+
});
+15
-16
home/isabel/programs/configs/gui/bars/ags/config/misc/Clock.js
···
8
8
* }} o
9
9
*/
10
10
export default ({
11
11
-
format = "%H:%M:%S %B %e. %A",
12
12
-
interval = 1000,
13
13
-
...rest
11
11
+
format = "%H:%M:%S %B %e. %A",
12
12
+
interval = 1000,
13
13
+
...rest
14
14
} = {}) =>
15
15
-
Widget.Label({
16
16
-
class_name: "clock",
17
17
-
...rest,
18
18
-
connections: [
19
19
-
[
20
20
-
interval,
21
21
-
(label) =>
22
22
-
(label.label =
23
23
-
GLib.DateTime.new_now_local().format(format) ||
24
24
-
"wrong format"),
25
25
-
],
26
26
-
],
27
27
-
});
15
15
+
Widget.Label({
16
16
+
class_name: "clock",
17
17
+
...rest,
18
18
+
connections: [
19
19
+
[
20
20
+
interval,
21
21
+
(label) =>
22
22
+
(label.label =
23
23
+
GLib.DateTime.new_now_local().format(format) || "wrong format"),
24
24
+
],
25
25
+
],
26
26
+
});
+31
-31
home/isabel/programs/configs/gui/bars/ags/config/misc/FontIcon.js
···
3
3
import AgsLabel from "resource:///com/github/Aylur/ags/widgets/label.js";
4
4
5
5
class FontIcon extends AgsLabel {
6
6
-
static {
7
7
-
GObject.registerClass(this);
8
8
-
}
6
6
+
static {
7
7
+
GObject.registerClass(this);
8
8
+
}
9
9
10
10
-
/** @param {string | import('types/widgets/label').Props & { icon?: string }} params */
11
11
-
constructor(params = "") {
12
12
-
const { icon = "", ...rest } = params;
13
13
-
super(typeof params === "string" ? {} : rest);
14
14
-
this.toggleClassName("font-icon");
10
10
+
/** @param {string | import('types/widgets/label').Props & { icon?: string }} params */
11
11
+
constructor(params = "") {
12
12
+
const { icon = "", ...rest } = params;
13
13
+
super(typeof params === "string" ? {} : rest);
14
14
+
this.toggleClassName("font-icon");
15
15
16
16
-
if (typeof params === "object") this.icon = icon;
16
16
+
if (typeof params === "object") this.icon = icon;
17
17
18
18
-
if (typeof params === "string") this.icon = params;
19
19
-
}
18
18
+
if (typeof params === "string") this.icon = params;
19
19
+
}
20
20
21
21
-
get icon() {
22
22
-
return this.label;
23
23
-
}
24
24
-
set icon(icon) {
25
25
-
this.label = icon;
26
26
-
}
21
21
+
get icon() {
22
22
+
return this.label;
23
23
+
}
24
24
+
set icon(icon) {
25
25
+
this.label = icon;
26
26
+
}
27
27
28
28
-
get size() {
29
29
-
return this.get_style_context().get_property(
30
30
-
"font-size",
31
31
-
Gtk.StateFlags.NORMAL,
32
32
-
);
33
33
-
}
28
28
+
get size() {
29
29
+
return this.get_style_context().get_property(
30
30
+
"font-size",
31
31
+
Gtk.StateFlags.NORMAL,
32
32
+
);
33
33
+
}
34
34
35
35
-
/** @returns {[number, number]} */
36
36
-
vfunc_get_preferred_height() {
37
37
-
return [this.size, this.size];
38
38
-
}
35
35
+
/** @returns {[number, number]} */
36
36
+
vfunc_get_preferred_height() {
37
37
+
return [this.size, this.size];
38
38
+
}
39
39
40
40
-
/** @returns {[number, number]} */
41
41
-
vfunc_get_preferred_width() {
42
42
-
return [this.size, this.size];
43
43
-
}
40
40
+
/** @returns {[number, number]} */
41
41
+
vfunc_get_preferred_width() {
42
42
+
return [this.size, this.size];
43
43
+
}
44
44
}
45
45
46
46
/** @param {string | import('types/widgets/label').Props & { icon?: string }} params */
+40
-40
home/isabel/programs/configs/gui/bars/ags/config/misc/HoverRevealer.js
···
15
15
* @param {HoverRevealProps} props
16
16
*/
17
17
export default ({
18
18
-
indicator,
19
19
-
child,
20
20
-
direction = "left",
21
21
-
duration = 300,
22
22
-
connections = [],
23
23
-
eventboxConnections = [],
24
24
-
binds = [],
25
25
-
...rest
18
18
+
indicator,
19
19
+
child,
20
20
+
direction = "left",
21
21
+
duration = 300,
22
22
+
connections = [],
23
23
+
eventboxConnections = [],
24
24
+
binds = [],
25
25
+
...rest
26
26
}) => {
27
27
-
let open = false;
28
28
-
const vertical = direction === "down" || direction === "up";
29
29
-
const posStart = direction === "down" || direction === "right";
30
30
-
const posEnd = direction === "up" || direction === "left";
27
27
+
let open = false;
28
28
+
const vertical = direction === "down" || direction === "up";
29
29
+
const posStart = direction === "down" || direction === "right";
30
30
+
const posEnd = direction === "up" || direction === "left";
31
31
32
32
-
const revealer = Widget.Revealer({
33
33
-
transition: `slide_${direction}`,
34
34
-
connections,
35
35
-
binds,
36
36
-
transition_duration: duration,
37
37
-
child,
38
38
-
});
32
32
+
const revealer = Widget.Revealer({
33
33
+
transition: `slide_${direction}`,
34
34
+
connections,
35
35
+
binds,
36
36
+
transition_duration: duration,
37
37
+
child,
38
38
+
});
39
39
40
40
-
const eventbox = Widget.EventBox({
41
41
-
...rest,
42
42
-
connections: eventboxConnections,
43
43
-
on_hover: () => {
44
44
-
if (open) return;
40
40
+
const eventbox = Widget.EventBox({
41
41
+
...rest,
42
42
+
connections: eventboxConnections,
43
43
+
on_hover: () => {
44
44
+
if (open) return;
45
45
46
46
-
revealer.reveal_child = true;
47
47
-
Utils.timeout(duration, () => (open = true));
48
48
-
},
49
49
-
on_hover_lost: () => {
50
50
-
if (!open) return;
46
46
+
revealer.reveal_child = true;
47
47
+
Utils.timeout(duration, () => (open = true));
48
48
+
},
49
49
+
on_hover_lost: () => {
50
50
+
if (!open) return;
51
51
52
52
-
revealer.reveal_child = false;
53
53
-
open = false;
54
54
-
},
55
55
-
child: Widget.Box({
56
56
-
vertical,
57
57
-
children: [posStart && indicator, revealer, posEnd && indicator],
58
58
-
}),
59
59
-
});
52
52
+
revealer.reveal_child = false;
53
53
+
open = false;
54
54
+
},
55
55
+
child: Widget.Box({
56
56
+
vertical,
57
57
+
children: [posStart && indicator, revealer, posEnd && indicator],
58
58
+
}),
59
59
+
});
60
60
61
61
-
return Widget.Box({
62
62
-
children: [eventbox],
63
63
-
});
61
61
+
return Widget.Box({
62
62
+
children: [eventbox],
63
63
+
});
64
64
};
+51
-51
home/isabel/programs/configs/gui/bars/ags/config/misc/IconBrowser.js
···
3
3
import Gtk from "gi://Gtk";
4
4
5
5
export default () => {
6
6
-
const selected = Widget.Label({
7
7
-
css: "font-size: 1.2em;",
8
8
-
});
6
6
+
const selected = Widget.Label({
7
7
+
css: "font-size: 1.2em;",
8
8
+
});
9
9
10
10
-
const flowbox = Widget.FlowBox({
11
11
-
min_children_per_line: 10,
12
12
-
setup: (self) => {
13
13
-
self.connect("child-activated", (_, child) => {
14
14
-
selected.label = child.get_child().iconName;
15
15
-
});
10
10
+
const flowbox = Widget.FlowBox({
11
11
+
min_children_per_line: 10,
12
12
+
setup: (self) => {
13
13
+
self.connect("child-activated", (_, child) => {
14
14
+
selected.label = child.get_child().iconName;
15
15
+
});
16
16
17
17
-
Gtk.IconTheme.get_default()
18
18
-
.list_icons(null)
19
19
-
.sort()
20
20
-
.map((icon) => {
21
21
-
!icon.endsWith(".symbolic") &&
22
22
-
self.insert(
23
23
-
Widget.Icon({
24
24
-
icon,
25
25
-
size: 38,
26
26
-
}),
27
27
-
-1,
28
28
-
);
29
29
-
});
17
17
+
Gtk.IconTheme.get_default()
18
18
+
.list_icons(null)
19
19
+
.sort()
20
20
+
.map((icon) => {
21
21
+
!icon.endsWith(".symbolic") &&
22
22
+
self.insert(
23
23
+
Widget.Icon({
24
24
+
icon,
25
25
+
size: 38,
26
26
+
}),
27
27
+
-1,
28
28
+
);
29
29
+
});
30
30
31
31
-
self.show_all();
32
32
-
},
33
33
-
});
31
31
+
self.show_all();
32
32
+
},
33
33
+
});
34
34
35
35
-
const entry = Widget.Entry({
36
36
-
on_change: ({ text }) =>
37
37
-
flowbox.get_children().forEach((child) => {
38
38
-
child.visible = child.get_child().iconName.includes(text);
39
39
-
}),
40
40
-
});
35
35
+
const entry = Widget.Entry({
36
36
+
on_change: ({ text }) =>
37
37
+
flowbox.get_children().forEach((child) => {
38
38
+
child.visible = child.get_child().iconName.includes(text);
39
39
+
}),
40
40
+
});
41
41
42
42
-
return RegularWindow({
43
43
-
name: "icons",
44
44
-
visible: true,
45
45
-
child: Widget.Box({
46
46
-
css: "padding: 30px;",
47
47
-
spacing: 20,
48
48
-
vertical: true,
49
49
-
children: [
50
50
-
entry,
51
51
-
Widget.Scrollable({
52
52
-
hscroll: "never",
53
53
-
vscroll: "always",
54
54
-
hexpand: true,
55
55
-
vexpand: true,
56
56
-
css: "min-width: 500px;" + "min-height: 500px;",
57
57
-
child: flowbox,
58
58
-
}),
59
59
-
selected,
60
60
-
],
42
42
+
return RegularWindow({
43
43
+
name: "icons",
44
44
+
visible: true,
45
45
+
child: Widget.Box({
46
46
+
css: "padding: 30px;",
47
47
+
spacing: 20,
48
48
+
vertical: true,
49
49
+
children: [
50
50
+
entry,
51
51
+
Widget.Scrollable({
52
52
+
hscroll: "never",
53
53
+
vscroll: "always",
54
54
+
hexpand: true,
55
55
+
vexpand: true,
56
56
+
css: "min-width: 500px;" + "min-height: 500px;",
57
57
+
child: flowbox,
61
58
}),
62
62
-
});
59
59
+
selected,
60
60
+
],
61
61
+
}),
62
62
+
});
63
63
};
+103
-103
home/isabel/programs/configs/gui/bars/ags/config/misc/Notification.js
···
4
4
5
5
/** @param {import('types/service/notifications').Notification} n */
6
6
const NotificationIcon = ({ app_entry, app_icon, image }) => {
7
7
-
if (image) {
8
8
-
return Widget.Box({
9
9
-
vpack: "start",
10
10
-
hexpand: false,
11
11
-
class_name: "icon img",
12
12
-
css: `
7
7
+
if (image) {
8
8
+
return Widget.Box({
9
9
+
vpack: "start",
10
10
+
hexpand: false,
11
11
+
class_name: "icon img",
12
12
+
css: `
13
13
background-image: url("${image}");
14
14
background-size: contain;
15
15
background-repeat: no-repeat;
···
17
17
min-width: 78px;
18
18
min-height: 78px;
19
19
`,
20
20
-
});
21
21
-
}
20
20
+
});
21
21
+
}
22
22
23
23
-
let icon = "dialog-information-symbolic";
24
24
-
if (Utils.lookUpIcon(app_icon)) icon = app_icon;
23
23
+
let icon = "dialog-information-symbolic";
24
24
+
if (Utils.lookUpIcon(app_icon)) icon = app_icon;
25
25
26
26
-
if (Utils.lookUpIcon(app_entry || "")) icon = app_entry || "";
26
26
+
if (Utils.lookUpIcon(app_entry || "")) icon = app_entry || "";
27
27
28
28
-
return Widget.Box({
29
29
-
vpack: "start",
30
30
-
hexpand: false,
31
31
-
class_name: "icon",
32
32
-
css: `
28
28
+
return Widget.Box({
29
29
+
vpack: "start",
30
30
+
hexpand: false,
31
31
+
class_name: "icon",
32
32
+
css: `
33
33
min-width: 78px;
34
34
min-height: 78px;
35
35
`,
36
36
-
child: Widget.Icon({
37
37
-
icon,
38
38
-
size: 58,
39
39
-
hpack: "center",
40
40
-
hexpand: true,
41
41
-
vpack: "center",
42
42
-
vexpand: true,
43
43
-
}),
44
44
-
});
36
36
+
child: Widget.Icon({
37
37
+
icon,
38
38
+
size: 58,
39
39
+
hpack: "center",
40
40
+
hexpand: true,
41
41
+
vpack: "center",
42
42
+
vexpand: true,
43
43
+
}),
44
44
+
});
45
45
};
46
46
47
47
/** @param {import('types/service/notifications').Notification} notification */
48
48
export default (notification) => {
49
49
-
const content = Widget.Box({
50
50
-
class_name: "content",
49
49
+
const content = Widget.Box({
50
50
+
class_name: "content",
51
51
+
children: [
52
52
+
NotificationIcon(notification),
53
53
+
Widget.Box({
54
54
+
hexpand: true,
55
55
+
vertical: true,
51
56
children: [
52
52
-
NotificationIcon(notification),
53
53
-
Widget.Box({
57
57
+
Widget.Box({
58
58
+
children: [
59
59
+
Widget.Label({
60
60
+
class_name: "title",
61
61
+
xalign: 0,
62
62
+
justification: "left",
54
63
hexpand: true,
55
55
-
vertical: true,
56
56
-
children: [
57
57
-
Widget.Box({
58
58
-
children: [
59
59
-
Widget.Label({
60
60
-
class_name: "title",
61
61
-
xalign: 0,
62
62
-
justification: "left",
63
63
-
hexpand: true,
64
64
-
max_width_chars: 24,
65
65
-
truncate: "end",
66
66
-
wrap: true,
67
67
-
label: notification.summary,
68
68
-
use_markup: true,
69
69
-
}),
70
70
-
Widget.Label({
71
71
-
class_name: "time",
72
72
-
vpack: "start",
73
73
-
label: GLib.DateTime.new_from_unix_local(
74
74
-
notification.time,
75
75
-
).format("%H:%M"),
76
76
-
}),
77
77
-
Widget.Button({
78
78
-
class_name: "close-button",
79
79
-
vpack: "start",
80
80
-
child: Widget.Icon("window-close-symbolic"),
81
81
-
on_clicked: () => notification.close(),
82
82
-
}),
83
83
-
],
84
84
-
}),
85
85
-
Widget.Label({
86
86
-
class_name: "description",
87
87
-
hexpand: true,
88
88
-
use_markup: true,
89
89
-
xalign: 0,
90
90
-
justification: "left",
91
91
-
label: notification.body,
92
92
-
wrap: true,
93
93
-
}),
94
94
-
],
95
95
-
}),
64
64
+
max_width_chars: 24,
65
65
+
truncate: "end",
66
66
+
wrap: true,
67
67
+
label: notification.summary,
68
68
+
use_markup: true,
69
69
+
}),
70
70
+
Widget.Label({
71
71
+
class_name: "time",
72
72
+
vpack: "start",
73
73
+
label: GLib.DateTime.new_from_unix_local(
74
74
+
notification.time,
75
75
+
).format("%H:%M"),
76
76
+
}),
77
77
+
Widget.Button({
78
78
+
class_name: "close-button",
79
79
+
vpack: "start",
80
80
+
child: Widget.Icon("window-close-symbolic"),
81
81
+
on_clicked: () => notification.close(),
82
82
+
}),
83
83
+
],
84
84
+
}),
85
85
+
Widget.Label({
86
86
+
class_name: "description",
87
87
+
hexpand: true,
88
88
+
use_markup: true,
89
89
+
xalign: 0,
90
90
+
justification: "left",
91
91
+
label: notification.body,
92
92
+
wrap: true,
93
93
+
}),
96
94
],
97
97
-
});
95
95
+
}),
96
96
+
],
97
97
+
});
98
98
99
99
-
const actionsbox = Widget.Revealer({
100
100
-
transition: "slide_down",
101
101
-
child: Widget.EventBox({
102
102
-
child: Widget.Box({
103
103
-
class_name: "actions horizontal",
104
104
-
children: notification.actions.map((action) =>
105
105
-
Widget.Button({
106
106
-
class_name: "action-button",
107
107
-
on_clicked: () => notification.invoke(action.id),
108
108
-
hexpand: true,
109
109
-
child: Widget.Label(action.label),
110
110
-
}),
111
111
-
),
112
112
-
}),
113
113
-
}),
114
114
-
});
99
99
+
const actionsbox = Widget.Revealer({
100
100
+
transition: "slide_down",
101
101
+
child: Widget.EventBox({
102
102
+
child: Widget.Box({
103
103
+
class_name: "actions horizontal",
104
104
+
children: notification.actions.map((action) =>
105
105
+
Widget.Button({
106
106
+
class_name: "action-button",
107
107
+
on_clicked: () => notification.invoke(action.id),
108
108
+
hexpand: true,
109
109
+
child: Widget.Label(action.label),
110
110
+
}),
111
111
+
),
112
112
+
}),
113
113
+
}),
114
114
+
});
115
115
116
116
-
return Widget.EventBox({
117
117
-
class_name: `notification ${notification.urgency}`,
118
118
-
vexpand: false,
119
119
-
on_primary_click: () => notification.dismiss(),
120
120
-
on_hover() {
121
121
-
actionsbox.reveal_child = true;
122
122
-
},
123
123
-
on_hover_lost() {
124
124
-
actionsbox.reveal_child = true;
125
125
-
notification.dismiss();
126
126
-
},
127
127
-
child: Widget.Box({
128
128
-
vertical: true,
129
129
-
children: [content, notification.actions.length > 0 && actionsbox],
130
130
-
}),
131
131
-
});
116
116
+
return Widget.EventBox({
117
117
+
class_name: `notification ${notification.urgency}`,
118
118
+
vexpand: false,
119
119
+
on_primary_click: () => notification.dismiss(),
120
120
+
on_hover() {
121
121
+
actionsbox.reveal_child = true;
122
122
+
},
123
123
+
on_hover_lost() {
124
124
+
actionsbox.reveal_child = true;
125
125
+
notification.dismiss();
126
126
+
},
127
127
+
child: Widget.Box({
128
128
+
vertical: true,
129
129
+
children: [content, notification.actions.length > 0 && actionsbox],
130
130
+
}),
131
131
+
});
132
132
};
+62
-70
home/isabel/programs/configs/gui/bars/ags/config/misc/OSD.js
···
5
5
import Indicator from "../services/onScreenIndicator.js";
6
6
7
7
export const OnScreenIndicator = ({ height = 300, width = 48 } = {}) =>
8
8
-
Widget.Box({
9
9
-
class_name: "indicator",
10
10
-
css: "padding: 1px;",
11
11
-
child: Widget.Revealer({
12
12
-
transition: "slide_left",
13
13
-
connections: [
14
14
-
[
15
15
-
Indicator,
16
16
-
(revealer, value) => {
17
17
-
revealer.reveal_child = value > -1;
18
18
-
},
8
8
+
Widget.Box({
9
9
+
class_name: "indicator",
10
10
+
css: "padding: 1px;",
11
11
+
child: Widget.Revealer({
12
12
+
transition: "slide_left",
13
13
+
connections: [
14
14
+
[
15
15
+
Indicator,
16
16
+
(revealer, value) => {
17
17
+
revealer.reveal_child = value > -1;
18
18
+
},
19
19
+
],
20
20
+
],
21
21
+
child: Progress({
22
22
+
width,
23
23
+
height,
24
24
+
vertical: true,
25
25
+
connections: [
26
26
+
[Indicator, (progress, value) => progress.setValue(value)],
27
27
+
],
28
28
+
child: Widget.Stack({
29
29
+
vpack: "start",
30
30
+
hpack: "center",
31
31
+
hexpand: false,
32
32
+
items: [
33
33
+
[
34
34
+
"true",
35
35
+
Widget.Icon({
36
36
+
hpack: "center",
37
37
+
size: width,
38
38
+
connections: [
39
39
+
[Indicator, (icon, _v, name) => (icon.icon = name || "")],
19
40
],
41
41
+
}),
20
42
],
21
21
-
child: Progress({
22
22
-
width,
23
23
-
height,
24
24
-
vertical: true,
43
43
+
[
44
44
+
"false",
45
45
+
FontIcon({
46
46
+
hpack: "center",
47
47
+
hexpand: true,
48
48
+
css: `font-size: ${width}px;`,
25
49
connections: [
26
26
-
[Indicator, (progress, value) => progress.setValue(value)],
50
50
+
[Indicator, (icon, _v, name) => (icon.icon = name || "")],
27
51
],
28
28
-
child: Widget.Stack({
29
29
-
vpack: "start",
30
30
-
hpack: "center",
31
31
-
hexpand: false,
32
32
-
items: [
33
33
-
[
34
34
-
"true",
35
35
-
Widget.Icon({
36
36
-
hpack: "center",
37
37
-
size: width,
38
38
-
connections: [
39
39
-
[
40
40
-
Indicator,
41
41
-
(icon, _v, name) =>
42
42
-
(icon.icon = name || ""),
43
43
-
],
44
44
-
],
45
45
-
}),
46
46
-
],
47
47
-
[
48
48
-
"false",
49
49
-
FontIcon({
50
50
-
hpack: "center",
51
51
-
hexpand: true,
52
52
-
css: `font-size: ${width}px;`,
53
53
-
connections: [
54
54
-
[
55
55
-
Indicator,
56
56
-
(icon, _v, name) =>
57
57
-
(icon.icon = name || ""),
58
58
-
],
59
59
-
],
60
60
-
}),
61
61
-
],
62
62
-
],
63
63
-
connections: [
64
64
-
[
65
65
-
Indicator,
66
66
-
(stack, _v, name) => {
67
67
-
stack.shown = `${!!Utils.lookUpIcon(name)}`;
68
68
-
},
69
69
-
],
70
70
-
],
71
71
-
}),
72
72
-
}),
52
52
+
}),
53
53
+
],
54
54
+
],
55
55
+
connections: [
56
56
+
[
57
57
+
Indicator,
58
58
+
(stack, _v, name) => {
59
59
+
stack.shown = `${!!Utils.lookUpIcon(name)}`;
60
60
+
},
61
61
+
],
62
62
+
],
73
63
}),
74
74
-
});
64
64
+
}),
65
65
+
}),
66
66
+
});
75
67
76
68
/** @param {number} monitor */
77
69
export default (monitor) =>
78
78
-
Widget.Window({
79
79
-
name: `indicator${monitor}`,
80
80
-
monitor,
81
81
-
class_name: "indicator",
82
82
-
layer: "overlay",
83
83
-
anchor: ["right"],
84
84
-
child: OnScreenIndicator(),
85
85
-
});
70
70
+
Widget.Window({
71
71
+
name: `indicator${monitor}`,
72
72
+
monitor,
73
73
+
class_name: "indicator",
74
74
+
layer: "overlay",
75
75
+
anchor: ["right"],
76
76
+
child: OnScreenIndicator(),
77
77
+
});
+44
-51
home/isabel/programs/configs/gui/bars/ags/config/misc/PopupWindow.js
···
5
5
import GObject from "gi://GObject";
6
6
7
7
class PopupWindow2 extends AgsWindow {
8
8
-
static {
9
9
-
GObject.registerClass(this);
10
10
-
}
8
8
+
static {
9
9
+
GObject.registerClass(this);
10
10
+
}
11
11
12
12
-
/** @param {import('types/widgets/window').WindowProps & {
13
13
-
* name: string
14
14
-
* child: import('types/widgets/box').default
15
15
-
* transition?: import('types/widgets/revealer').RevealerProps['transition']
16
16
-
* }} o
17
17
-
*/
18
18
-
constructor({
19
19
-
name,
20
20
-
child,
21
21
-
transition = "none",
22
22
-
visible = false,
23
23
-
...rest
24
24
-
}) {
25
25
-
super({
26
26
-
...rest,
27
27
-
name,
28
28
-
popup: true,
29
29
-
focusable: true,
30
30
-
class_names: ["popup-window", name],
31
31
-
});
12
12
+
/** @param {import('types/widgets/window').WindowProps & {
13
13
+
* name: string
14
14
+
* child: import('types/widgets/box').default
15
15
+
* transition?: import('types/widgets/revealer').RevealerProps['transition']
16
16
+
* }} o
17
17
+
*/
18
18
+
constructor({ name, child, transition = "none", visible = false, ...rest }) {
19
19
+
super({
20
20
+
...rest,
21
21
+
name,
22
22
+
popup: true,
23
23
+
focusable: true,
24
24
+
class_names: ["popup-window", name],
25
25
+
});
32
26
33
33
-
child.toggleClassName("window-content");
34
34
-
this.revealer = Widget.Revealer({
35
35
-
transition,
36
36
-
child,
37
37
-
transitionDuration: options.transition.value,
38
38
-
connections: [
39
39
-
[
40
40
-
App,
41
41
-
(_, wname, visible) => {
42
42
-
if (wname === name)
43
43
-
this.revealer.reveal_child = visible;
44
44
-
},
45
45
-
],
46
46
-
],
47
47
-
});
27
27
+
child.toggleClassName("window-content");
28
28
+
this.revealer = Widget.Revealer({
29
29
+
transition,
30
30
+
child,
31
31
+
transitionDuration: options.transition.value,
32
32
+
connections: [
33
33
+
[
34
34
+
App,
35
35
+
(_, wname, visible) => {
36
36
+
if (wname === name) this.revealer.reveal_child = visible;
37
37
+
},
38
38
+
],
39
39
+
],
40
40
+
});
48
41
49
49
-
this.child = Widget.Box({
50
50
-
css: "padding: 1px;",
51
51
-
child: this.revealer,
52
52
-
});
42
42
+
this.child = Widget.Box({
43
43
+
css: "padding: 1px;",
44
44
+
child: this.revealer,
45
45
+
});
53
46
54
54
-
this.show_all();
55
55
-
this.visible = visible;
56
56
-
}
47
47
+
this.show_all();
48
48
+
this.visible = visible;
49
49
+
}
57
50
58
58
-
set transition(dir) {
59
59
-
this.revealer.transition = dir;
60
60
-
}
61
61
-
get transition() {
62
62
-
return this.revealer.transition;
63
63
-
}
51
51
+
set transition(dir) {
52
52
+
this.revealer.transition = dir;
53
53
+
}
54
54
+
get transition() {
55
55
+
return this.revealer.transition;
56
56
+
}
64
57
}
65
58
66
59
/** @param {import('types/widgets/window').WindowProps & {
+42
-42
home/isabel/programs/configs/gui/bars/ags/config/misc/Progress.js
···
2
2
import * as Utils from "resource:///com/github/Aylur/ags/utils.js";
3
3
4
4
export default ({
5
5
-
height = 18,
6
6
-
width = 180,
7
7
-
vertical = false,
8
8
-
child,
9
9
-
...props
5
5
+
height = 18,
6
6
+
width = 180,
7
7
+
vertical = false,
8
8
+
child,
9
9
+
...props
10
10
}) => {
11
11
-
const fill = Widget.Box({
12
12
-
class_name: "fill",
13
13
-
hexpand: vertical,
14
14
-
vexpand: !vertical,
15
15
-
hpack: vertical ? "fill" : "start",
16
16
-
vpack: vertical ? "end" : "fill",
17
17
-
children: [child],
18
18
-
});
11
11
+
const fill = Widget.Box({
12
12
+
class_name: "fill",
13
13
+
hexpand: vertical,
14
14
+
vexpand: !vertical,
15
15
+
hpack: vertical ? "fill" : "start",
16
16
+
vpack: vertical ? "end" : "fill",
17
17
+
children: [child],
18
18
+
});
19
19
20
20
-
let fill_size = 0;
20
20
+
let fill_size = 0;
21
21
22
22
-
return Widget.Box({
23
23
-
...props,
24
24
-
class_name: "progress",
25
25
-
css: `
22
22
+
return Widget.Box({
23
23
+
...props,
24
24
+
class_name: "progress",
25
25
+
css: `
26
26
min-width: ${width}px;
27
27
min-height: ${height}px;
28
28
`,
29
29
-
children: [fill],
30
30
-
setup: (progress) =>
31
31
-
(progress.setValue = (value) => {
32
32
-
if (value < 0) return;
29
29
+
children: [fill],
30
30
+
setup: (progress) =>
31
31
+
(progress.setValue = (value) => {
32
32
+
if (value < 0) return;
33
33
34
34
-
const axis = vertical ? "height" : "width";
35
35
-
const axisv = vertical ? height : width;
36
36
-
const min = vertical ? width : height;
37
37
-
const preferred = (axisv - min) * value + min;
34
34
+
const axis = vertical ? "height" : "width";
35
35
+
const axisv = vertical ? height : width;
36
36
+
const min = vertical ? width : height;
37
37
+
const preferred = (axisv - min) * value + min;
38
38
39
39
-
if (!fill_size) {
40
40
-
fill_size = preferred;
41
41
-
fill.setCss(`min-${axis}: ${preferred}px;`);
42
42
-
return;
43
43
-
}
39
39
+
if (!fill_size) {
40
40
+
fill_size = preferred;
41
41
+
fill.setCss(`min-${axis}: ${preferred}px;`);
42
42
+
return;
43
43
+
}
44
44
45
45
-
const frames = 10;
46
46
-
const goal = preferred - fill_size;
47
47
-
const step = goal / frames;
45
45
+
const frames = 10;
46
46
+
const goal = preferred - fill_size;
47
47
+
const step = goal / frames;
48
48
49
49
-
for (let i = 0; i < frames; ++i) {
50
50
-
Utils.timeout(5 * i, () => {
51
51
-
fill_size += step;
52
52
-
fill.setCss(`min-${axis}: ${fill_size}px`);
53
53
-
});
54
54
-
}
55
55
-
}),
56
56
-
});
49
49
+
for (let i = 0; i < frames; ++i) {
50
50
+
Utils.timeout(5 * i, () => {
51
51
+
fill_size += step;
52
52
+
fill.setCss(`min-${axis}: ${fill_size}px`);
53
53
+
});
54
54
+
}
55
55
+
}),
56
56
+
});
57
57
};
+4
-4
home/isabel/programs/configs/gui/bars/ags/config/misc/Spinner.js
···
1
1
import Widget from "resource:///com/github/Aylur/ags/widget.js";
2
2
3
3
export default (props) =>
4
4
-
Widget.Spinner({
5
5
-
...props,
6
6
-
active: true,
7
7
-
});
4
4
+
Widget.Spinner({
5
5
+
...props,
6
6
+
active: true,
7
7
+
});
+251
-257
home/isabel/programs/configs/gui/bars/ags/config/misc/mpris.js
···
10
10
* @param {import('types/widgets/box').BoxProps=} props
11
11
*/
12
12
export const CoverArt = (player, props) =>
13
13
-
Widget.Box({
14
14
-
...props,
15
15
-
class_name: "cover",
16
16
-
binds: [
17
17
-
[
18
18
-
"css",
19
19
-
player,
20
20
-
"cover-path",
21
21
-
(path) => `background-image: url("${path}")`,
22
22
-
],
23
23
-
],
24
24
-
});
13
13
+
Widget.Box({
14
14
+
...props,
15
15
+
class_name: "cover",
16
16
+
binds: [
17
17
+
[
18
18
+
"css",
19
19
+
player,
20
20
+
"cover-path",
21
21
+
(path) => `background-image: url("${path}")`,
22
22
+
],
23
23
+
],
24
24
+
});
25
25
26
26
/**
27
27
* @param {import('types/service/mpris').MprisPlayer} player
28
28
* @param {import('types/widgets/box').BoxProps=} props
29
29
*/
30
30
export const BlurredCoverArt = (player, props) =>
31
31
-
Widget.Box({
32
32
-
...props,
33
33
-
class_name: "blurred-cover",
34
34
-
connections: [
35
35
-
[
36
36
-
player,
37
37
-
(box) => {
38
38
-
const url = player.cover_path;
39
39
-
if (!url) return;
31
31
+
Widget.Box({
32
32
+
...props,
33
33
+
class_name: "blurred-cover",
34
34
+
connections: [
35
35
+
[
36
36
+
player,
37
37
+
(box) => {
38
38
+
const url = player.cover_path;
39
39
+
if (!url) return;
40
40
41
41
-
const blurredPath = MEDIA_CACHE_PATH + "/blurred";
42
42
-
const blurred =
43
43
-
blurredPath + url.substring(MEDIA_CACHE_PATH.length);
41
41
+
const blurredPath = MEDIA_CACHE_PATH + "/blurred";
42
42
+
const blurred = blurredPath + url.substring(MEDIA_CACHE_PATH.length);
44
43
45
45
-
if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) {
46
46
-
box.setCss(`background-image: url("${blurred}")`);
47
47
-
return;
48
48
-
}
44
44
+
if (GLib.file_test(blurred, GLib.FileTest.EXISTS)) {
45
45
+
box.setCss(`background-image: url("${blurred}")`);
46
46
+
return;
47
47
+
}
49
48
50
50
-
Utils.ensureDirectory(blurredPath);
51
51
-
Utils.execAsync(["convert", url, "-blur", "0x22", blurred])
52
52
-
.then(() =>
53
53
-
box.setCss(`background-image: url("${blurred}")`),
54
54
-
)
55
55
-
.catch(() => {});
56
56
-
},
57
57
-
"notify::cover-path",
58
58
-
],
59
59
-
],
60
60
-
});
49
49
+
Utils.ensureDirectory(blurredPath);
50
50
+
Utils.execAsync(["convert", url, "-blur", "0x22", blurred])
51
51
+
.then(() => box.setCss(`background-image: url("${blurred}")`))
52
52
+
.catch(() => {});
53
53
+
},
54
54
+
"notify::cover-path",
55
55
+
],
56
56
+
],
57
57
+
});
61
58
62
59
/**
63
60
* @param {import('types/service/mpris').MprisPlayer} player
64
61
* @param {import('types/widgets/label').Props=} props
65
62
*/
66
63
export const TitleLabel = (player, props) =>
67
67
-
Widget.Label({
68
68
-
...props,
69
69
-
class_name: "title",
70
70
-
binds: [["label", player, "track-title"]],
71
71
-
});
64
64
+
Widget.Label({
65
65
+
...props,
66
66
+
class_name: "title",
67
67
+
binds: [["label", player, "track-title"]],
68
68
+
});
72
69
73
70
/**
74
71
* @param {import('types/service/mpris').MprisPlayer} player
75
72
* @param {import('types/widgets/label').Props=} props
76
73
*/
77
74
export const ArtistLabel = (player, props) =>
78
78
-
Widget.Label({
79
79
-
...props,
80
80
-
class_name: "artist",
81
81
-
binds: [["label", player, "track-artists", (a) => a.join(", ") || ""]],
82
82
-
});
75
75
+
Widget.Label({
76
76
+
...props,
77
77
+
class_name: "artist",
78
78
+
binds: [["label", player, "track-artists", (a) => a.join(", ") || ""]],
79
79
+
});
83
80
84
81
/**
85
82
* @param {import('types/service/mpris').MprisPlayer} player
86
83
* @param {import('types/widgets/icon').Props & { symbolic?: boolean }=} props
87
84
*/
88
85
export const PlayerIcon = (player, { symbolic = true, ...props } = {}) =>
89
89
-
Widget.Icon({
90
90
-
...props,
91
91
-
class_name: "player-icon",
92
92
-
tooltip_text: player.identity || "",
93
93
-
connections: [
94
94
-
[
95
95
-
player,
96
96
-
(icon) => {
97
97
-
const name = `${player.entry}${
98
98
-
symbolic ? "-symbolic" : ""
99
99
-
}`;
100
100
-
Utils.lookUpIcon(name)
101
101
-
? (icon.icon = name)
102
102
-
: (icon.icon = icons.mpris.fallback);
103
103
-
},
104
104
-
],
105
105
-
],
106
106
-
});
86
86
+
Widget.Icon({
87
87
+
...props,
88
88
+
class_name: "player-icon",
89
89
+
tooltip_text: player.identity || "",
90
90
+
connections: [
91
91
+
[
92
92
+
player,
93
93
+
(icon) => {
94
94
+
const name = `${player.entry}${symbolic ? "-symbolic" : ""}`;
95
95
+
Utils.lookUpIcon(name)
96
96
+
? (icon.icon = name)
97
97
+
: (icon.icon = icons.mpris.fallback);
98
98
+
},
99
99
+
],
100
100
+
],
101
101
+
});
107
102
108
103
/**
109
104
* @param {import('types/service/mpris').MprisPlayer} player
110
105
* @param {import('types/widgets/slider').SliderProps=} props
111
106
*/
112
107
export const PositionSlider = (player, props) =>
113
113
-
Widget.Slider({
114
114
-
...props,
115
115
-
class_name: "position-slider",
116
116
-
draw_value: false,
117
117
-
on_change: ({ value }) => {
118
118
-
player.position = player.length * value;
119
119
-
},
120
120
-
properties: [
121
121
-
[
122
122
-
"update",
123
123
-
(slider) => {
124
124
-
if (slider.dragging) return;
108
108
+
Widget.Slider({
109
109
+
...props,
110
110
+
class_name: "position-slider",
111
111
+
draw_value: false,
112
112
+
on_change: ({ value }) => {
113
113
+
player.position = player.length * value;
114
114
+
},
115
115
+
properties: [
116
116
+
[
117
117
+
"update",
118
118
+
(slider) => {
119
119
+
if (slider.dragging) return;
125
120
126
126
-
slider.visible = player.length > 0;
127
127
-
if (player.length > 0)
128
128
-
slider.value = player.position / player.length;
129
129
-
},
130
130
-
],
131
131
-
],
132
132
-
connections: [
133
133
-
[player, (s) => s._update(s)],
134
134
-
[player, (s) => s._update(s), "position"],
135
135
-
[1000, (s) => s._update(s)],
136
136
-
],
137
137
-
});
121
121
+
slider.visible = player.length > 0;
122
122
+
if (player.length > 0) slider.value = player.position / player.length;
123
123
+
},
124
124
+
],
125
125
+
],
126
126
+
connections: [
127
127
+
[player, (s) => s._update(s)],
128
128
+
[player, (s) => s._update(s), "position"],
129
129
+
[1000, (s) => s._update(s)],
130
130
+
],
131
131
+
});
138
132
139
133
/** @param {number} length */
140
134
function lengthStr(length) {
141
141
-
const min = Math.floor(length / 60);
142
142
-
const sec = Math.floor(length % 60);
143
143
-
const sec0 = sec < 10 ? "0" : "";
144
144
-
return `${min}:${sec0}${sec}`;
135
135
+
const min = Math.floor(length / 60);
136
136
+
const sec = Math.floor(length % 60);
137
137
+
const sec0 = sec < 10 ? "0" : "";
138
138
+
return `${min}:${sec0}${sec}`;
145
139
}
146
140
147
141
/** @param {import('types/service/mpris').MprisPlayer} player */
148
142
export const PositionLabel = (player) =>
149
149
-
Widget.Label({
150
150
-
properties: [
151
151
-
[
152
152
-
"update",
153
153
-
(label, time) => {
154
154
-
player.length > 0
155
155
-
? (label.label = lengthStr(time || player.position))
156
156
-
: (label.visible = !!player);
157
157
-
},
158
158
-
],
159
159
-
],
160
160
-
connections: [
161
161
-
[player, (l, time) => l._update(l, time), "position"],
162
162
-
[1000, (l) => l._update(l)],
163
163
-
],
164
164
-
});
143
143
+
Widget.Label({
144
144
+
properties: [
145
145
+
[
146
146
+
"update",
147
147
+
(label, time) => {
148
148
+
player.length > 0
149
149
+
? (label.label = lengthStr(time || player.position))
150
150
+
: (label.visible = !!player);
151
151
+
},
152
152
+
],
153
153
+
],
154
154
+
connections: [
155
155
+
[player, (l, time) => l._update(l, time), "position"],
156
156
+
[1000, (l) => l._update(l)],
157
157
+
],
158
158
+
});
165
159
166
160
/** @param {import('types/service/mpris').MprisPlayer} player */
167
161
export const LengthLabel = (player) =>
168
168
-
Widget.Label({
169
169
-
connections: [
170
170
-
[
171
171
-
player,
172
172
-
(label) => {
173
173
-
player.length > 0
174
174
-
? (label.label = lengthStr(player.length))
175
175
-
: (label.visible = !!player);
176
176
-
},
177
177
-
],
178
178
-
],
179
179
-
});
162
162
+
Widget.Label({
163
163
+
connections: [
164
164
+
[
165
165
+
player,
166
166
+
(label) => {
167
167
+
player.length > 0
168
168
+
? (label.label = lengthStr(player.length))
169
169
+
: (label.visible = !!player);
170
170
+
},
171
171
+
],
172
172
+
],
173
173
+
});
180
174
181
175
/** @param {import('types/service/mpris').MprisPlayer} player */
182
176
export const Slash = (player) =>
183
183
-
Widget.Label({
184
184
-
label: "/",
185
185
-
connections: [
186
186
-
[
187
187
-
player,
188
188
-
(label) => {
189
189
-
label.visible = player.length > 0;
190
190
-
},
191
191
-
],
192
192
-
],
193
193
-
});
177
177
+
Widget.Label({
178
178
+
label: "/",
179
179
+
connections: [
180
180
+
[
181
181
+
player,
182
182
+
(label) => {
183
183
+
label.visible = player.length > 0;
184
184
+
},
185
185
+
],
186
186
+
],
187
187
+
});
194
188
195
189
/**
196
190
* @param {Object} o
···
202
196
* @param {any} o.cantValue
203
197
*/
204
198
const PlayerButton = ({ player, items, onClick, prop, canProp, cantValue }) =>
205
205
-
Widget.Button({
206
206
-
child: Widget.Stack({
207
207
-
items,
208
208
-
binds: [["shown", player, prop, (p) => `${p}`]],
209
209
-
}),
210
210
-
on_clicked: player[onClick].bind(player),
211
211
-
binds: [["visible", player, canProp, (c) => c !== cantValue]],
212
212
-
});
199
199
+
Widget.Button({
200
200
+
child: Widget.Stack({
201
201
+
items,
202
202
+
binds: [["shown", player, prop, (p) => `${p}`]],
203
203
+
}),
204
204
+
on_clicked: player[onClick].bind(player),
205
205
+
binds: [["visible", player, canProp, (c) => c !== cantValue]],
206
206
+
});
213
207
214
208
/** @param {import('types/service/mpris').MprisPlayer} player */
215
209
export const ShuffleButton = (player) =>
216
216
-
PlayerButton({
217
217
-
player,
218
218
-
items: [
219
219
-
[
220
220
-
"true",
221
221
-
Widget.Label({
222
222
-
class_name: "shuffle enabled",
223
223
-
label: icons.mpris.shuffle.enabled,
224
224
-
}),
225
225
-
],
226
226
-
[
227
227
-
"false",
228
228
-
Widget.Label({
229
229
-
class_name: "shuffle disabled",
230
230
-
label: icons.mpris.shuffle.disabled,
231
231
-
}),
232
232
-
],
233
233
-
],
234
234
-
onClick: "shuffle",
235
235
-
prop: "shuffle-status",
236
236
-
canProp: "shuffle-status",
237
237
-
cantValue: null,
238
238
-
});
210
210
+
PlayerButton({
211
211
+
player,
212
212
+
items: [
213
213
+
[
214
214
+
"true",
215
215
+
Widget.Label({
216
216
+
class_name: "shuffle enabled",
217
217
+
label: icons.mpris.shuffle.enabled,
218
218
+
}),
219
219
+
],
220
220
+
[
221
221
+
"false",
222
222
+
Widget.Label({
223
223
+
class_name: "shuffle disabled",
224
224
+
label: icons.mpris.shuffle.disabled,
225
225
+
}),
226
226
+
],
227
227
+
],
228
228
+
onClick: "shuffle",
229
229
+
prop: "shuffle-status",
230
230
+
canProp: "shuffle-status",
231
231
+
cantValue: null,
232
232
+
});
239
233
240
234
/** @param {import('types/service/mpris').MprisPlayer} player */
241
235
export const LoopButton = (player) =>
242
242
-
PlayerButton({
243
243
-
player,
244
244
-
items: [
245
245
-
[
246
246
-
"None",
247
247
-
Widget.Label({
248
248
-
class_name: "loop none",
249
249
-
label: icons.mpris.loop.none,
250
250
-
}),
251
251
-
],
252
252
-
[
253
253
-
"Track",
254
254
-
Widget.Label({
255
255
-
class_name: "loop track",
256
256
-
label: icons.mpris.loop.track,
257
257
-
}),
258
258
-
],
259
259
-
[
260
260
-
"Playlist",
261
261
-
Widget.Label({
262
262
-
class_name: "loop playlist",
263
263
-
label: icons.mpris.loop.playlist,
264
264
-
}),
265
265
-
],
266
266
-
],
267
267
-
onClick: "loop",
268
268
-
prop: "loop-status",
269
269
-
canProp: "loop-status",
270
270
-
cantValue: null,
271
271
-
});
236
236
+
PlayerButton({
237
237
+
player,
238
238
+
items: [
239
239
+
[
240
240
+
"None",
241
241
+
Widget.Label({
242
242
+
class_name: "loop none",
243
243
+
label: icons.mpris.loop.none,
244
244
+
}),
245
245
+
],
246
246
+
[
247
247
+
"Track",
248
248
+
Widget.Label({
249
249
+
class_name: "loop track",
250
250
+
label: icons.mpris.loop.track,
251
251
+
}),
252
252
+
],
253
253
+
[
254
254
+
"Playlist",
255
255
+
Widget.Label({
256
256
+
class_name: "loop playlist",
257
257
+
label: icons.mpris.loop.playlist,
258
258
+
}),
259
259
+
],
260
260
+
],
261
261
+
onClick: "loop",
262
262
+
prop: "loop-status",
263
263
+
canProp: "loop-status",
264
264
+
cantValue: null,
265
265
+
});
272
266
273
267
/** @param {import('types/service/mpris').MprisPlayer} player */
274
268
export const PlayPauseButton = (player) =>
275
275
-
PlayerButton({
276
276
-
player,
277
277
-
items: [
278
278
-
[
279
279
-
"Playing",
280
280
-
Widget.Label({
281
281
-
class_name: "playing",
282
282
-
label: icons.mpris.playing,
283
283
-
}),
284
284
-
],
285
285
-
[
286
286
-
"Paused",
287
287
-
Widget.Label({
288
288
-
class_name: "paused",
289
289
-
label: icons.mpris.paused,
290
290
-
}),
291
291
-
],
292
292
-
[
293
293
-
"Stopped",
294
294
-
Widget.Label({
295
295
-
class_name: "stopped",
296
296
-
label: icons.mpris.stopped,
297
297
-
}),
298
298
-
],
299
299
-
],
300
300
-
onClick: "playPause",
301
301
-
prop: "play-back-status",
302
302
-
canProp: "can-play",
303
303
-
cantValue: false,
304
304
-
});
269
269
+
PlayerButton({
270
270
+
player,
271
271
+
items: [
272
272
+
[
273
273
+
"Playing",
274
274
+
Widget.Label({
275
275
+
class_name: "playing",
276
276
+
label: icons.mpris.playing,
277
277
+
}),
278
278
+
],
279
279
+
[
280
280
+
"Paused",
281
281
+
Widget.Label({
282
282
+
class_name: "paused",
283
283
+
label: icons.mpris.paused,
284
284
+
}),
285
285
+
],
286
286
+
[
287
287
+
"Stopped",
288
288
+
Widget.Label({
289
289
+
class_name: "stopped",
290
290
+
label: icons.mpris.stopped,
291
291
+
}),
292
292
+
],
293
293
+
],
294
294
+
onClick: "playPause",
295
295
+
prop: "play-back-status",
296
296
+
canProp: "can-play",
297
297
+
cantValue: false,
298
298
+
});
305
299
306
300
/** @param {import('types/service/mpris').MprisPlayer} player */
307
301
export const PreviousButton = (player) =>
308
308
-
PlayerButton({
309
309
-
player,
310
310
-
items: [
311
311
-
[
312
312
-
"true",
313
313
-
Widget.Label({
314
314
-
class_name: "previous",
315
315
-
label: icons.mpris.prev,
316
316
-
}),
317
317
-
],
318
318
-
],
319
319
-
onClick: "previous",
320
320
-
prop: "can-go-prev",
321
321
-
canProp: "can-go-prev",
322
322
-
cantValue: false,
323
323
-
});
302
302
+
PlayerButton({
303
303
+
player,
304
304
+
items: [
305
305
+
[
306
306
+
"true",
307
307
+
Widget.Label({
308
308
+
class_name: "previous",
309
309
+
label: icons.mpris.prev,
310
310
+
}),
311
311
+
],
312
312
+
],
313
313
+
onClick: "previous",
314
314
+
prop: "can-go-prev",
315
315
+
canProp: "can-go-prev",
316
316
+
cantValue: false,
317
317
+
});
324
318
325
319
/** @param {import('types/service/mpris').MprisPlayer} player */
326
320
export const NextButton = (player) =>
327
327
-
PlayerButton({
328
328
-
player,
329
329
-
items: [
330
330
-
[
331
331
-
"true",
332
332
-
Widget.Label({
333
333
-
class_name: "next",
334
334
-
label: icons.mpris.next,
335
335
-
}),
336
336
-
],
337
337
-
],
338
338
-
onClick: "next",
339
339
-
prop: "can-go-next",
340
340
-
canProp: "can-go-next",
341
341
-
cantValue: false,
342
342
-
});
321
321
+
PlayerButton({
322
322
+
player,
323
323
+
items: [
324
324
+
[
325
325
+
"true",
326
326
+
Widget.Label({
327
327
+
class_name: "next",
328
328
+
label: icons.mpris.next,
329
329
+
}),
330
330
+
],
331
331
+
],
332
332
+
onClick: "next",
333
333
+
prop: "can-go-next",
334
334
+
canProp: "can-go-next",
335
335
+
cantValue: false,
336
336
+
});
+197
-197
home/isabel/programs/configs/gui/bars/ags/config/options.js
···
13
13
import themes from "./themes.js";
14
14
15
15
export default {
16
16
-
reset: resetOptions,
17
17
-
values: getValues,
18
18
-
apply: apply,
16
16
+
reset: resetOptions,
17
17
+
values: getValues,
18
18
+
apply: apply,
19
19
+
20
20
+
spacing: Option(9),
21
21
+
padding: Option(8),
22
22
+
radii: Option(15),
19
23
20
20
-
spacing: Option(9),
21
21
-
padding: Option(8),
22
22
-
radii: Option(15),
24
24
+
popover_padding_multiplier: Option(1.4, {
25
25
+
category: "General",
26
26
+
note: "popover-padding: padding x this",
27
27
+
type: "float",
28
28
+
unit: "",
29
29
+
}),
23
30
24
24
-
popover_padding_multiplier: Option(1.4, {
25
25
-
category: "General",
26
26
-
note: "popover-padding: padding x this",
27
27
-
type: "float",
28
28
-
unit: "",
31
31
+
font: {
32
32
+
font: Option("Ubuntu Nerd Font", {
33
33
+
type: "font",
34
34
+
title: "Font",
35
35
+
scss: "font",
29
36
}),
37
37
+
mono: Option("Mononoki Nerd Font", {
38
38
+
title: "Monospaced Font",
39
39
+
scss: "mono-font",
40
40
+
}),
41
41
+
size: Option(13, {
42
42
+
scss: "font-size",
43
43
+
unit: "pt",
44
44
+
}),
45
45
+
},
30
46
31
31
-
font: {
32
32
-
font: Option("Ubuntu Nerd Font", {
33
33
-
type: "font",
34
34
-
title: "Font",
35
35
-
scss: "font",
36
36
-
}),
37
37
-
mono: Option("Mononoki Nerd Font", {
38
38
-
title: "Monospaced Font",
39
39
-
scss: "mono-font",
40
40
-
}),
41
41
-
size: Option(13, {
42
42
-
scss: "font-size",
43
43
-
unit: "pt",
44
44
-
}),
45
45
-
},
47
47
+
color: {
48
48
+
red: Option("#f38ba8", { scss: "red" }),
49
49
+
green: Option("#a6e3a1", { scss: "green" }),
50
50
+
yellow: Option("#f9e2af", { scss: "yellow" }),
51
51
+
blue: Option("#74c7ec", { scss: "blue" }),
52
52
+
magenta: Option("#cba6f7", { scss: "magenta" }),
53
53
+
teal: Option("#94e2d5", { scss: "teal" }),
54
54
+
orange: Option("#fab387", { scss: "orange" }),
55
55
+
},
46
56
47
47
-
color: {
48
48
-
red: Option("#f38ba8", { scss: "red" }),
49
49
-
green: Option("#a6e3a1", { scss: "green" }),
50
50
-
yellow: Option("#f9e2af", { scss: "yellow" }),
51
51
-
blue: Option("#74c7ec", { scss: "blue" }),
52
52
-
magenta: Option("#cba6f7", { scss: "magenta" }),
53
53
-
teal: Option("#94e2d5", { scss: "teal" }),
54
54
-
orange: Option("#fab387", { scss: "orange" }),
55
55
-
},
57
57
+
theme: {
58
58
+
name: Option(themes[0].name, {
59
59
+
category: "exclude",
60
60
+
note: "Name to show as active in quicktoggles",
61
61
+
}),
56
62
57
57
-
theme: {
58
58
-
name: Option(themes[0].name, {
59
59
-
category: "exclude",
60
60
-
note: "Name to show as active in quicktoggles",
61
61
-
}),
63
63
+
icon: Option(themes[0].icon, {
64
64
+
category: "exclude",
65
65
+
note: "Icon to show as active in quicktoggles",
66
66
+
}),
62
67
63
63
-
icon: Option(themes[0].icon, {
64
64
-
category: "exclude",
65
65
-
note: "Icon to show as active in quicktoggles",
66
66
-
}),
68
68
+
scheme: Option("dark", {
69
69
+
enums: ["dark", "light"],
70
70
+
type: "enum",
71
71
+
note: "Color scheme to set on Gtk apps: 'ligth' or 'dark'",
72
72
+
title: "Color Scheme",
73
73
+
scss: "color-scheme",
74
74
+
}),
67
75
68
68
-
scheme: Option("dark", {
69
69
-
enums: ["dark", "light"],
70
70
-
type: "enum",
71
71
-
note: "Color scheme to set on Gtk apps: 'ligth' or 'dark'",
72
72
-
title: "Color Scheme",
73
73
-
scss: "color-scheme",
74
74
-
}),
76
76
+
bg: Option("#1e1e2e", {
77
77
+
title: "Background Color",
78
78
+
scss: "bg-color",
79
79
+
}),
80
80
+
fg: Option("#cdd6f4", {
81
81
+
title: "Foreground Color",
82
82
+
scss: "fg-color",
83
83
+
}),
75
84
76
76
-
bg: Option("#1e1e2e", {
77
77
-
title: "Background Color",
78
78
-
scss: "bg-color",
79
79
-
}),
80
80
-
fg: Option("#cdd6f4", {
81
81
-
title: "Foreground Color",
82
82
-
scss: "fg-color",
83
83
-
}),
84
84
-
85
85
-
accent: {
86
86
-
accent: Option("$blue", {
87
87
-
category: "Theme",
88
88
-
title: "Accent Color",
89
89
-
scss: "accent",
90
90
-
}),
91
91
-
fg: Option("$bg-color", {
92
92
-
category: "Theme",
93
93
-
title: "Accent Foreground Color",
94
94
-
scss: "accent-fg",
95
95
-
}),
96
96
-
gradient: Option("to right, $accent, lighten($accent, 6%)", {
97
97
-
category: "Theme",
98
98
-
title: "Accent Linear Gradient",
99
99
-
scss: "accent-gradient",
100
100
-
}),
101
101
-
},
102
102
-
103
103
-
widget: {
104
104
-
bg: Option("$fg_color", {
105
105
-
category: "Theme",
106
106
-
title: "Widget Background Color",
107
107
-
scss: "_widget-bg",
108
108
-
}),
109
109
-
opacity: Option(94, {
110
110
-
category: "Theme",
111
111
-
title: "Widget Background Opacity",
112
112
-
unit: "",
113
113
-
scss: "widget-opacity",
114
114
-
}),
115
115
-
},
85
85
+
accent: {
86
86
+
accent: Option("$blue", {
87
87
+
category: "Theme",
88
88
+
title: "Accent Color",
89
89
+
scss: "accent",
90
90
+
}),
91
91
+
fg: Option("$bg-color", {
92
92
+
category: "Theme",
93
93
+
title: "Accent Foreground Color",
94
94
+
scss: "accent-fg",
95
95
+
}),
96
96
+
gradient: Option("to right, $accent, lighten($accent, 6%)", {
97
97
+
category: "Theme",
98
98
+
title: "Accent Linear Gradient",
99
99
+
scss: "accent-gradient",
100
100
+
}),
116
101
},
117
102
118
118
-
border: {
119
119
-
color: Option("$fg_color", {
120
120
-
category: "Border",
121
121
-
title: "Border Color",
122
122
-
scss: "_border-color",
123
123
-
}),
124
124
-
opacity: Option(97, {
125
125
-
category: "Border",
126
126
-
title: "Border Opacity",
127
127
-
unit: "",
128
128
-
}),
129
129
-
width: Option(1, {
130
130
-
category: "Border",
131
131
-
title: "Border Width",
132
132
-
}),
103
103
+
widget: {
104
104
+
bg: Option("$fg_color", {
105
105
+
category: "Theme",
106
106
+
title: "Widget Background Color",
107
107
+
scss: "_widget-bg",
108
108
+
}),
109
109
+
opacity: Option(94, {
110
110
+
category: "Theme",
111
111
+
title: "Widget Background Opacity",
112
112
+
unit: "",
113
113
+
scss: "widget-opacity",
114
114
+
}),
133
115
},
116
116
+
},
134
117
135
135
-
shadow: Option("rgba(0, 0, 0, .6)"),
136
136
-
drop_shadow: Option(true, { scss: "drop-shadow" }),
118
118
+
border: {
119
119
+
color: Option("$fg_color", {
120
120
+
category: "Border",
121
121
+
title: "Border Color",
122
122
+
scss: "_border-color",
123
123
+
}),
124
124
+
opacity: Option(97, {
125
125
+
category: "Border",
126
126
+
title: "Border Opacity",
127
127
+
unit: "",
128
128
+
}),
129
129
+
width: Option(1, {
130
130
+
category: "Border",
131
131
+
title: "Border Width",
132
132
+
}),
133
133
+
},
137
134
138
138
-
hypr: {
139
139
-
wm_gaps: Option(8, {
140
140
-
category: "General",
141
141
-
scss: "wm-gaps",
142
142
-
note: "wm-gaps",
143
143
-
type: "float",
144
144
-
unit: "",
145
145
-
}),
146
146
-
},
135
135
+
shadow: Option("rgba(0, 0, 0, .6)"),
136
136
+
drop_shadow: Option(true, { scss: "drop-shadow" }),
147
137
148
148
-
transition: Option(200, {
149
149
-
category: "exclude",
150
150
-
note: "Transition time on aminations in ms, e.g on hover",
151
151
-
unit: "ms",
138
138
+
hypr: {
139
139
+
wm_gaps: Option(8, {
140
140
+
category: "General",
141
141
+
scss: "wm-gaps",
142
142
+
note: "wm-gaps",
143
143
+
type: "float",
144
144
+
unit: "",
152
145
}),
146
146
+
},
153
147
154
154
-
applauncher: {
155
155
-
width: Option(500),
156
156
-
height: Option(500),
157
157
-
icon_size: Option(52),
158
158
-
},
148
148
+
transition: Option(200, {
149
149
+
category: "exclude",
150
150
+
note: "Transition time on aminations in ms, e.g on hover",
151
151
+
unit: "ms",
152
152
+
}),
159
153
160
160
-
bar: {
161
161
-
position: Option("top", {
162
162
-
enums: ["top", "bottom"],
163
163
-
type: "enum",
164
164
-
}),
165
165
-
style: Option("floating", {
166
166
-
enums: ["floating", "normal", "separated"],
167
167
-
type: "enum",
168
168
-
}),
169
169
-
flat_buttons: Option(true, { scss: "bar-flat-buttons" }),
170
170
-
separators: Option(true),
171
171
-
icon: Option("distro-icon", {
172
172
-
note: '"distro-icon" or a single font',
173
173
-
}),
174
174
-
},
154
154
+
applauncher: {
155
155
+
width: Option(500),
156
156
+
height: Option(500),
157
157
+
icon_size: Option(52),
158
158
+
},
175
159
176
176
-
battery: {
177
177
-
show_percentage: Option(true, { noReload: false, category: "exclude" }),
178
178
-
bar: {
179
179
-
width: Option(70, { category: "Bar" }),
180
180
-
height: Option(14, { category: "Bar" }),
181
181
-
},
182
182
-
low: Option(25, { category: "Bar" }),
183
183
-
medium: Option(50, { category: "Bar" }),
184
184
-
},
160
160
+
bar: {
161
161
+
position: Option("top", {
162
162
+
enums: ["top", "bottom"],
163
163
+
type: "enum",
164
164
+
}),
165
165
+
style: Option("floating", {
166
166
+
enums: ["floating", "normal", "separated"],
167
167
+
type: "enum",
168
168
+
}),
169
169
+
flat_buttons: Option(true, { scss: "bar-flat-buttons" }),
170
170
+
separators: Option(true),
171
171
+
icon: Option("distro-icon", {
172
172
+
note: '"distro-icon" or a single font',
173
173
+
}),
174
174
+
},
185
175
186
186
-
desktop: {
187
187
-
avatar: Option(``, {
188
188
-
format: (v) => `"${v}"`,
189
189
-
}),
190
190
-
wallpaper: {
191
191
-
fg: Option("#fff", { scss: "wallpaper-fg" }),
192
192
-
img: Option(themes[0].options["desktop.wallpaper.img"], {
193
193
-
scssFormat: (v) => `"${v}"`,
194
194
-
type: "img",
195
195
-
}),
196
196
-
},
197
197
-
avatar: Option(`/home/${USER}/media/pictures/pfps/avatar`, {
198
198
-
scssFormat: (v) => `"${v}"`,
199
199
-
type: "img",
200
200
-
note: "displayed in quicksettings and locksreen",
201
201
-
}),
202
202
-
drop_shadow: Option(true, { scss: "drop-shadow" }),
203
203
-
shadow: Option("rgba(0, 0, 0, .6)", { scss: "shadow" }),
176
176
+
battery: {
177
177
+
show_percentage: Option(true, { noReload: false, category: "exclude" }),
178
178
+
bar: {
179
179
+
width: Option(70, { category: "Bar" }),
180
180
+
height: Option(14, { category: "Bar" }),
204
181
},
182
182
+
low: Option(25, { category: "Bar" }),
183
183
+
medium: Option(50, { category: "Bar" }),
184
184
+
},
205
185
206
206
-
notifications: {
207
207
-
black_list: Option(["Spotify"], { note: "app-name | entry" }),
208
208
-
position: Option(["top"], { note: "anchor" }),
209
209
-
width: Option(450),
186
186
+
desktop: {
187
187
+
avatar: Option(``, {
188
188
+
format: (v) => `"${v}"`,
189
189
+
}),
190
190
+
wallpaper: {
191
191
+
fg: Option("#fff", { scss: "wallpaper-fg" }),
192
192
+
img: Option(themes[0].options["desktop.wallpaper.img"], {
193
193
+
scssFormat: (v) => `"${v}"`,
194
194
+
type: "img",
195
195
+
}),
210
196
},
197
197
+
avatar: Option(`/home/${USER}/media/pictures/pfps/avatar`, {
198
198
+
scssFormat: (v) => `"${v}"`,
199
199
+
type: "img",
200
200
+
note: "displayed in quicksettings and locksreen",
201
201
+
}),
202
202
+
drop_shadow: Option(true, { scss: "drop-shadow" }),
203
203
+
shadow: Option("rgba(0, 0, 0, .6)", { scss: "shadow" }),
204
204
+
},
211
205
212
212
-
dashboard: {
213
213
-
sys_info_size: Option(70, {
214
214
-
category: "Desktop",
215
215
-
scss: "sys-info-size",
216
216
-
}),
217
217
-
},
206
206
+
notifications: {
207
207
+
black_list: Option(["Spotify"], { note: "app-name | entry" }),
208
208
+
position: Option(["top"], { note: "anchor" }),
209
209
+
width: Option(450),
210
210
+
},
218
211
219
219
-
mpris: {
220
220
-
black_list: Option(["Caprine"], {
221
221
-
category: "Bar",
222
222
-
title: "List of blacklisted mpris players",
223
223
-
note: "filters for bus-name, name, identity, entry",
224
224
-
}),
225
225
-
preferred: Option("spotify", {
226
226
-
category: "Bar",
227
227
-
title: "Preferred player",
228
228
-
}),
229
229
-
},
212
212
+
dashboard: {
213
213
+
sys_info_size: Option(70, {
214
214
+
category: "Desktop",
215
215
+
scss: "sys-info-size",
216
216
+
}),
217
217
+
},
230
218
231
231
-
workspaces: Option(7, {
232
232
-
category: "Bar",
233
233
-
title: "No. workspaces on bar and overview",
234
234
-
note: "Set it to 0 to make it dynamic",
219
219
+
mpris: {
220
220
+
black_list: Option(["Caprine"], {
221
221
+
category: "Bar",
222
222
+
title: "List of blacklisted mpris players",
223
223
+
note: "filters for bus-name, name, identity, entry",
235
224
}),
225
225
+
preferred: Option("spotify", {
226
226
+
category: "Bar",
227
227
+
title: "Preferred player",
228
228
+
}),
229
229
+
},
236
230
237
237
-
// path to read temperature from
238
238
-
temperature: "/sys/class/thermal/thermal_zone0/temp",
231
231
+
workspaces: Option(7, {
232
232
+
category: "Bar",
233
233
+
title: "No. workspaces on bar and overview",
234
234
+
note: "Set it to 0 to make it dynamic",
235
235
+
}),
239
236
240
240
-
// at what intervals should cpu, ram, temperature refresh
241
241
-
systemFetchInterval: 5000,
237
237
+
// path to read temperature from
238
238
+
temperature: "/sys/class/thermal/thermal_zone0/temp",
239
239
+
240
240
+
// at what intervals should cpu, ram, temperature refresh
241
241
+
systemFetchInterval: 5000,
242
242
};
+84
-84
home/isabel/programs/configs/gui/bars/ags/config/scss/common/button.scss
···
1
1
@mixin button-focus() {
2
2
-
box-shadow: inset 0 0 0 $border-width $accent;
3
3
-
background-color: $hover;
4
4
-
color: $hover-fg;
2
2
+
box-shadow: inset 0 0 0 $border-width $accent;
3
3
+
background-color: $hover;
4
4
+
color: $hover-fg;
5
5
}
6
6
7
7
@mixin button-hover() {
8
8
-
box-shadow: inset 0 0 0 $border-width $border-color;
9
9
-
background-color: $hover;
10
10
-
color: $hover-fg;
8
8
+
box-shadow: inset 0 0 0 $border-width $border-color;
9
9
+
background-color: $hover;
10
10
+
color: $hover-fg;
11
11
}
12
12
13
13
@mixin button-active() {
14
14
-
box-shadow: inset 0 0 0 $border-width $border-color;
15
15
-
background-image: $active-gradient;
16
16
-
background-color: $accent;
17
17
-
color: $accent-fg;
14
14
+
box-shadow: inset 0 0 0 $border-width $border-color;
15
15
+
background-image: $active-gradient;
16
16
+
background-color: $accent;
17
17
+
color: $accent-fg;
18
18
}
19
19
20
20
@mixin button-disabled() {
21
21
-
box-shadow: none;
22
22
-
background-color: transparent;
23
23
-
color: transparentize($fg-color, 0.7);
21
21
+
box-shadow: none;
22
22
+
background-color: transparent;
23
23
+
color: transparentize($fg-color, 0.7);
24
24
}
25
25
26
26
@mixin button($flat: false, $reactive: true, $radii: $radii, $focusable: true) {
27
27
-
@include unset;
28
28
-
transition: $transition;
29
29
-
border-radius: $radii;
30
30
-
color: $fg-color;
27
27
+
@include unset;
28
28
+
transition: $transition;
29
29
+
border-radius: $radii;
30
30
+
color: $fg-color;
31
31
32
32
-
@if $flat {
33
33
-
background-color: transparent;
34
34
-
background-image: none;
35
35
-
box-shadow: none;
36
36
-
} @else {
37
37
-
background-color: $widget-bg;
38
38
-
box-shadow: inset 0 0 0 $border-width $border-color;
39
39
-
}
32
32
+
@if $flat {
33
33
+
background-color: transparent;
34
34
+
background-image: none;
35
35
+
box-shadow: none;
36
36
+
} @else {
37
37
+
background-color: $widget-bg;
38
38
+
box-shadow: inset 0 0 0 $border-width $border-color;
39
39
+
}
40
40
41
41
-
@if $reactive {
42
42
-
@if $focusable {
43
43
-
&:focus {
44
44
-
@include button-focus;
45
45
-
}
46
46
-
}
41
41
+
@if $reactive {
42
42
+
@if $focusable {
43
43
+
&:focus {
44
44
+
@include button-focus;
45
45
+
}
46
46
+
}
47
47
48
48
-
&:hover {
49
49
-
@include button-hover;
50
50
-
}
48
48
+
&:hover {
49
49
+
@include button-hover;
50
50
+
}
51
51
52
52
-
&:active,
53
53
-
&.on,
54
54
-
&.active,
55
55
-
&:checked {
56
56
-
@include button-active;
52
52
+
&:active,
53
53
+
&.on,
54
54
+
&.active,
55
55
+
&:checked {
56
56
+
@include button-active;
57
57
58
58
-
&:hover {
59
59
-
box-shadow:
60
60
-
inset 0 0 0 $border-width $border-color,
61
61
-
inset 0 0 0 99px $hover;
62
62
-
}
63
63
-
}
64
64
-
}
58
58
+
&:hover {
59
59
+
box-shadow:
60
60
+
inset 0 0 0 $border-width $border-color,
61
61
+
inset 0 0 0 99px $hover;
62
62
+
}
63
63
+
}
64
64
+
}
65
65
66
66
-
&:disabled {
67
67
-
@include button-disabled;
68
68
-
}
66
66
+
&:disabled {
67
67
+
@include button-disabled;
68
68
+
}
69
69
}
70
70
71
71
@mixin accs-button($flat: false, $reactive: true) {
72
72
-
@include button($flat: true, $reactive: false, $focusable: false);
73
73
-
color: $fg-color;
72
72
+
@include button($flat: true, $reactive: false, $focusable: false);
73
73
+
color: $fg-color;
74
74
75
75
-
> * {
76
76
-
border-radius: $radii;
77
77
-
transition: $transition;
75
75
+
> * {
76
76
+
border-radius: $radii;
77
77
+
transition: $transition;
78
78
79
79
-
@if $flat {
80
80
-
background-color: transparent;
81
81
-
box-shadow: none;
82
82
-
} @else {
83
83
-
background-color: $widget-bg;
84
84
-
box-shadow: inset 0 0 0 $border-width $border-color;
85
85
-
}
86
86
-
}
79
79
+
@if $flat {
80
80
+
background-color: transparent;
81
81
+
box-shadow: none;
82
82
+
} @else {
83
83
+
background-color: $widget-bg;
84
84
+
box-shadow: inset 0 0 0 $border-width $border-color;
85
85
+
}
86
86
+
}
87
87
88
88
-
@if $reactive {
89
89
-
&:focus > *,
90
90
-
&.focused > * {
91
91
-
@include button-focus;
92
92
-
}
88
88
+
@if $reactive {
89
89
+
&:focus > *,
90
90
+
&.focused > * {
91
91
+
@include button-focus;
92
92
+
}
93
93
94
94
-
&:hover > * {
95
95
-
@include button-hover;
96
96
-
}
94
94
+
&:hover > * {
95
95
+
@include button-hover;
96
96
+
}
97
97
98
98
-
&:active,
99
99
-
&.active,
100
100
-
&.on,
101
101
-
&:checked {
102
102
-
> * {
103
103
-
@include button-active;
104
104
-
}
98
98
+
&:active,
99
99
+
&.active,
100
100
+
&.on,
101
101
+
&:checked {
102
102
+
> * {
103
103
+
@include button-active;
104
104
+
}
105
105
106
106
-
&:hover > * {
107
107
-
box-shadow:
108
108
-
inset 0 0 0 $border-width $border-color,
109
109
-
inset 0 0 0 99px $hover;
110
110
-
}
111
111
-
}
112
112
-
}
106
106
+
&:hover > * {
107
107
+
box-shadow:
108
108
+
inset 0 0 0 $border-width $border-color,
109
109
+
inset 0 0 0 99px $hover;
110
110
+
}
111
111
+
}
112
112
+
}
113
113
}
+10
-10
home/isabel/programs/configs/gui/bars/ags/config/scss/common/floating-widget.scss
···
1
1
@mixin floating-widget {
2
2
-
@if $drop-shadow {
3
3
-
box-shadow: 0 0 5px 0 $shadow;
4
4
-
}
2
2
+
@if $drop-shadow {
3
3
+
box-shadow: 0 0 5px 0 $shadow;
4
4
+
}
5
5
6
6
-
transition: $transition;
7
7
-
margin: max($padding, 8px);
8
8
-
border: $border-width solid $popover-border-color;
9
9
-
background-color: $bg-color;
10
10
-
color: $fg-color;
11
11
-
border-radius: $radii;
12
12
-
padding: $popover-padding;
6
6
+
transition: $transition;
7
7
+
margin: max($padding, 8px);
8
8
+
border: $border-width solid $popover-border-color;
9
9
+
background-color: $bg-color;
10
10
+
color: $fg-color;
11
11
+
border-radius: $radii;
12
12
+
padding: $popover-padding;
13
13
}
+12
-12
home/isabel/programs/configs/gui/bars/ags/config/scss/common/hidden.scss
···
1
1
@mixin hidden {
2
2
-
background-color: transparent;
3
3
-
background-image: none;
4
4
-
border-color: transparent;
5
5
-
box-shadow: none;
6
6
-
-gtk-icon-transform: scale(0);
2
2
+
background-color: transparent;
3
3
+
background-image: none;
4
4
+
border-color: transparent;
5
5
+
box-shadow: none;
6
6
+
-gtk-icon-transform: scale(0);
7
7
8
8
-
* {
9
9
-
background-color: transparent;
10
10
-
background-image: none;
11
11
-
border-color: transparent;
12
12
-
box-shadow: none;
13
13
-
-gtk-icon-transform: scale(0);
14
14
-
}
8
8
+
* {
9
9
+
background-color: transparent;
10
10
+
background-image: none;
11
11
+
border-color: transparent;
12
12
+
box-shadow: none;
13
13
+
-gtk-icon-transform: scale(0);
14
14
+
}
15
15
}
+24
-24
home/isabel/programs/configs/gui/bars/ags/config/scss/common/menu.scss
···
1
1
window.popup {
2
2
-
> * {
3
3
-
border: none;
4
4
-
box-shadow: none;
5
5
-
}
2
2
+
> * {
3
3
+
border: none;
4
4
+
box-shadow: none;
5
5
+
}
6
6
7
7
-
menu {
8
8
-
border-radius: $popover-radius;
9
9
-
background-color: $bg-color;
10
10
-
padding: $popover-padding;
11
11
-
border: $border-width solid $popover-border-color;
7
7
+
menu {
8
8
+
border-radius: $popover-radius;
9
9
+
background-color: $bg-color;
10
10
+
padding: $popover-padding;
11
11
+
border: $border-width solid $popover-border-color;
12
12
13
13
-
separator {
14
14
-
background-color: $border-color;
15
15
-
}
13
13
+
separator {
14
14
+
background-color: $border-color;
15
15
+
}
16
16
17
17
-
menuitem {
18
18
-
@include button;
19
19
-
padding: $spacing/2;
20
20
-
margin: $spacing/2 0;
17
17
+
menuitem {
18
18
+
@include button;
19
19
+
padding: $spacing/2;
20
20
+
margin: $spacing/2 0;
21
21
22
22
-
&:first-child {
23
23
-
margin-top: 0;
24
24
-
}
22
22
+
&:first-child {
23
23
+
margin-top: 0;
24
24
+
}
25
25
26
26
-
&:last-child {
27
27
-
margin-bottom: 0;
28
28
-
}
29
29
-
}
30
30
-
}
26
26
+
&:last-child {
27
27
+
margin-bottom: 0;
28
28
+
}
29
29
+
}
30
30
+
}
31
31
}
+22
-22
home/isabel/programs/configs/gui/bars/ags/config/scss/common/scrollable.scss
···
1
1
@mixin scrollable {
2
2
-
scrollbar,
3
3
-
scrollbar * {
4
4
-
all: unset;
5
5
-
}
2
2
+
scrollbar,
3
3
+
scrollbar * {
4
4
+
all: unset;
5
5
+
}
6
6
7
7
-
scrollbar.vertical {
8
8
-
transition: $transition;
9
9
-
background-color: transparentize($bg-color, 0.7);
7
7
+
scrollbar.vertical {
8
8
+
transition: $transition;
9
9
+
background-color: transparentize($bg-color, 0.7);
10
10
11
11
-
&:hover {
12
12
-
background-color: transparentize($bg-color, 0.3);
11
11
+
&:hover {
12
12
+
background-color: transparentize($bg-color, 0.3);
13
13
14
14
-
slider {
15
15
-
background-color: transparentize($fg-color, 0.3);
16
16
-
min-width: 0.6em;
17
17
-
}
18
18
-
}
19
19
-
}
14
14
+
slider {
15
15
+
background-color: transparentize($fg-color, 0.3);
16
16
+
min-width: 0.6em;
17
17
+
}
18
18
+
}
19
19
+
}
20
20
21
21
-
scrollbar.vertical slider {
22
22
-
background-color: transparentize($fg-color, 0.5);
23
23
-
border-radius: $radii;
24
24
-
min-width: 0.4em;
25
25
-
min-height: 2em;
26
26
-
transition: $transition;
27
27
-
}
21
21
+
scrollbar.vertical slider {
22
22
+
background-color: transparentize($fg-color, 0.5);
23
23
+
border-radius: $radii;
24
24
+
min-width: 0.4em;
25
25
+
min-height: 2em;
26
26
+
transition: $transition;
27
27
+
}
28
28
}
+65
-65
home/isabel/programs/configs/gui/bars/ags/config/scss/common/slider.scss
···
1
1
@import "./unset";
2
2
3
3
@mixin slider(
4
4
-
$width: 0.7em,
5
5
-
$slider-width: 0.5em,
6
6
-
$gradient: $active-gradient,
7
7
-
$slider: true,
8
8
-
$focusable: true,
9
9
-
$radii: $radii
4
4
+
$width: 0.7em,
5
5
+
$slider-width: 0.5em,
6
6
+
$gradient: $active-gradient,
7
7
+
$slider: true,
8
8
+
$focusable: true,
9
9
+
$radii: $radii
10
10
) {
11
11
-
@include unset($rec: true);
11
11
+
@include unset($rec: true);
12
12
13
13
-
trough {
14
14
-
transition: $transition;
15
15
-
border-radius: $radii;
16
16
-
border: $border;
17
17
-
background-color: $widget-bg;
18
18
-
min-height: $width;
19
19
-
min-width: $width;
13
13
+
trough {
14
14
+
transition: $transition;
15
15
+
border-radius: $radii;
16
16
+
border: $border;
17
17
+
background-color: $widget-bg;
18
18
+
min-height: $width;
19
19
+
min-width: $width;
20
20
21
21
-
highlight,
22
22
-
progress {
23
23
-
border-radius: max($radii - $border-width, 0);
24
24
-
background-image: $gradient;
25
25
-
min-height: $width;
26
26
-
min-width: $width;
27
27
-
}
28
28
-
}
21
21
+
highlight,
22
22
+
progress {
23
23
+
border-radius: max($radii - $border-width, 0);
24
24
+
background-image: $gradient;
25
25
+
min-height: $width;
26
26
+
min-width: $width;
27
27
+
}
28
28
+
}
29
29
30
30
-
slider {
31
31
-
box-shadow: none;
32
32
-
background-color: transparent;
33
33
-
border: $border-width solid transparent;
34
34
-
transition: $transition;
35
35
-
border-radius: $radii;
36
36
-
min-height: $width;
37
37
-
min-width: $width;
38
38
-
margin: -$slider-width;
39
39
-
}
30
30
+
slider {
31
31
+
box-shadow: none;
32
32
+
background-color: transparent;
33
33
+
border: $border-width solid transparent;
34
34
+
transition: $transition;
35
35
+
border-radius: $radii;
36
36
+
min-height: $width;
37
37
+
min-width: $width;
38
38
+
margin: -$slider-width;
39
39
+
}
40
40
41
41
-
&:hover {
42
42
-
trough {
43
43
-
background-color: $hover;
44
44
-
}
41
41
+
&:hover {
42
42
+
trough {
43
43
+
background-color: $hover;
44
44
+
}
45
45
46
46
-
slider {
47
47
-
@if $slider {
48
48
-
background-color: $fg-color;
49
49
-
border-color: $border-color;
46
46
+
slider {
47
47
+
@if $slider {
48
48
+
background-color: $fg-color;
49
49
+
border-color: $border-color;
50
50
51
51
-
@if $drop-shadow {
52
52
-
box-shadow: 0 0 3px 0 $shadow;
53
53
-
}
54
54
-
}
55
55
-
}
56
56
-
}
51
51
+
@if $drop-shadow {
52
52
+
box-shadow: 0 0 3px 0 $shadow;
53
53
+
}
54
54
+
}
55
55
+
}
56
56
+
}
57
57
58
58
-
&:disabled {
59
59
-
highlight,
60
60
-
progress {
61
61
-
background-color: transparentize($fg-color, 0.4);
62
62
-
background-image: none;
63
63
-
}
64
64
-
}
58
58
+
&:disabled {
59
59
+
highlight,
60
60
+
progress {
61
61
+
background-color: transparentize($fg-color, 0.4);
62
62
+
background-image: none;
63
63
+
}
64
64
+
}
65
65
66
66
-
@if $focusable {
67
67
-
trough:focus {
68
68
-
background-color: $hover;
69
69
-
box-shadow: inset 0 0 0 $border-width $accent;
66
66
+
@if $focusable {
67
67
+
trough:focus {
68
68
+
background-color: $hover;
69
69
+
box-shadow: inset 0 0 0 $border-width $accent;
70
70
71
71
-
slider {
72
72
-
@if $slider {
73
73
-
background-color: $fg-color;
74
74
-
box-shadow: inset 0 0 0 $border-width $accent;
75
75
-
}
76
76
-
}
77
77
-
}
78
78
-
}
71
71
+
slider {
72
72
+
@if $slider {
73
73
+
background-color: $fg-color;
74
74
+
box-shadow: inset 0 0 0 $border-width $accent;
75
75
+
}
76
76
+
}
77
77
+
}
78
78
+
}
79
79
}
+40
-40
home/isabel/programs/configs/gui/bars/ags/config/scss/common/spacing.scss
···
1
1
@mixin spacing($multiplier: 1, $spacing: $spacing, $rec: false) {
2
2
-
&.horizontal > * {
3
3
-
margin: 0 $spacing * $multiplier / 2;
2
2
+
&.horizontal > * {
3
3
+
margin: 0 $spacing * $multiplier / 2;
4
4
5
5
-
&:first-child {
6
6
-
margin-left: 0;
7
7
-
}
5
5
+
&:first-child {
6
6
+
margin-left: 0;
7
7
+
}
8
8
9
9
-
&:last-child {
10
10
-
margin-right: 0;
11
11
-
}
12
12
-
}
9
9
+
&:last-child {
10
10
+
margin-right: 0;
11
11
+
}
12
12
+
}
13
13
14
14
-
&.vertical > * {
15
15
-
margin: $spacing * $multiplier / 2 0;
14
14
+
&.vertical > * {
15
15
+
margin: $spacing * $multiplier / 2 0;
16
16
17
17
-
&:first-child {
18
18
-
margin-top: 0;
19
19
-
}
17
17
+
&:first-child {
18
18
+
margin-top: 0;
19
19
+
}
20
20
21
21
-
&:last-child {
22
22
-
margin-bottom: 0;
23
23
-
}
24
24
-
}
21
21
+
&:last-child {
22
22
+
margin-bottom: 0;
23
23
+
}
24
24
+
}
25
25
26
26
-
@if $rec {
27
27
-
box {
28
28
-
&.horizontal > * {
29
29
-
margin: 0 $spacing * $multiplier / 2;
26
26
+
@if $rec {
27
27
+
box {
28
28
+
&.horizontal > * {
29
29
+
margin: 0 $spacing * $multiplier / 2;
30
30
31
31
-
&:first-child {
32
32
-
margin-left: 0;
33
33
-
}
31
31
+
&:first-child {
32
32
+
margin-left: 0;
33
33
+
}
34
34
35
35
-
&:last-child {
36
36
-
margin-right: 0;
37
37
-
}
38
38
-
}
35
35
+
&:last-child {
36
36
+
margin-right: 0;
37
37
+
}
38
38
+
}
39
39
40
40
-
&.vertical > * {
41
41
-
margin: $spacing * $multiplier / 2 0;
40
40
+
&.vertical > * {
41
41
+
margin: $spacing * $multiplier / 2 0;
42
42
43
43
-
&:first-child {
44
44
-
margin-top: 0;
45
45
-
}
43
43
+
&:first-child {
44
44
+
margin-top: 0;
45
45
+
}
46
46
47
47
-
&:last-child {
48
48
-
margin-bottom: 0;
49
49
-
}
50
50
-
}
51
51
-
}
52
52
-
}
47
47
+
&:last-child {
48
48
+
margin-bottom: 0;
49
49
+
}
50
50
+
}
51
51
+
}
52
52
+
}
53
53
}
+10
-10
home/isabel/programs/configs/gui/bars/ags/config/scss/common/switch.scss
···
1
1
@import "./button";
2
2
3
3
@mixin switch {
4
4
-
@include button;
4
4
+
@include button;
5
5
6
6
-
slider {
7
7
-
background-color: $fg-color;
8
8
-
border-radius: $radii;
9
9
-
min-width: 24px;
10
10
-
min-height: 24px;
11
11
-
}
6
6
+
slider {
7
7
+
background-color: $fg-color;
8
8
+
border-radius: $radii;
9
9
+
min-width: 24px;
10
10
+
min-height: 24px;
11
11
+
}
12
12
13
13
-
image {
14
14
-
color: transparent;
15
15
-
}
13
13
+
image {
14
14
+
color: transparent;
15
15
+
}
16
16
}
+10
-10
home/isabel/programs/configs/gui/bars/ags/config/scss/common/text-border.scss
···
1
1
@mixin text-border {
2
2
-
text-shadow:
3
3
-
-1 * $border-width -1 * $border-width 0 $border-color,
4
4
-
$border-width $border-width 0 $border-color,
5
5
-
-1 * $border-width $border-width 0 $border-color,
6
6
-
$border-width -1 * $border-width 0 $border-color;
2
2
+
text-shadow:
3
3
+
-1 * $border-width -1 * $border-width 0 $border-color,
4
4
+
$border-width $border-width 0 $border-color,
5
5
+
-1 * $border-width $border-width 0 $border-color,
6
6
+
$border-width -1 * $border-width 0 $border-color;
7
7
8
8
-
-gtk-icon-shadow:
9
9
-
-1 * $border-width -1 * $border-width 0 $border-color,
10
10
-
$border-width $border-width 0 $border-color,
11
11
-
-1 * $border-width $border-width 0 $border-color,
12
12
-
$border-width -1 * $border-width 0 $border-color;
8
8
+
-gtk-icon-shadow:
9
9
+
-1 * $border-width -1 * $border-width 0 $border-color,
10
10
+
$border-width $border-width 0 $border-color,
11
11
+
-1 * $border-width $border-width 0 $border-color,
12
12
+
$border-width -1 * $border-width 0 $border-color;
13
13
}
+14
-14
home/isabel/programs/configs/gui/bars/ags/config/scss/common/tooltip.scss
···
1
1
tooltip {
2
2
-
* {
3
3
-
all: unset;
4
4
-
}
2
2
+
* {
3
3
+
all: unset;
4
4
+
}
5
5
6
6
-
background-color: transparent;
7
7
-
border: none;
6
6
+
background-color: transparent;
7
7
+
border: none;
8
8
9
9
-
> * > * {
10
10
-
background-color: $bg-color;
11
11
-
border-radius: $radii;
12
12
-
border: $border-width solid $popover-border-color;
13
13
-
color: $fg-color;
14
14
-
padding: 8px;
15
15
-
margin: 4px;
16
16
-
box-shadow: 0 0 3px 0 $shadow;
17
17
-
}
9
9
+
> * > * {
10
10
+
background-color: $bg-color;
11
11
+
border-radius: $radii;
12
12
+
border: $border-width solid $popover-border-color;
13
13
+
color: $fg-color;
14
14
+
padding: 8px;
15
15
+
margin: 4px;
16
16
+
box-shadow: 0 0 3px 0 $shadow;
17
17
+
}
18
18
}
+6
-6
home/isabel/programs/configs/gui/bars/ags/config/scss/common/unset.scss
···
1
1
@mixin unset($rec: false) {
2
2
-
all: unset;
2
2
+
all: unset;
3
3
4
4
-
@if $rec {
5
5
-
* {
6
6
-
all: unset;
7
7
-
}
8
8
-
}
4
4
+
@if $rec {
5
5
+
* {
6
6
+
all: unset;
7
7
+
}
8
8
+
}
9
9
}
+5
-5
home/isabel/programs/configs/gui/bars/ags/config/scss/common/widget.scss
···
1
1
@mixin widget {
2
2
-
transition: $transition;
3
3
-
border-radius: $radii;
4
4
-
color: $fg-color;
5
5
-
background-color: $widget-bg;
6
6
-
border: $border;
2
2
+
transition: $transition;
3
3
+
border-radius: $radii;
4
4
+
color: $fg-color;
5
5
+
background-color: $widget-bg;
6
6
+
border: $border;
7
7
}
+6
-6
home/isabel/programs/configs/gui/bars/ags/config/scss/variables.scss
···
3
3
$active-gradient: linear-gradient($accent-gradient);
4
4
5
5
$hover-fg: if(
6
6
-
$color-scheme == "dark",
7
7
-
lighten($fg-color, 10%),
8
8
-
darken($fg-color, 8%)
6
6
+
$color-scheme == "dark",
7
7
+
lighten($fg-color, 10%),
8
8
+
darken($fg-color, 8%)
9
9
);
10
10
11
11
$border_color: transparentize($_border_color, $border_opacity / 100);
···
14
14
$text-shadow: 2px 2px 2px $shadow;
15
15
16
16
$popover-border-color: transparentize(
17
17
-
$_border-color,
18
18
-
max(($border-opacity - 1) / 100, 0)
17
17
+
$_border-color,
18
18
+
max(($border-opacity - 1) / 100, 0)
19
19
);
20
20
$popover-padding: $padding * $popover-padding-multiplier;
21
21
$popover-radius: if($radii ==0, 0, $radii + $popover-padding);
···
23
23
$shader-fg: #fff;
24
24
25
25
* {
26
26
-
font-size: $font-size;
26
26
+
font-size: $font-size;
27
27
}
+56
-56
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/applauncher.scss
···
1
1
window#applauncher .window-content {
2
2
-
@include floating_widget;
2
2
+
@include floating_widget;
3
3
4
4
-
entry {
5
5
-
@include button;
6
6
-
padding: $padding;
7
7
-
margin-bottom: $spacing;
4
4
+
entry {
5
5
+
@include button;
6
6
+
padding: $padding;
7
7
+
margin-bottom: $spacing;
8
8
9
9
-
label,
10
10
-
image {
11
11
-
color: $fg-color;
12
12
-
}
13
13
-
}
9
9
+
label,
10
10
+
image {
11
11
+
color: $fg-color;
12
12
+
}
13
13
+
}
14
14
15
15
-
separator {
16
16
-
min-height: 1px;
17
17
-
background-color: $hover;
18
18
-
}
15
15
+
separator {
16
16
+
min-height: 1px;
17
17
+
background-color: $hover;
18
18
+
}
19
19
20
20
-
scrolledwindow {
21
21
-
@include scrollable;
22
22
-
min-width: $applauncher-width;
23
23
-
min-height: $applauncher-height;
24
24
-
}
20
20
+
scrolledwindow {
21
21
+
@include scrollable;
22
22
+
min-width: $applauncher-width;
23
23
+
min-height: $applauncher-height;
24
24
+
}
25
25
26
26
-
button.app-item {
27
27
-
@include button($flat: true, $reactive: false);
26
26
+
button.app-item {
27
27
+
@include button($flat: true, $reactive: false);
28
28
29
29
-
> box {
30
30
-
@include spacing(0.5);
31
31
-
}
29
29
+
> box {
30
30
+
@include spacing(0.5);
31
31
+
}
32
32
33
33
-
transition: $transition;
34
34
-
padding: $padding;
33
33
+
transition: $transition;
34
34
+
padding: $padding;
35
35
36
36
-
label {
37
37
-
transition: $transition;
36
36
+
label {
37
37
+
transition: $transition;
38
38
39
39
-
&.title {
40
40
-
color: $fg-color;
41
41
-
}
39
39
+
&.title {
40
40
+
color: $fg-color;
41
41
+
}
42
42
43
43
-
&.description {
44
44
-
color: transparentize($fg-color, 0.3);
45
45
-
}
46
46
-
}
43
43
+
&.description {
44
44
+
color: transparentize($fg-color, 0.3);
45
45
+
}
46
46
+
}
47
47
48
48
-
image {
49
49
-
transition: $transition;
50
50
-
}
48
48
+
image {
49
49
+
transition: $transition;
50
50
+
}
51
51
52
52
-
&:hover,
53
53
-
&:focus {
54
54
-
.title {
55
55
-
color: $accent;
56
56
-
}
52
52
+
&:hover,
53
53
+
&:focus {
54
54
+
.title {
55
55
+
color: $accent;
56
56
+
}
57
57
58
58
-
image {
59
59
-
-gtk-icon-shadow: 2px 2px $accent;
60
60
-
}
61
61
-
}
58
58
+
image {
59
59
+
-gtk-icon-shadow: 2px 2px $accent;
60
60
+
}
61
61
+
}
62
62
63
63
-
&:active {
64
64
-
background-color: transparentize($accent, 0.5);
65
65
-
border-radius: $radii;
66
66
-
box-shadow: inset 0 0 0 $border-width $border-color;
63
63
+
&:active {
64
64
+
background-color: transparentize($accent, 0.5);
65
65
+
border-radius: $radii;
66
66
+
box-shadow: inset 0 0 0 $border-width $border-color;
67
67
68
68
-
.title {
69
69
-
color: $fg-color;
70
70
-
}
71
71
-
}
72
72
-
}
68
68
+
.title {
69
69
+
color: $fg-color;
70
70
+
}
71
71
+
}
72
72
+
}
73
73
}
+219
-219
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/bar.scss
···
1
1
$bar-spacing: $spacing / 1.5;
2
2
$button-radius: if(
3
3
-
$bar-style == "floating",
4
4
-
max(0, $radii - $bar-spacing),
5
5
-
$radii
3
3
+
$bar-style == "floating",
4
4
+
max(0, $radii - $bar-spacing),
5
5
+
$radii
6
6
);
7
7
8
8
@mixin panel-button($flat: $bar-flat-buttons, $reactive: true) {
9
9
-
@include unset;
9
9
+
@include unset;
10
10
11
11
-
@if $bar-style == "separated" {
12
12
-
transition: $transition;
11
11
+
@if $bar-style == "separated" {
12
12
+
transition: $transition;
13
13
14
14
-
> * {
15
15
-
@include floating-widget;
16
16
-
border-radius: $radii;
17
17
-
margin: $wm-gaps $bar-spacing;
18
18
-
transition: $transition;
19
19
-
}
14
14
+
> * {
15
15
+
@include floating-widget;
16
16
+
border-radius: $radii;
17
17
+
margin: $wm-gaps $bar-spacing;
18
18
+
transition: $transition;
19
19
+
}
20
20
21
21
-
&:hover > * {
22
22
-
color: $hover-fg;
21
21
+
&:hover > * {
22
22
+
color: $hover-fg;
23
23
24
24
-
@if $drop-shadow {
25
25
-
box-shadow:
26
26
-
0 0 min(6px, $spacing/2) 0 $shadow,
27
27
-
inset 0 0 0 99px $hover;
28
28
-
} @else {
29
29
-
box-shadow: inset 0 0 0 99px $hover;
30
30
-
}
31
31
-
}
24
24
+
@if $drop-shadow {
25
25
+
box-shadow:
26
26
+
0 0 min(6px, $spacing/2) 0 $shadow,
27
27
+
inset 0 0 0 99px $hover;
28
28
+
} @else {
29
29
+
box-shadow: inset 0 0 0 99px $hover;
30
30
+
}
31
31
+
}
32
32
33
33
-
&:active > *,
34
34
-
&.active > * {
35
35
-
label,
36
36
-
image {
37
37
-
color: $accent-fg;
38
38
-
}
33
33
+
&:active > *,
34
34
+
&.active > * {
35
35
+
label,
36
36
+
image {
37
37
+
color: $accent-fg;
38
38
+
}
39
39
40
40
-
background-image: $active-gradient;
41
41
-
background-color: $accent;
42
42
-
}
43
43
-
} @else {
44
44
-
@include accs-button($flat, $reactive);
40
40
+
background-image: $active-gradient;
41
41
+
background-color: $accent;
42
42
+
}
43
43
+
} @else {
44
44
+
@include accs-button($flat, $reactive);
45
45
46
46
-
> * {
47
47
-
margin: $bar-spacing;
48
48
-
border-radius: $button-radius;
49
49
-
}
50
50
-
}
46
46
+
> * {
47
47
+
margin: $bar-spacing;
48
48
+
border-radius: $button-radius;
49
49
+
}
50
50
+
}
51
51
52
52
-
label,
53
53
-
image {
54
54
-
font-weight: bold;
55
55
-
}
52
52
+
label,
53
53
+
image {
54
54
+
font-weight: bold;
55
55
+
}
56
56
57
57
-
> * {
58
58
-
padding: $padding * 0.4 $padding * 0.7;
59
59
-
}
57
57
+
> * {
58
58
+
padding: $padding * 0.4 $padding * 0.7;
59
59
+
}
60
60
}
61
61
62
62
.panel {
63
63
-
@if $bar-style == "normal" {
64
64
-
background-color: $bg-color;
65
65
-
}
63
63
+
@if $bar-style == "normal" {
64
64
+
background-color: $bg-color;
65
65
+
}
66
66
67
67
-
@if $bar-style == "normal" {
68
68
-
@if $bar-position == "bottom" {
69
69
-
border-top: $border;
70
70
-
} @else {
71
71
-
border-bottom: $border;
72
72
-
}
73
73
-
}
67
67
+
@if $bar-style == "normal" {
68
68
+
@if $bar-position == "bottom" {
69
69
+
border-top: $border;
70
70
+
} @else {
71
71
+
border-bottom: $border;
72
72
+
}
73
73
+
}
74
74
75
75
-
@if $bar-style == "floating" {
76
76
-
@include floating-widget;
77
77
-
border-radius: $radii;
78
78
-
margin: $wm-gaps;
79
79
-
padding: 0;
80
80
-
}
75
75
+
@if $bar-style == "floating" {
76
76
+
@include floating-widget;
77
77
+
border-radius: $radii;
78
78
+
margin: $wm-gaps;
79
79
+
padding: 0;
80
80
+
}
81
81
82
82
-
@if $bar-style == "separated" {
83
83
-
> .end > button:last-child > * {
84
84
-
margin-right: $wm-gaps;
85
85
-
}
82
82
+
@if $bar-style == "separated" {
83
83
+
> .end > button:last-child > * {
84
84
+
margin-right: $wm-gaps;
85
85
+
}
86
86
87
87
-
> .start > button:first-child > * {
88
88
-
margin-left: $wm-gaps;
89
89
-
}
90
90
-
}
87
87
+
> .start > button:first-child > * {
88
88
+
margin-left: $wm-gaps;
89
89
+
}
90
90
+
}
91
91
92
92
-
.panel-button {
93
93
-
@include panel-button;
94
94
-
}
92
92
+
.panel-button {
93
93
+
@include panel-button;
94
94
+
}
95
95
96
96
-
.tray-item,
97
97
-
.color-picker {
98
98
-
@include panel-button($flat: true);
99
99
-
}
96
96
+
.tray-item,
97
97
+
.color-picker {
98
98
+
@include panel-button($flat: true);
99
99
+
}
100
100
101
101
-
separator {
102
102
-
background-color: transparentize($fg-color, 0.86);
103
103
-
border-radius: $radii;
104
104
-
min-height: 5px;
105
105
-
min-width: 5px;
106
106
-
}
101
101
+
separator {
102
102
+
background-color: transparentize($fg-color, 0.86);
103
103
+
border-radius: $radii;
104
104
+
min-height: 5px;
105
105
+
min-width: 5px;
106
106
+
}
107
107
108
108
-
.overview {
109
109
-
label {
110
110
-
color: transparentize($accent, 0.2);
111
111
-
}
108
108
+
.overview {
109
109
+
label {
110
110
+
color: transparentize($accent, 0.2);
111
111
+
}
112
112
113
113
-
&:hover label {
114
114
-
color: $accent;
115
115
-
}
113
113
+
&:hover label {
114
114
+
color: $accent;
115
115
+
}
116
116
117
117
-
&:active label,
118
118
-
&.active label {
119
119
-
color: $accent-fg;
120
120
-
}
121
121
-
}
117
117
+
&:active label,
118
118
+
&.active label {
119
119
+
color: $accent-fg;
120
120
+
}
121
121
+
}
122
122
123
123
-
.powermenu,
124
124
-
.recorder {
125
125
-
image {
126
126
-
color: transparentize($red, 0.3);
127
127
-
}
123
123
+
.powermenu,
124
124
+
.recorder {
125
125
+
image {
126
126
+
color: transparentize($red, 0.3);
127
127
+
}
128
128
129
129
-
&:hover image {
130
130
-
color: transparentize($red, 0.15);
131
131
-
}
129
129
+
&:hover image {
130
130
+
color: transparentize($red, 0.15);
131
131
+
}
132
132
133
133
-
&:active image {
134
134
-
color: $red;
135
135
-
}
136
136
-
}
133
133
+
&:active image {
134
134
+
color: $red;
135
135
+
}
136
136
+
}
137
137
138
138
-
.focused-client > box > box,
139
139
-
.quicksettings > box {
140
140
-
@include spacing(1, if($bar-spacing ==0, $padding / 2, $bar-spacing));
141
141
-
}
138
138
+
.focused-client > box > box,
139
139
+
.quicksettings > box {
140
140
+
@include spacing(1, if($bar-spacing ==0, $padding / 2, $bar-spacing));
141
141
+
}
142
142
143
143
-
/* stylelint-disable-next-line selector-not-notation */
144
144
-
.quicksettings:not(.active):not(:active) {
145
145
-
.bluetooth {
146
146
-
color: $blue;
147
147
-
}
143
143
+
/* stylelint-disable-next-line selector-not-notation */
144
144
+
.quicksettings:not(.active):not(:active) {
145
145
+
.bluetooth {
146
146
+
color: $blue;
147
147
+
}
148
148
149
149
-
.battery {
150
150
-
&.low {
151
151
-
color: $red;
152
152
-
}
149
149
+
.battery {
150
150
+
&.low {
151
151
+
color: $red;
152
152
+
}
153
153
154
154
-
&.charged,
155
155
-
&.charging {
156
156
-
color: $green;
157
157
-
}
158
158
-
}
159
159
-
}
154
154
+
&.charged,
155
155
+
&.charging {
156
156
+
color: $green;
157
157
+
}
158
158
+
}
159
159
+
}
160
160
161
161
-
.media {
162
162
-
&.spotify image {
163
163
-
color: $green;
164
164
-
}
161
161
+
.media {
162
162
+
&.spotify image {
163
163
+
color: $green;
164
164
+
}
165
165
166
166
-
&.firefox image {
167
167
-
color: $orange;
168
168
-
}
166
166
+
&.firefox image {
167
167
+
color: $orange;
168
168
+
}
169
169
170
170
-
&.mpv image {
171
171
-
color: $magenta;
172
172
-
}
173
173
-
}
170
170
+
&.mpv image {
171
171
+
color: $magenta;
172
172
+
}
173
173
+
}
174
174
175
175
-
.notifications {
176
176
-
image {
177
177
-
color: $yellow;
178
178
-
}
179
179
-
}
175
175
+
.notifications {
176
176
+
image {
177
177
+
color: $yellow;
178
178
+
}
179
179
+
}
180
180
181
181
-
.battery-bar {
182
182
-
.font-icon {
183
183
-
font-size: 1.3em;
184
184
-
}
181
181
+
.battery-bar {
182
182
+
.font-icon {
183
183
+
font-size: 1.3em;
184
184
+
}
185
185
186
186
-
image,
187
187
-
.font-icon {
188
188
-
margin-right: $bar-spacing * 0.5;
189
189
-
}
186
186
+
image,
187
187
+
.font-icon {
188
188
+
margin-right: $bar-spacing * 0.5;
189
189
+
}
190
190
191
191
-
levelbar trough {
192
192
-
@include widget;
193
193
-
min-width: $battery-bar-width;
194
194
-
min-height: $battery-bar-height;
191
191
+
levelbar trough {
192
192
+
@include widget;
193
193
+
min-width: $battery-bar-width;
194
194
+
min-height: $battery-bar-height;
195
195
196
196
-
block.filled {
197
197
-
border-radius: max($radii - $border-width, 0);
198
198
-
background-image: $active-gradient;
199
199
-
}
200
200
-
}
196
196
+
block.filled {
197
197
+
border-radius: max($radii - $border-width, 0);
198
198
+
background-image: $active-gradient;
199
199
+
}
200
200
+
}
201
201
202
202
-
@mixin color($color) {
203
203
-
image,
204
204
-
label {
205
205
-
color: $color;
206
206
-
}
202
202
+
@mixin color($color) {
203
203
+
image,
204
204
+
label {
205
205
+
color: $color;
206
206
+
}
207
207
208
208
-
block.filled {
209
209
-
background-image: linear-gradient(
210
210
-
to right,
211
211
-
$color,
212
212
-
lighten($color, 6%)
213
213
-
);
214
214
-
}
215
215
-
}
208
208
+
block.filled {
209
209
+
background-image: linear-gradient(
210
210
+
to right,
211
211
+
$color,
212
212
+
lighten($color, 6%)
213
213
+
);
214
214
+
}
215
215
+
}
216
216
217
217
-
.medium {
218
218
-
@include color($yellow);
219
219
-
}
217
217
+
.medium {
218
218
+
@include color($yellow);
219
219
+
}
220
220
221
221
-
.low {
222
222
-
@include color($red);
223
223
-
}
221
221
+
.low {
222
222
+
@include color($red);
223
223
+
}
224
224
225
225
-
.charging {
226
226
-
@include color($green);
227
227
-
}
225
225
+
.charging {
226
226
+
@include color($green);
227
227
+
}
228
228
229
229
-
&:active {
230
230
-
@include color($accent-fg);
231
231
-
}
232
232
-
}
229
229
+
&:active {
230
230
+
@include color($accent-fg);
231
231
+
}
232
232
+
}
233
233
234
234
-
.workspaces button {
235
235
-
all: unset;
234
234
+
.workspaces button {
235
235
+
all: unset;
236
236
237
237
-
.indicator {
238
238
-
font-size: 0;
239
239
-
min-width: 8px;
240
240
-
min-height: 8px;
241
241
-
border-radius: $radii * 0.6;
242
242
-
box-shadow: inset 0 0 0 $border-width $border-color;
243
243
-
margin: 0 $padding/2;
244
244
-
transition: $transition/2;
245
245
-
background-color: transparentize($fg-color, 0.8);
246
246
-
}
237
237
+
.indicator {
238
238
+
font-size: 0;
239
239
+
min-width: 8px;
240
240
+
min-height: 8px;
241
241
+
border-radius: $radii * 0.6;
242
242
+
box-shadow: inset 0 0 0 $border-width $border-color;
243
243
+
margin: 0 $padding/2;
244
244
+
transition: $transition/2;
245
245
+
background-color: transparentize($fg-color, 0.8);
246
246
+
}
247
247
248
248
-
&:last-child .indicator {
249
249
-
margin-right: $padding;
250
250
-
}
248
248
+
&:last-child .indicator {
249
249
+
margin-right: $padding;
250
250
+
}
251
251
252
252
-
&:first-child .indicator {
253
253
-
margin-left: $padding;
254
254
-
}
252
252
+
&:first-child .indicator {
253
253
+
margin-left: $padding;
254
254
+
}
255
255
256
256
-
&.occupied .indicator {
257
257
-
background-color: transparentize($fg-color, 0.2);
258
258
-
min-width: 10px;
259
259
-
min-height: 10px;
260
260
-
}
256
256
+
&.occupied .indicator {
257
257
+
background-color: transparentize($fg-color, 0.2);
258
258
+
min-width: 10px;
259
259
+
min-height: 10px;
260
260
+
}
261
261
262
262
-
&:hover .indicator {
263
263
-
box-shadow: inset 0 0 0 10px transparentize($fg-color, 0.8);
264
264
-
}
262
262
+
&:hover .indicator {
263
263
+
box-shadow: inset 0 0 0 10px transparentize($fg-color, 0.8);
264
264
+
}
265
265
266
266
-
&.active .indicator,
267
267
-
&:active .indicator {
268
268
-
background-color: $accent;
269
269
-
}
266
266
+
&.active .indicator,
267
267
+
&:active .indicator {
268
268
+
background-color: $accent;
269
269
+
}
270
270
271
271
-
&.active .indicator {
272
272
-
min-width: 24px;
273
273
-
min-height: 16px;
274
274
-
}
275
275
-
}
271
271
+
&.active .indicator {
272
272
+
min-width: 24px;
273
273
+
min-height: 16px;
274
274
+
}
275
275
+
}
276
276
}
+102
-102
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/dashboard.scss
···
1
1
@mixin calendar {
2
2
-
@include widget;
3
3
-
padding: $padding * 2 $padding * 2 0;
2
2
+
@include widget;
3
3
+
padding: $padding * 2 $padding * 2 0;
4
4
5
5
-
calendar {
6
6
-
all: unset;
5
5
+
calendar {
6
6
+
all: unset;
7
7
8
8
-
&.button {
9
9
-
@include button($flat: true);
10
10
-
}
8
8
+
&.button {
9
9
+
@include button($flat: true);
10
10
+
}
11
11
12
12
-
&:selected {
13
13
-
box-shadow:
14
14
-
inset 0 -8px 0 0 transparentize($accent, 0.5),
15
15
-
inset 0 0 0 1px $accent;
16
16
-
border-radius: $radii * 0.6;
17
17
-
}
12
12
+
&:selected {
13
13
+
box-shadow:
14
14
+
inset 0 -8px 0 0 transparentize($accent, 0.5),
15
15
+
inset 0 0 0 1px $accent;
16
16
+
border-radius: $radii * 0.6;
17
17
+
}
18
18
19
19
-
&.header {
20
20
-
background-color: transparent;
21
21
-
border: none;
22
22
-
color: transparentize($fg-color, 0.5);
23
23
-
}
19
19
+
&.header {
20
20
+
background-color: transparent;
21
21
+
border: none;
22
22
+
color: transparentize($fg-color, 0.5);
23
23
+
}
24
24
25
25
-
&.highlight {
26
26
-
background-color: transparent;
27
27
-
color: transparentize($accent, 0.5);
28
28
-
}
25
25
+
&.highlight {
26
26
+
background-color: transparent;
27
27
+
color: transparentize($accent, 0.5);
28
28
+
}
29
29
30
30
-
&:indeterminate {
31
31
-
color: transparentize($fg-color, 0.9);
32
32
-
}
30
30
+
&:indeterminate {
31
31
+
color: transparentize($fg-color, 0.9);
32
32
+
}
33
33
34
34
-
font-size: 1.1em;
35
35
-
padding: 0.2em;
36
36
-
}
34
34
+
font-size: 1.1em;
35
35
+
padding: 0.2em;
36
36
+
}
37
37
}
38
38
39
39
window#dashboard .window-content {
40
40
-
@include floating-widget;
40
40
+
@include floating-widget;
41
41
42
42
-
.notifications {
43
43
-
min-width: $notifications-width;
42
42
+
.notifications {
43
43
+
min-width: $notifications-width;
44
44
45
45
-
.header {
46
46
-
margin-bottom: $spacing;
47
47
-
margin-right: $spacing;
45
45
+
.header {
46
46
+
margin-bottom: $spacing;
47
47
+
margin-right: $spacing;
48
48
49
49
-
> label {
50
50
-
margin-left: $radii / 2;
51
51
-
}
49
49
+
> label {
50
50
+
margin-left: $radii / 2;
51
51
+
}
52
52
53
53
-
button {
54
54
-
@include button;
55
55
-
padding: $padding/2 $padding;
56
56
-
}
57
57
-
}
53
53
+
button {
54
54
+
@include button;
55
55
+
padding: $padding/2 $padding;
56
56
+
}
57
57
+
}
58
58
59
59
-
.notification-scrollable {
60
60
-
@include scrollable;
61
61
-
}
59
59
+
.notification-scrollable {
60
60
+
@include scrollable;
61
61
+
}
62
62
63
63
-
.notification-list {
64
64
-
margin-right: $spacing;
65
65
-
}
63
63
+
.notification-list {
64
64
+
margin-right: $spacing;
65
65
+
}
66
66
67
67
-
.notification {
68
68
-
@include notification;
67
67
+
.notification {
68
68
+
@include notification;
69
69
70
70
-
> box {
71
71
-
@include widget;
72
72
-
padding: $padding;
73
73
-
margin-bottom: $spacing;
74
74
-
}
75
75
-
}
70
70
+
> box {
71
71
+
@include widget;
72
72
+
padding: $padding;
73
73
+
margin-bottom: $spacing;
74
74
+
}
75
75
+
}
76
76
77
77
-
.placeholder {
78
78
-
image {
79
79
-
font-size: 7em;
80
80
-
}
77
77
+
.placeholder {
78
78
+
image {
79
79
+
font-size: 7em;
80
80
+
}
81
81
82
82
-
label {
83
83
-
font-size: 1.2em;
84
84
-
}
85
85
-
}
86
86
-
}
82
82
+
label {
83
83
+
font-size: 1.2em;
84
84
+
}
85
85
+
}
86
86
+
}
87
87
88
88
-
separator {
89
89
-
background-color: $popover-border-color;
90
90
-
min-width: 2px;
91
91
-
border-radius: $radii;
92
92
-
margin-right: $spacing;
93
93
-
}
88
88
+
separator {
89
89
+
background-color: $popover-border-color;
90
90
+
min-width: 2px;
91
91
+
border-radius: $radii;
92
92
+
margin-right: $spacing;
93
93
+
}
94
94
95
95
-
.datemenu,
96
96
-
.system-info {
97
97
-
@include spacing;
98
98
-
}
95
95
+
.datemenu,
96
96
+
.system-info {
97
97
+
@include spacing;
98
98
+
}
99
99
100
100
-
.clock-box {
101
101
-
padding: $padding;
100
100
+
.clock-box {
101
101
+
padding: $padding;
102
102
103
103
-
.clock {
104
104
-
font-size: 5em;
105
105
-
}
103
103
+
.clock {
104
104
+
font-size: 5em;
105
105
+
}
106
106
107
107
-
.uptime {
108
108
-
color: transparentize($fg-color, 0.2);
109
109
-
}
110
110
-
}
107
107
+
.uptime {
108
108
+
color: transparentize($fg-color, 0.2);
109
109
+
}
110
110
+
}
111
111
112
112
-
.calendar {
113
113
-
@include calendar;
114
114
-
}
112
112
+
.calendar {
113
113
+
@include calendar;
114
114
+
}
115
115
116
116
-
.circular-progress-box {
117
117
-
@include widget;
118
118
-
padding: $padding;
116
116
+
.circular-progress-box {
117
117
+
@include widget;
118
118
+
padding: $padding;
119
119
120
120
-
.circular-progress {
121
121
-
min-height: $sys-info-size;
122
122
-
min-width: $sys-info-size;
123
123
-
margin: $padding/2;
124
124
-
font-size: $padding;
125
125
-
background-color: $bg-color;
126
126
-
color: $accent;
120
120
+
.circular-progress {
121
121
+
min-height: $sys-info-size;
122
122
+
min-width: $sys-info-size;
123
123
+
margin: $padding/2;
124
124
+
font-size: $padding;
125
125
+
background-color: $bg-color;
126
126
+
color: $accent;
127
127
128
128
-
image {
129
129
-
font-size: 1.8em;
130
130
-
}
131
131
-
}
132
132
-
}
128
128
+
image {
129
129
+
font-size: 1.8em;
130
130
+
}
131
131
+
}
132
132
+
}
133
133
}
+57
-57
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/desktop.scss
···
1
1
window.desktop {
2
2
-
@if $bar-style == "normal" {
3
3
-
box-shadow: inset 0 0 $padding 0 $shadow;
4
4
-
}
2
2
+
@if $bar-style == "normal" {
3
3
+
box-shadow: inset 0 0 $padding 0 $shadow;
4
4
+
}
5
5
6
6
-
.clock-box-shadow {
7
7
-
border: 5px solid $wallpaper-fg;
8
8
-
border-radius: $radii;
6
6
+
.clock-box-shadow {
7
7
+
border: 5px solid $wallpaper-fg;
8
8
+
border-radius: $radii;
9
9
10
10
-
.clock-box {
11
11
-
border-radius: max($radii - 5px, 0);
12
12
-
padding: 0 14px;
10
10
+
.clock-box {
11
11
+
border-radius: max($radii - 5px, 0);
12
12
+
padding: 0 14px;
13
13
14
14
-
.clock {
15
15
-
color: $wallpaper-fg;
16
16
-
font-size: 140px;
17
17
-
font-family: $mono-font;
18
18
-
}
14
14
+
.clock {
15
15
+
color: $wallpaper-fg;
16
16
+
font-size: 140px;
17
17
+
font-family: $mono-font;
18
18
+
}
19
19
20
20
-
.separator-box {
21
21
-
padding: 24px 12px;
20
20
+
.separator-box {
21
21
+
padding: 24px 12px;
22
22
23
23
-
separator {
24
24
-
border-radius: $radii;
25
25
-
min-width: 16px;
26
26
-
min-height: 16px;
27
27
-
background-color: $wallpaper-fg;
28
28
-
}
29
29
-
}
30
30
-
}
31
31
-
}
23
23
+
separator {
24
24
+
border-radius: $radii;
25
25
+
min-width: 16px;
26
26
+
min-height: 16px;
27
27
+
background-color: $wallpaper-fg;
28
28
+
}
29
29
+
}
30
30
+
}
31
31
+
}
32
32
33
33
-
.date {
34
34
-
color: $wallpaper-fg;
35
35
-
font-size: 48px;
36
36
-
}
33
33
+
.date {
34
34
+
color: $wallpaper-fg;
35
35
+
font-size: 48px;
36
36
+
}
37
37
38
38
-
@if $drop-shadow {
39
39
-
.clock-box-shadow,
40
40
-
separator {
41
41
-
box-shadow: 2px 2px 2px 0 $shadow;
42
42
-
}
38
38
+
@if $drop-shadow {
39
39
+
.clock-box-shadow,
40
40
+
separator {
41
41
+
box-shadow: 2px 2px 2px 0 $shadow;
42
42
+
}
43
43
44
44
-
.clock-box {
45
45
-
box-shadow: inset 2px 2px 2px 0 $shadow;
46
46
-
}
44
44
+
.clock-box {
45
45
+
box-shadow: inset 2px 2px 2px 0 $shadow;
46
46
+
}
47
47
48
48
-
label {
49
49
-
text-shadow: $text-shadow;
50
50
-
}
51
51
-
} @else {
52
52
-
.clock-box-shadow {
53
53
-
box-shadow:
54
54
-
0 0 0 $border-width $border-color,
55
55
-
inset 0 0 0 $border-width $border-color;
56
56
-
}
48
48
+
label {
49
49
+
text-shadow: $text-shadow;
50
50
+
}
51
51
+
} @else {
52
52
+
.clock-box-shadow {
53
53
+
box-shadow:
54
54
+
0 0 0 $border-width $border-color,
55
55
+
inset 0 0 0 $border-width $border-color;
56
56
+
}
57
57
58
58
-
separator {
59
59
-
border: $border;
60
60
-
}
58
58
+
separator {
59
59
+
border: $border;
60
60
+
}
61
61
62
62
-
label {
63
63
-
@include text-border;
64
64
-
}
65
65
-
}
62
62
+
label {
63
63
+
@include text-border;
64
64
+
}
65
65
+
}
66
66
}
67
67
68
68
.desktop-menu {
69
69
-
image {
70
70
-
margin-left: -14px;
71
71
-
margin-right: 6px;
72
72
-
}
69
69
+
image {
70
70
+
margin-left: -14px;
71
71
+
margin-right: 6px;
72
72
+
}
73
73
}
+95
-95
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/media.scss
···
1
1
@mixin player-color($color) {
2
2
-
button {
3
3
-
.shuffle.enabled {
4
4
-
color: $color;
5
5
-
}
2
2
+
button {
3
3
+
.shuffle.enabled {
4
4
+
color: $color;
5
5
+
}
6
6
7
7
-
.loop {
8
8
-
&.playlist,
9
9
-
&.track {
10
10
-
color: $color;
11
11
-
}
12
12
-
}
7
7
+
.loop {
8
8
+
&.playlist,
9
9
+
&.track {
10
10
+
color: $color;
11
11
+
}
12
12
+
}
13
13
14
14
-
&:active label {
15
15
-
color: $color;
16
16
-
}
17
17
-
}
14
14
+
&:active label {
15
15
+
color: $color;
16
16
+
}
17
17
+
}
18
18
19
19
-
.position-slider:hover trough {
20
20
-
background-color: transparentize($color, 0.5);
21
21
-
}
19
19
+
.position-slider:hover trough {
20
20
+
background-color: transparentize($color, 0.5);
21
21
+
}
22
22
23
23
-
.player-icon {
24
24
-
color: $color;
25
25
-
}
23
23
+
.player-icon {
24
24
+
color: $color;
25
25
+
}
26
26
}
27
27
28
28
@mixin media() {
29
29
-
@include widget;
29
29
+
@include widget;
30
30
31
31
-
label {
32
32
-
color: $shader-fg;
33
33
-
text-shadow: $text-shadow;
34
34
-
}
31
31
+
label {
32
32
+
color: $shader-fg;
33
33
+
text-shadow: $text-shadow;
34
34
+
}
35
35
36
36
-
.blurred-cover,
37
37
-
.cover {
38
38
-
background-size: cover;
39
39
-
background-position: center;
40
40
-
border-radius: $radii * 0.8;
41
41
-
opacity: 0.8;
42
42
-
}
36
36
+
.blurred-cover,
37
37
+
.cover {
38
38
+
background-size: cover;
39
39
+
background-position: center;
40
40
+
border-radius: $radii * 0.8;
41
41
+
opacity: 0.8;
42
42
+
}
43
43
44
44
-
.cover {
45
45
-
min-height: 100px;
46
46
-
min-width: 100px;
47
47
-
box-shadow: 2px 2px 2px 0 $shadow;
48
48
-
margin: $padding;
49
49
-
opacity: 0.9;
50
50
-
}
44
44
+
.cover {
45
45
+
min-height: 100px;
46
46
+
min-width: 100px;
47
47
+
box-shadow: 2px 2px 2px 0 $shadow;
48
48
+
margin: $padding;
49
49
+
opacity: 0.9;
50
50
+
}
51
51
52
52
-
.labels {
53
53
-
margin-top: $padding;
52
52
+
.labels {
53
53
+
margin-top: $padding;
54
54
55
55
-
label {
56
56
-
font-size: 1.1em;
57
57
-
text-shadow: $text-shadow;
55
55
+
label {
56
56
+
font-size: 1.1em;
57
57
+
text-shadow: $text-shadow;
58
58
59
59
-
&.title {
60
60
-
font-weight: bold;
61
61
-
}
62
62
-
}
63
63
-
}
59
59
+
&.title {
60
60
+
font-weight: bold;
61
61
+
}
62
62
+
}
63
63
+
}
64
64
65
65
-
.position-slider {
66
66
-
@include slider(
67
67
-
$width: 0.4em,
68
68
-
$slider: false,
69
69
-
$gradient: linear-gradient($shader-fg, $shader-fg),
70
70
-
$radii: 0
71
71
-
);
72
72
-
margin-bottom: $padding/2;
65
65
+
.position-slider {
66
66
+
@include slider(
67
67
+
$width: 0.4em,
68
68
+
$slider: false,
69
69
+
$gradient: linear-gradient($shader-fg, $shader-fg),
70
70
+
$radii: 0
71
71
+
);
72
72
+
margin-bottom: $padding/2;
73
73
74
74
-
trough {
75
75
-
border: none;
76
76
-
background-color: transparentize($shader-fg, 0.7);
77
77
-
}
78
78
-
}
74
74
+
trough {
75
75
+
border: none;
76
76
+
background-color: transparentize($shader-fg, 0.7);
77
77
+
}
78
78
+
}
79
79
80
80
-
.footer-box {
81
81
-
margin: -$padding/2 $padding $padding/2;
80
80
+
.footer-box {
81
81
+
margin: -$padding/2 $padding $padding/2;
82
82
83
83
-
image {
84
84
-
-gtk-icon-shadow: $text-shadow;
85
85
-
}
86
86
-
}
83
83
+
image {
84
84
+
-gtk-icon-shadow: $text-shadow;
85
85
+
}
86
86
+
}
87
87
88
88
-
.controls button {
89
89
-
@include unset;
88
88
+
.controls button {
89
89
+
@include unset;
90
90
91
91
-
label {
92
92
-
font-size: 2em;
93
93
-
color: transparentize($shader-fg, 0.2);
94
94
-
transition: $transition;
91
91
+
label {
92
92
+
font-size: 2em;
93
93
+
color: transparentize($shader-fg, 0.2);
94
94
+
transition: $transition;
95
95
96
96
-
&.shuffle,
97
97
-
&.loop {
98
98
-
font-size: 1.4em;
99
99
-
}
100
100
-
}
96
96
+
&.shuffle,
97
97
+
&.loop {
98
98
+
font-size: 1.4em;
99
99
+
}
100
100
+
}
101
101
102
102
-
&:hover label {
103
103
-
color: transparentize($shader-fg, 0.1);
104
104
-
}
102
102
+
&:hover label {
103
103
+
color: transparentize($shader-fg, 0.1);
104
104
+
}
105
105
106
106
-
&:active label {
107
107
-
color: $shader-fg;
108
108
-
}
109
109
-
}
106
106
+
&:active label {
107
107
+
color: $shader-fg;
108
108
+
}
109
109
+
}
110
110
111
111
-
&.spotify {
112
112
-
@include player-color($green);
113
113
-
}
111
111
+
&.spotify {
112
112
+
@include player-color($green);
113
113
+
}
114
114
115
115
-
&.firefox {
116
116
-
@include player-color($orange);
117
117
-
}
115
115
+
&.firefox {
116
116
+
@include player-color($orange);
117
117
+
}
118
118
119
119
-
&.mpv {
120
120
-
@include player-color($magenta);
121
121
-
}
119
119
+
&.mpv {
120
120
+
@include player-color($magenta);
121
121
+
}
122
122
}
+62
-62
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/notifications.scss
···
1
1
@mixin notification() {
2
2
-
&.critical > box {
3
3
-
box-shadow: inset 0 0 0.5em 0 $red;
4
4
-
}
2
2
+
&.critical > box {
3
3
+
box-shadow: inset 0 0 0.5em 0 $red;
4
4
+
}
5
5
6
6
-
&:hover button.close-button {
7
7
-
@include button-hover;
8
8
-
background-color: transparentize($red, 0.5);
9
9
-
}
6
6
+
&:hover button.close-button {
7
7
+
@include button-hover;
8
8
+
background-color: transparentize($red, 0.5);
9
9
+
}
10
10
11
11
-
.content {
12
12
-
.title {
13
13
-
margin-right: $spacing;
14
14
-
color: $fg-color;
15
15
-
font-size: 1.1em;
16
16
-
}
11
11
+
.content {
12
12
+
.title {
13
13
+
margin-right: $spacing;
14
14
+
color: $fg-color;
15
15
+
font-size: 1.1em;
16
16
+
}
17
17
18
18
-
.time {
19
19
-
color: transparentize($fg-color, 0.2);
20
20
-
}
18
18
+
.time {
19
19
+
color: transparentize($fg-color, 0.2);
20
20
+
}
21
21
22
22
-
.description {
23
23
-
font-size: 0.9em;
24
24
-
color: transparentize($fg-color, 0.2);
25
25
-
}
22
22
+
.description {
23
23
+
font-size: 0.9em;
24
24
+
color: transparentize($fg-color, 0.2);
25
25
+
}
26
26
27
27
-
.icon {
28
28
-
border-radius: $radii * 0.8;
29
29
-
margin-right: $spacing;
27
27
+
.icon {
28
28
+
border-radius: $radii * 0.8;
29
29
+
margin-right: $spacing;
30
30
31
31
-
&.img {
32
32
-
border: $border;
33
33
-
}
34
34
-
}
35
35
-
}
31
31
+
&.img {
32
32
+
border: $border;
33
33
+
}
34
34
+
}
35
35
+
}
36
36
37
37
-
box.actions {
38
38
-
@include spacing(0.5);
39
39
-
margin-top: $spacing;
37
37
+
box.actions {
38
38
+
@include spacing(0.5);
39
39
+
margin-top: $spacing;
40
40
41
41
-
button {
42
42
-
@include button;
43
43
-
border-radius: $radii * 0.8;
44
44
-
font-size: 1.2em;
45
45
-
padding: $padding * 0.7;
46
46
-
}
47
47
-
}
41
41
+
button {
42
42
+
@include button;
43
43
+
border-radius: $radii * 0.8;
44
44
+
font-size: 1.2em;
45
45
+
padding: $padding * 0.7;
46
46
+
}
47
47
+
}
48
48
49
49
-
button.close-button {
50
50
-
@include button($flat: true);
51
51
-
margin-left: $spacing / 2;
52
52
-
border-radius: $radii * 0.8;
53
53
-
min-width: 1.2em;
54
54
-
min-height: 1.2em;
49
49
+
button.close-button {
50
50
+
@include button($flat: true);
51
51
+
margin-left: $spacing / 2;
52
52
+
border-radius: $radii * 0.8;
53
53
+
min-width: 1.2em;
54
54
+
min-height: 1.2em;
55
55
56
56
-
&:hover {
57
57
-
background-color: transparentize($red, 0.2);
58
58
-
}
56
56
+
&:hover {
57
57
+
background-color: transparentize($red, 0.2);
58
58
+
}
59
59
60
60
-
&:active {
61
61
-
background-image: linear-gradient($red, $red);
62
62
-
}
63
63
-
}
60
60
+
&:active {
61
61
+
background-image: linear-gradient($red, $red);
62
62
+
}
63
63
+
}
64
64
}
65
65
66
66
window.notifications {
67
67
-
@include unset;
67
67
+
@include unset;
68
68
69
69
-
.notification {
70
70
-
@include notification;
69
69
+
.notification {
70
70
+
@include notification;
71
71
72
72
-
> box {
73
73
-
@include floating-widget;
74
74
-
border-radius: $radii;
75
75
-
}
72
72
+
> box {
73
73
+
@include floating-widget;
74
74
+
border-radius: $radii;
75
75
+
}
76
76
77
77
-
.description {
78
78
-
min-width: 350px;
79
79
-
}
80
80
-
}
77
77
+
.description {
78
78
+
min-width: 350px;
79
79
+
}
80
80
+
}
81
81
}
+14
-14
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/osd.scss
···
1
1
window.indicator .progress {
2
2
-
@include floating-widget;
3
3
-
padding: $padding / 2;
4
4
-
border-radius: if($radii ==0, 0, $radii + $padding / 2);
2
2
+
@include floating-widget;
3
3
+
padding: $padding / 2;
4
4
+
border-radius: if($radii ==0, 0, $radii + $padding / 2);
5
5
6
6
-
.fill {
7
7
-
border-radius: $radii;
8
8
-
background-color: $accent;
9
9
-
color: $accent-fg;
6
6
+
.fill {
7
7
+
border-radius: $radii;
8
8
+
background-color: $accent;
9
9
+
color: $accent-fg;
10
10
11
11
-
image {
12
12
-
-gtk-icon-transform: scale(0.7);
13
13
-
}
11
11
+
image {
12
12
+
-gtk-icon-transform: scale(0.7);
13
13
+
}
14
14
15
15
-
.font-icon {
16
16
-
font-size: 34px;
17
17
-
}
18
18
-
}
15
15
+
.font-icon {
16
16
+
font-size: 34px;
17
17
+
}
18
18
+
}
19
19
}
+45
-45
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/powermenu.scss
···
1
1
window#powermenu {
2
2
-
.shader {
3
3
-
background-color: rgba(0, 0, 0, 0.05);
4
4
-
}
2
2
+
.shader {
3
3
+
background-color: rgba(0, 0, 0, 0.05);
4
4
+
}
5
5
}
6
6
7
7
window#powermenu .window-content {
8
8
-
@include floating-widget;
9
9
-
@include spacing(2);
10
10
-
padding: $popover-padding + $spacing * 1.5;
11
11
-
border-radius: if(
12
12
-
$radii ==0,
13
13
-
0,
14
14
-
$popover-radius + ($popover-padding + $spacing * 1.5)
15
15
-
);
8
8
+
@include floating-widget;
9
9
+
@include spacing(2);
10
10
+
padding: $popover-padding + $spacing * 1.5;
11
11
+
border-radius: if(
12
12
+
$radii ==0,
13
13
+
0,
14
14
+
$popover-radius + ($popover-padding + $spacing * 1.5)
15
15
+
);
16
16
17
17
-
button {
18
18
-
@include unset;
17
17
+
button {
18
18
+
@include unset;
19
19
20
20
-
image {
21
21
-
@include button;
22
22
-
border-radius: $popover-radius;
23
23
-
min-width: 1.7em;
24
24
-
min-height: 1.7em;
25
25
-
font-size: 4em;
26
26
-
}
20
20
+
image {
21
21
+
@include button;
22
22
+
border-radius: $popover-radius;
23
23
+
min-width: 1.7em;
24
24
+
min-height: 1.7em;
25
25
+
font-size: 4em;
26
26
+
}
27
27
28
28
-
label,
29
29
-
image {
30
30
-
color: transparentize($fg-color, 0.1);
31
31
-
}
28
28
+
label,
29
29
+
image {
30
30
+
color: transparentize($fg-color, 0.1);
31
31
+
}
32
32
33
33
-
&:hover {
34
34
-
image {
35
35
-
@include button-hover;
36
36
-
}
33
33
+
&:hover {
34
34
+
image {
35
35
+
@include button-hover;
36
36
+
}
37
37
38
38
-
label {
39
39
-
color: $fg-color;
40
40
-
}
41
41
-
}
38
38
+
label {
39
39
+
color: $fg-color;
40
40
+
}
41
41
+
}
42
42
43
43
-
&:focus image {
44
44
-
@include button-focus;
45
45
-
}
43
43
+
&:focus image {
44
44
+
@include button-focus;
45
45
+
}
46
46
47
47
-
&:active image {
48
48
-
@include button-active;
49
49
-
}
47
47
+
&:active image {
48
48
+
@include button-active;
49
49
+
}
50
50
51
51
-
&:focus,
52
52
-
&:active {
53
53
-
label {
54
54
-
color: $accent;
55
55
-
}
56
56
-
}
57
57
-
}
51
51
+
&:focus,
52
52
+
&:active {
53
53
+
label {
54
54
+
color: $accent;
55
55
+
}
56
56
+
}
57
57
+
}
58
58
}
+132
-132
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/quicksettings.scss
···
1
1
window#quicksettings .window-content {
2
2
-
@include floating-widget;
3
3
-
@include spacing;
2
2
+
@include floating-widget;
3
3
+
@include spacing;
4
4
5
5
-
.avatar {
6
6
-
@include widget;
7
7
-
}
5
5
+
.avatar {
6
6
+
@include widget;
7
7
+
}
8
8
9
9
-
.header {
10
10
-
@include spacing;
11
11
-
}
9
9
+
.header {
10
10
+
@include spacing;
11
11
+
}
12
12
13
13
-
.system-box {
14
14
-
@include widget;
15
15
-
@include spacing($rec: true);
13
13
+
.system-box {
14
14
+
@include widget;
15
15
+
@include spacing($rec: true);
16
16
17
17
-
padding: $padding;
17
17
+
padding: $padding;
18
18
19
19
-
button,
20
20
-
.uptime {
21
21
-
@include button;
22
22
-
padding: $padding;
23
23
-
font-weight: bold;
24
24
-
min-height: 20px;
25
25
-
min-width: 20px;
19
19
+
button,
20
20
+
.uptime {
21
21
+
@include button;
22
22
+
padding: $padding;
23
23
+
font-weight: bold;
24
24
+
min-height: 20px;
25
25
+
min-width: 20px;
26
26
27
27
-
image {
28
28
-
font-size: 1.2em;
29
29
-
}
30
30
-
}
31
31
-
}
27
27
+
image {
28
28
+
font-size: 1.2em;
29
29
+
}
30
30
+
}
31
31
+
}
32
32
33
33
-
.battery-progress {
34
34
-
label {
35
35
-
color: $accent-fg;
36
36
-
font-weight: bold;
37
37
-
}
33
33
+
.battery-progress {
34
34
+
label {
35
35
+
color: $accent-fg;
36
36
+
font-weight: bold;
37
37
+
}
38
38
39
39
-
&.charging label {
40
40
-
font-size: $padding * 2;
41
41
-
}
39
39
+
&.charging label {
40
40
+
font-size: $padding * 2;
41
41
+
}
42
42
43
43
-
&.half label {
44
44
-
color: $fg-color;
45
45
-
}
43
43
+
&.half label {
44
44
+
color: $fg-color;
45
45
+
}
46
46
47
47
-
progressbar {
48
48
-
@include slider($width: $padding * 3.6);
49
49
-
}
47
47
+
progressbar {
48
48
+
@include slider($width: $padding * 3.6);
49
49
+
}
50
50
51
51
-
&.low progressbar {
52
52
-
@include slider(
53
53
-
$width: $padding * 3.6,
54
54
-
$gradient: linear-gradient(to right, $red, $red)
55
55
-
);
56
56
-
}
57
57
-
}
51
51
+
&.low progressbar {
52
52
+
@include slider(
53
53
+
$width: $padding * 3.6,
54
54
+
$gradient: linear-gradient(to right, $red, $red)
55
55
+
);
56
56
+
}
57
57
+
}
58
58
59
59
-
.sliders-box {
60
60
-
@include widget;
61
61
-
@include spacing($rec: true);
62
62
-
@include spacing(0);
63
63
-
padding: $padding;
59
59
+
.sliders-box {
60
60
+
@include widget;
61
61
+
@include spacing($rec: true);
62
62
+
@include spacing(0);
63
63
+
padding: $padding;
64
64
65
65
-
button {
66
66
-
@include button($flat: true);
67
67
-
padding: $padding / 2;
68
68
-
}
65
65
+
button {
66
66
+
@include button($flat: true);
67
67
+
padding: $padding / 2;
68
68
+
}
69
69
70
70
-
scale {
71
71
-
@include slider;
72
72
-
margin-left: $spacing * -0.5;
73
73
-
}
70
70
+
scale {
71
71
+
@include slider;
72
72
+
margin-left: $spacing * -0.5;
73
73
+
}
74
74
75
75
-
.menu {
76
76
-
margin: $spacing 0;
77
77
-
background-color: $bg-color;
78
78
-
border: $border-width solid $popover-border-color;
79
79
-
border-radius: $radii;
80
80
-
}
81
81
-
}
75
75
+
.menu {
76
76
+
margin: $spacing 0;
77
77
+
background-color: $bg-color;
78
78
+
border: $border-width solid $popover-border-color;
79
79
+
border-radius: $radii;
80
80
+
}
81
81
+
}
82
82
83
83
-
.mixer-item {
84
84
-
scale {
85
85
-
@include slider($width: 7px);
86
86
-
}
83
83
+
.mixer-item {
84
84
+
scale {
85
85
+
@include slider($width: 7px);
86
86
+
}
87
87
88
88
-
image {
89
89
-
font-size: 1.2em;
90
90
-
}
91
91
-
}
88
88
+
image {
89
89
+
font-size: 1.2em;
90
90
+
}
91
91
+
}
92
92
93
93
-
.row {
94
94
-
@include spacing($rec: true);
95
95
-
}
93
93
+
.row {
94
94
+
@include spacing($rec: true);
95
95
+
}
96
96
97
97
-
.menu {
98
98
-
@include unset;
99
99
-
@include widget;
100
100
-
@include spacing($rec: true);
101
101
-
padding: $padding;
102
102
-
margin-top: $spacing;
97
97
+
.menu {
98
98
+
@include unset;
99
99
+
@include widget;
100
100
+
@include spacing($rec: true);
101
101
+
padding: $padding;
102
102
+
margin-top: $spacing;
103
103
104
104
-
.title {
105
105
-
@include spacing(0.5);
106
106
-
}
104
104
+
.title {
105
105
+
@include spacing(0.5);
106
106
+
}
107
107
108
108
-
separator {
109
109
-
margin: 0 $radii / 2;
110
110
-
}
108
108
+
separator {
109
109
+
margin: 0 $radii / 2;
110
110
+
}
111
111
112
112
-
button {
113
113
-
@include button($flat: true);
114
114
-
padding: $padding / 2;
115
115
-
}
112
112
+
button {
113
113
+
@include button($flat: true);
114
114
+
padding: $padding / 2;
115
115
+
}
116
116
117
117
-
switch {
118
118
-
@include switch;
119
119
-
}
120
120
-
}
117
117
+
switch {
118
118
+
@include switch;
119
119
+
}
120
120
+
}
121
121
122
122
-
.toggle-button {
123
123
-
@include button;
124
124
-
font-weight: bold;
122
122
+
.toggle-button {
123
123
+
@include button;
124
124
+
font-weight: bold;
125
125
126
126
-
.label-box {
127
127
-
@include spacing(0.5);
128
128
-
}
126
126
+
.label-box {
127
127
+
@include spacing(0.5);
128
128
+
}
129
129
130
130
-
button {
131
131
-
@include button($flat: true);
132
132
-
padding: $padding;
130
130
+
button {
131
131
+
@include button($flat: true);
132
132
+
padding: $padding;
133
133
134
134
-
&:first-child {
135
135
-
border-top-right-radius: 0;
136
136
-
border-bottom-right-radius: 0;
137
137
-
}
134
134
+
&:first-child {
135
135
+
border-top-right-radius: 0;
136
136
+
border-bottom-right-radius: 0;
137
137
+
}
138
138
139
139
-
&:last-child {
140
140
-
border-top-left-radius: 0;
141
141
-
border-bottom-left-radius: 0;
142
142
-
}
143
143
-
}
139
139
+
&:last-child {
140
140
+
border-top-left-radius: 0;
141
141
+
border-bottom-left-radius: 0;
142
142
+
}
143
143
+
}
144
144
145
145
-
&.active {
146
146
-
background-color: $accent;
145
145
+
&.active {
146
146
+
background-color: $accent;
147
147
148
148
-
label,
149
149
-
image {
150
150
-
color: $accent-fg;
151
151
-
}
152
152
-
}
153
153
-
}
148
148
+
label,
149
149
+
image {
150
150
+
color: $accent-fg;
151
151
+
}
152
152
+
}
153
153
+
}
154
154
155
155
-
.simple-toggle {
156
156
-
@include button;
157
157
-
padding: $padding;
158
158
-
}
155
155
+
.simple-toggle {
156
156
+
@include button;
157
157
+
padding: $padding;
158
158
+
}
159
159
160
160
-
.media {
161
161
-
@include spacing;
160
160
+
.media {
161
161
+
@include spacing;
162
162
163
163
-
.player {
164
164
-
@include media;
165
165
-
}
166
166
-
}
163
163
+
.player {
164
164
+
@include media;
165
165
+
}
166
166
+
}
167
167
}
+113
-113
home/isabel/programs/configs/gui/bars/ags/config/scss/widgets/settings.scss
···
1
1
window#settings-dialog {
2
2
-
background-color: $bg-color;
2
2
+
background-color: $bg-color;
3
3
4
4
-
.page {
5
5
-
@include scrollable;
6
6
-
}
4
4
+
.page {
5
5
+
@include scrollable;
6
6
+
}
7
7
8
8
-
.page-content {
9
9
-
margin: $spacing;
10
10
-
}
8
8
+
.page-content {
9
9
+
margin: $spacing;
10
10
+
}
11
11
12
12
-
.sidebar-box {
13
13
-
@include spacing($rec: true);
14
14
-
background-color: $widget-bg;
15
15
-
border-right: $border;
16
16
-
padding: $spacing / 2;
12
12
+
.sidebar-box {
13
13
+
@include spacing($rec: true);
14
14
+
background-color: $widget-bg;
15
15
+
border-right: $border;
16
16
+
padding: $spacing / 2;
17
17
18
18
-
button {
19
19
-
@include button($flat: true);
20
20
-
padding: $padding / 2 $padding * 2;
21
21
-
}
18
18
+
button {
19
19
+
@include button($flat: true);
20
20
+
padding: $padding / 2 $padding * 2;
21
21
+
}
22
22
23
23
-
scrolledwindow {
24
24
-
@include scrollable;
25
25
-
}
26
26
-
}
23
23
+
scrolledwindow {
24
24
+
@include scrollable;
25
25
+
}
26
26
+
}
27
27
28
28
-
.sidebar-header {
29
29
-
background-color: $widget-bg;
30
30
-
border-right: $border;
31
31
-
border-bottom: $border;
32
32
-
padding: $spacing / 2;
28
28
+
.sidebar-header {
29
29
+
background-color: $widget-bg;
30
30
+
border-right: $border;
31
31
+
border-bottom: $border;
32
32
+
padding: $spacing / 2;
33
33
34
34
-
button {
35
35
-
@include button($flat: true);
36
36
-
padding: $padding / 2 $padding;
37
37
-
}
34
34
+
button {
35
35
+
@include button($flat: true);
36
36
+
padding: $padding / 2 $padding;
37
37
+
}
38
38
39
39
-
button:last-child {
40
40
-
margin-left: $spacing / 2;
41
41
-
}
42
42
-
}
39
39
+
button:last-child {
40
40
+
margin-left: $spacing / 2;
41
41
+
}
42
42
+
}
43
43
44
44
-
.sidebar-footer {
45
45
-
background-color: $widget-bg;
46
46
-
border-right: $border;
47
47
-
border-top: $border;
48
48
-
padding: $spacing / 2;
44
44
+
.sidebar-footer {
45
45
+
background-color: $widget-bg;
46
46
+
border-right: $border;
47
47
+
border-top: $border;
48
48
+
padding: $spacing / 2;
49
49
50
50
-
button {
51
51
-
@include button($flat: true);
52
52
-
padding: $padding / 2 $padding;
53
53
-
}
54
54
-
}
50
50
+
button {
51
51
+
@include button($flat: true);
52
52
+
padding: $padding / 2 $padding;
53
53
+
}
54
54
+
}
55
55
56
56
-
entry.search {
57
57
-
@include button;
58
58
-
border-radius: 0;
59
59
-
padding: $padding;
60
60
-
}
56
56
+
entry.search {
57
57
+
@include button;
58
58
+
border-radius: 0;
59
59
+
padding: $padding;
60
60
+
}
61
61
62
62
-
.row {
63
63
-
@include widget;
64
64
-
border-radius: 0;
65
65
-
border-bottom-width: 0;
66
66
-
padding: $padding;
67
67
-
transition: border-radius 0;
62
62
+
.row {
63
63
+
@include widget;
64
64
+
border-radius: 0;
65
65
+
border-bottom-width: 0;
66
66
+
padding: $padding;
67
67
+
transition: border-radius 0;
68
68
69
69
-
&:last-child {
70
70
-
border-radius: 0 0 $radii $radii;
71
71
-
border-bottom-width: $border-width;
72
72
-
}
69
69
+
&:last-child {
70
70
+
border-radius: 0 0 $radii $radii;
71
71
+
border-bottom-width: $border-width;
72
72
+
}
73
73
74
74
-
&:first-child {
75
75
-
border-radius: $radii $radii 0 0;
76
76
-
}
74
74
+
&:first-child {
75
75
+
border-radius: $radii $radii 0 0;
76
76
+
}
77
77
78
78
-
&:first-child:last-child {
79
79
-
border-radius: $radii;
80
80
-
}
78
78
+
&:first-child:last-child {
79
79
+
border-radius: $radii;
80
80
+
}
81
81
82
82
-
.overlay-padding {
83
83
-
min-height: $font-size * 3;
84
84
-
}
82
82
+
.overlay-padding {
83
83
+
min-height: $font-size * 3;
84
84
+
}
85
85
86
86
-
&:hover {
87
87
-
background-color: $hover;
88
88
-
}
86
86
+
&:hover {
87
87
+
background-color: $hover;
88
88
+
}
89
89
90
90
-
entry,
91
91
-
button {
92
92
-
@include button;
93
93
-
padding: $padding;
94
94
-
}
90
90
+
entry,
91
91
+
button {
92
92
+
@include button;
93
93
+
padding: $padding;
94
94
+
}
95
95
96
96
-
switch {
97
97
-
@include switch;
98
98
-
}
96
96
+
switch {
97
97
+
@include switch;
98
98
+
}
99
99
100
100
-
spinbutton {
101
101
-
@include unset;
100
100
+
spinbutton {
101
101
+
@include unset;
102
102
103
103
-
entry {
104
104
-
border-radius: $radii 0 0 $radii;
105
105
-
}
103
103
+
entry {
104
104
+
border-radius: $radii 0 0 $radii;
105
105
+
}
106
106
107
107
-
button {
108
108
-
border-radius: 0;
109
109
-
}
107
107
+
button {
108
108
+
border-radius: 0;
109
109
+
}
110
110
111
111
-
button:last-child {
112
112
-
border-radius: 0 $radii $radii 0;
113
113
-
}
114
114
-
}
111
111
+
button:last-child {
112
112
+
border-radius: 0 $radii $radii 0;
113
113
+
}
114
114
+
}
115
115
116
116
-
.enum-setter {
117
117
-
label {
118
118
-
background-color: $widget-bg;
119
119
-
border-top: $border;
120
120
-
border-bottom: $border;
121
121
-
padding: 0 $padding;
122
122
-
}
116
116
+
.enum-setter {
117
117
+
label {
118
118
+
background-color: $widget-bg;
119
119
+
border-top: $border;
120
120
+
border-bottom: $border;
121
121
+
padding: 0 $padding;
122
122
+
}
123
123
124
124
-
button:first-child {
125
125
-
border-radius: $radii 0 0 $radii;
126
126
-
}
124
124
+
button:first-child {
125
125
+
border-radius: $radii 0 0 $radii;
126
126
+
}
127
127
128
128
-
button:last-child {
129
129
-
border-radius: 0 $radii $radii 0;
130
130
-
}
131
131
-
}
132
132
-
}
128
128
+
button:last-child {
129
129
+
border-radius: 0 $radii $radii 0;
130
130
+
}
131
131
+
}
132
132
+
}
133
133
134
134
-
.id,
135
135
-
.note {
136
136
-
font-size: 0.8em;
137
137
-
color: transparentize($fg-color, $amount: 0.5);
138
138
-
}
134
134
+
.id,
135
135
+
.note {
136
136
+
font-size: 0.8em;
137
137
+
color: transparentize($fg-color, $amount: 0.5);
138
138
+
}
139
139
140
140
-
.id {
141
141
-
font-family: $mono-font;
142
142
-
}
140
140
+
.id {
141
141
+
font-family: $mono-font;
142
142
+
}
143
143
}
+31
-31
home/isabel/programs/configs/gui/bars/ags/config/services/brightness.js
···
3
3
import { dependencies } from "../utils.js";
4
4
5
5
class Brightness extends Service {
6
6
-
static {
7
7
-
Service.register(
8
8
-
this,
9
9
-
{},
10
10
-
{
11
11
-
screen: ["float", "rw"],
12
12
-
},
13
13
-
);
14
14
-
}
6
6
+
static {
7
7
+
Service.register(
8
8
+
this,
9
9
+
{},
10
10
+
{
11
11
+
screen: ["float", "rw"],
12
12
+
},
13
13
+
);
14
14
+
}
15
15
16
16
-
#screen = 0;
16
16
+
#screen = 0;
17
17
18
18
-
get screen() {
19
19
-
return this.#screen;
20
20
-
}
18
18
+
get screen() {
19
19
+
return this.#screen;
20
20
+
}
21
21
22
22
-
set screen(percent) {
23
23
-
if (!dependencies(["brightnessctl"])) return;
22
22
+
set screen(percent) {
23
23
+
if (!dependencies(["brightnessctl"])) return;
24
24
25
25
-
if (percent < 0) percent = 0;
25
25
+
if (percent < 0) percent = 0;
26
26
27
27
-
if (percent > 1) percent = 1;
27
27
+
if (percent > 1) percent = 1;
28
28
29
29
-
Utils.execAsync(`brightnessctl s ${percent * 100}% -q`)
30
30
-
.then(() => {
31
31
-
this.#screen = percent;
32
32
-
this.changed("screen");
33
33
-
})
34
34
-
.catch(console.error);
35
35
-
}
29
29
+
Utils.execAsync(`brightnessctl s ${percent * 100}% -q`)
30
30
+
.then(() => {
31
31
+
this.#screen = percent;
32
32
+
this.changed("screen");
33
33
+
})
34
34
+
.catch(console.error);
35
35
+
}
36
36
37
37
-
constructor() {
38
38
-
super();
39
39
-
if (dependencies(["brightnessctl"])) {
40
40
-
this.#screen =
41
41
-
Number(Utils.exec("brightnessctl g")) /
42
42
-
Number(Utils.exec("brightnessctl m"));
43
43
-
}
37
37
+
constructor() {
38
38
+
super();
39
39
+
if (dependencies(["brightnessctl"])) {
40
40
+
this.#screen =
41
41
+
Number(Utils.exec("brightnessctl g")) /
42
42
+
Number(Utils.exec("brightnessctl m"));
44
43
}
44
44
+
}
45
45
}
46
46
47
47
export default new Brightness();
+50
-50
home/isabel/programs/configs/gui/bars/ags/config/services/colorpicker.js
···
7
7
const COLORS_CACHE = Utils.CACHE_DIR + "/colorpicker.json";
8
8
9
9
class Colors extends Service {
10
10
-
static {
11
11
-
Service.register(
12
12
-
this,
13
13
-
{},
14
14
-
{
15
15
-
colors: ["jsobject"],
16
16
-
},
17
17
-
);
18
18
-
}
10
10
+
static {
11
11
+
Service.register(
12
12
+
this,
13
13
+
{},
14
14
+
{
15
15
+
colors: ["jsobject"],
16
16
+
},
17
17
+
);
18
18
+
}
19
19
20
20
-
/** @type {Variable<string[]>} */
21
21
-
#colors = new Variable([]);
22
22
-
get colors() {
23
23
-
return this.#colors.value;
24
24
-
}
25
25
-
26
26
-
#notifID = 0;
20
20
+
/** @type {Variable<string[]>} */
21
21
+
#colors = new Variable([]);
22
22
+
get colors() {
23
23
+
return this.#colors.value;
24
24
+
}
27
25
28
28
-
constructor() {
29
29
-
super();
26
26
+
#notifID = 0;
30
27
31
31
-
this.#colors.connect("changed", () => this.changed("colors"));
28
28
+
constructor() {
29
29
+
super();
32
30
33
33
-
Utils.readFileAsync(COLORS_CACHE)
34
34
-
.then((out) => this.#colors.setValue(JSON.parse(out || "[]")))
35
35
-
.catch(() => print("no colorpicker cache found"));
36
36
-
}
31
31
+
this.#colors.connect("changed", () => this.changed("colors"));
37
32
38
38
-
/** @param {string} color */
39
39
-
wlCopy(color) {
40
40
-
Utils.execAsync(["wl-copy", color]).catch((err) => console.error(err));
41
41
-
}
33
33
+
Utils.readFileAsync(COLORS_CACHE)
34
34
+
.then((out) => this.#colors.setValue(JSON.parse(out || "[]")))
35
35
+
.catch(() => print("no colorpicker cache found"));
36
36
+
}
42
37
43
43
-
async pick() {
44
44
-
if (!dependencies(["hyprpicker"])) return;
38
38
+
/** @param {string} color */
39
39
+
wlCopy(color) {
40
40
+
Utils.execAsync(["wl-copy", color]).catch((err) => console.error(err));
41
41
+
}
45
42
46
46
-
const color = await Utils.execAsync("hyprpicker");
47
47
-
if (!color) return;
43
43
+
async pick() {
44
44
+
if (!dependencies(["hyprpicker"])) return;
48
45
49
49
-
this.wlCopy(color);
50
50
-
const list = this.#colors.value;
51
51
-
if (!list.includes(color)) {
52
52
-
list.push(color);
53
53
-
if (list.length > 10) list.shift();
46
46
+
const color = await Utils.execAsync("hyprpicker");
47
47
+
if (!color) return;
54
48
55
55
-
this.#colors.value = list;
56
56
-
Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE).catch(
57
57
-
(err) => console.error(err),
58
58
-
);
59
59
-
}
49
49
+
this.wlCopy(color);
50
50
+
const list = this.#colors.value;
51
51
+
if (!list.includes(color)) {
52
52
+
list.push(color);
53
53
+
if (list.length > 10) list.shift();
60
54
61
61
-
this.#notifID = Notifications.Notify(
62
62
-
"Color Picker",
63
63
-
this.#notifID,
64
64
-
"color-select-symbolic",
65
65
-
color,
66
66
-
"",
67
67
-
[],
68
68
-
{},
69
69
-
);
55
55
+
this.#colors.value = list;
56
56
+
Utils.writeFile(JSON.stringify(list, null, 2), COLORS_CACHE).catch(
57
57
+
(err) => console.error(err),
58
58
+
);
70
59
}
60
60
+
61
61
+
this.#notifID = Notifications.Notify(
62
62
+
"Color Picker",
63
63
+
this.#notifID,
64
64
+
"color-select-symbolic",
65
65
+
color,
66
66
+
"",
67
67
+
[],
68
68
+
{},
69
69
+
);
70
70
+
}
71
71
}
72
72
73
73
export default new Colors();
+31
-31
home/isabel/programs/configs/gui/bars/ags/config/services/onScreenIndicator.js
···
6
6
import Brightness from "./brightness.js";
7
7
8
8
class Indicator extends Service {
9
9
-
static {
10
10
-
Service.register(this, {
11
11
-
popup: ["double", "string"],
12
12
-
});
13
13
-
}
9
9
+
static {
10
10
+
Service.register(this, {
11
11
+
popup: ["double", "string"],
12
12
+
});
13
13
+
}
14
14
15
15
-
#delay = 1500;
16
16
-
#count = 0;
17
17
-
/**
18
18
-
* @param {number} value - 0 < v < 1
19
19
-
* @param {string} icon
20
20
-
*/
21
21
-
popup(value, icon) {
22
22
-
this.emit("popup", value, icon);
23
23
-
this.#count++;
24
24
-
Utils.timeout(this.#delay, () => {
25
25
-
this.#count--;
15
15
+
#delay = 1500;
16
16
+
#count = 0;
17
17
+
/**
18
18
+
* @param {number} value - 0 < v < 1
19
19
+
* @param {string} icon
20
20
+
*/
21
21
+
popup(value, icon) {
22
22
+
this.emit("popup", value, icon);
23
23
+
this.#count++;
24
24
+
Utils.timeout(this.#delay, () => {
25
25
+
this.#count--;
26
26
27
27
-
if (this.#count === 0) this.emit("popup", -1, icon);
28
28
-
});
29
29
-
}
27
27
+
if (this.#count === 0) this.emit("popup", -1, icon);
28
28
+
});
29
29
+
}
30
30
31
31
-
speaker() {
32
32
-
this.popup(
33
33
-
Audio.speaker?.volume || 0,
34
34
-
getAudioTypeIcon(Audio.speaker?.icon_name || ""),
35
35
-
);
36
36
-
}
31
31
+
speaker() {
32
32
+
this.popup(
33
33
+
Audio.speaker?.volume || 0,
34
34
+
getAudioTypeIcon(Audio.speaker?.icon_name || ""),
35
35
+
);
36
36
+
}
37
37
38
38
-
display() {
39
39
-
// brightness is async, so lets wait a bit
40
40
-
Utils.timeout(10, () =>
41
41
-
this.popup(Brightness.screen, icons.brightness.screen),
42
42
-
);
43
43
-
}
38
38
+
display() {
39
39
+
// brightness is async, so lets wait a bit
40
40
+
Utils.timeout(10, () =>
41
41
+
this.popup(Brightness.screen, icons.brightness.screen),
42
42
+
);
43
43
+
}
44
44
}
45
45
46
46
export default new Indicator();
+31
-31
home/isabel/programs/configs/gui/bars/ags/config/services/powermenu.js
···
2
2
import Service from "resource:///com/github/Aylur/ags/service.js";
3
3
4
4
class PowerMenu extends Service {
5
5
-
static {
6
6
-
Service.register(
7
7
-
this,
8
8
-
{},
9
9
-
{
10
10
-
title: ["string"],
11
11
-
cmd: ["string"],
12
12
-
},
13
13
-
);
14
14
-
}
5
5
+
static {
6
6
+
Service.register(
7
7
+
this,
8
8
+
{},
9
9
+
{
10
10
+
title: ["string"],
11
11
+
cmd: ["string"],
12
12
+
},
13
13
+
);
14
14
+
}
15
15
16
16
-
#title = "";
17
17
-
#cmd = "";
16
16
+
#title = "";
17
17
+
#cmd = "";
18
18
19
19
-
get title() {
20
20
-
return this.#title;
21
21
-
}
22
22
-
get cmd() {
23
23
-
return this.#cmd;
24
24
-
}
19
19
+
get title() {
20
20
+
return this.#title;
21
21
+
}
22
22
+
get cmd() {
23
23
+
return this.#cmd;
24
24
+
}
25
25
26
26
-
/** @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action */
27
27
-
action(action) {
28
28
-
[this.#cmd, this.#title] = {
29
29
-
sleep: ["systemctl suspend", "Sleep"],
30
30
-
reboot: ["systemctl reboot", "Reboot"],
31
31
-
logout: ["hyprctl dispatch exit 0", "Log Out"],
32
32
-
shutdown: ["shutdown now", "Shutdown"],
33
33
-
}[action];
26
26
+
/** @param {'sleep' | 'reboot' | 'logout' | 'shutdown'} action */
27
27
+
action(action) {
28
28
+
[this.#cmd, this.#title] = {
29
29
+
sleep: ["systemctl suspend", "Sleep"],
30
30
+
reboot: ["systemctl reboot", "Reboot"],
31
31
+
logout: ["hyprctl dispatch exit 0", "Log Out"],
32
32
+
shutdown: ["shutdown now", "Shutdown"],
33
33
+
}[action];
34
34
35
35
-
this.notify("cmd");
36
36
-
this.notify("title");
37
37
-
this.emit("changed");
38
38
-
App.closeWindow("powermenu");
39
39
-
}
35
35
+
this.notify("cmd");
36
36
+
this.notify("title");
37
37
+
this.emit("changed");
38
38
+
App.closeWindow("powermenu");
39
39
+
}
40
40
}
41
41
42
42
export default new PowerMenu();
+265
-274
home/isabel/programs/configs/gui/bars/ags/config/settings/SettingsDialog.js
···
8
8
9
9
const optionsList = getOptions();
10
10
const categories = Array.from(
11
11
-
new Set(optionsList.map((opt) => opt.category)),
11
11
+
new Set(optionsList.map((opt) => opt.category)),
12
12
).filter((category) => category !== "exclude");
13
13
14
14
const currentPage = Variable(categories[0]);
15
15
const search = Variable("");
16
16
const showSearch = Variable(false);
17
17
showSearch.connect("changed", ({ value }) => {
18
18
-
if (!value) search.value = "";
18
18
+
if (!value) search.value = "";
19
19
});
20
20
21
21
/** @param {import('./option.js').Opt<string>} opt */
22
22
const EnumSetter = (opt) => {
23
23
-
const lbl = Widget.Label({ binds: [["label", opt]] });
24
24
-
const step = (dir = 1) => {
25
25
-
const i = opt.enums.findIndex((i) => i === lbl.label);
26
26
-
opt.setValue(
27
27
-
dir > 0
28
28
-
? i + dir > opt.enums.length - 1
29
29
-
? opt.enums[0]
30
30
-
: opt.enums[i + dir]
31
31
-
: i + dir < 0
32
32
-
? opt.enums[opt.enums.length - 1]
33
33
-
: opt.enums[i + dir],
34
34
-
true,
35
35
-
);
36
36
-
};
37
37
-
const next = Widget.Button({
38
38
-
child: Widget.Icon(icons.ui.arrow.right),
39
39
-
on_clicked: () => step(+1),
40
40
-
});
41
41
-
const prev = Widget.Button({
42
42
-
child: Widget.Icon(icons.ui.arrow.left),
43
43
-
on_clicked: () => step(-1),
44
44
-
});
45
45
-
return Widget.Box({
46
46
-
class_name: "enum-setter",
47
47
-
children: [prev, lbl, next],
48
48
-
});
23
23
+
const lbl = Widget.Label({ binds: [["label", opt]] });
24
24
+
const step = (dir = 1) => {
25
25
+
const i = opt.enums.findIndex((i) => i === lbl.label);
26
26
+
opt.setValue(
27
27
+
dir > 0
28
28
+
? i + dir > opt.enums.length - 1
29
29
+
? opt.enums[0]
30
30
+
: opt.enums[i + dir]
31
31
+
: i + dir < 0
32
32
+
? opt.enums[opt.enums.length - 1]
33
33
+
: opt.enums[i + dir],
34
34
+
true,
35
35
+
);
36
36
+
};
37
37
+
const next = Widget.Button({
38
38
+
child: Widget.Icon(icons.ui.arrow.right),
39
39
+
on_clicked: () => step(+1),
40
40
+
});
41
41
+
const prev = Widget.Button({
42
42
+
child: Widget.Icon(icons.ui.arrow.left),
43
43
+
on_clicked: () => step(-1),
44
44
+
});
45
45
+
return Widget.Box({
46
46
+
class_name: "enum-setter",
47
47
+
children: [prev, lbl, next],
48
48
+
});
49
49
};
50
50
51
51
/** @param {import('./option.js').Opt} opt */
52
52
const Setter = (opt) => {
53
53
-
switch (opt.type) {
54
54
-
case "number":
55
55
-
return Widget.SpinButton({
56
56
-
setup(self) {
57
57
-
self.set_range(0, 1000);
58
58
-
self.set_increments(1, 5);
59
59
-
},
60
60
-
connections: [
61
61
-
["value-changed", (self) => opt.setValue(self.value, true)],
62
62
-
[opt, (self) => (self.value = opt.value)],
63
63
-
],
64
64
-
});
65
65
-
case "float":
66
66
-
case "object":
67
67
-
return Widget.Entry({
68
68
-
on_accept: (self) =>
69
69
-
opt.setValue(JSON.parse(self.text || ""), true),
70
70
-
connections: [
71
71
-
[opt, (self) => (self.text = JSON.stringify(opt.value))],
72
72
-
],
73
73
-
});
74
74
-
case "string":
75
75
-
return Widget.Entry({
76
76
-
on_accept: (self) => opt.setValue(self.text, true),
77
77
-
connections: [[opt, (self) => (self.text = opt.value)]],
78
78
-
});
79
79
-
case "enum":
80
80
-
return EnumSetter(opt);
81
81
-
case "boolean":
82
82
-
return Widget.Switch({
83
83
-
connections: [
84
84
-
[
85
85
-
"notify::active",
86
86
-
(self) => opt.setValue(self.active, true),
87
87
-
],
88
88
-
[opt, (self) => (self.active = opt.value)],
89
89
-
],
90
90
-
});
91
91
-
case "img":
92
92
-
return Widget.FileChooserButton({
93
93
-
connections: [
94
94
-
[
95
95
-
"selection-changed",
96
96
-
(self) => {
97
97
-
opt.setValue(
98
98
-
self.get_uri()?.replace("file://", ""),
99
99
-
true,
100
100
-
);
101
101
-
},
102
102
-
],
103
103
-
],
104
104
-
});
105
105
-
case "font":
106
106
-
return Widget.FontButton({
107
107
-
show_size: false,
108
108
-
use_size: false,
109
109
-
connections: [
110
110
-
["notify::font", ({ font }) => opt.setValue(font, true)],
111
111
-
[opt, (self) => (self.font = opt.value)],
112
112
-
],
113
113
-
});
114
114
-
default:
115
115
-
return Widget.Label({
116
116
-
label: "no setter with type " + opt.type,
117
117
-
});
118
118
-
}
53
53
+
switch (opt.type) {
54
54
+
case "number":
55
55
+
return Widget.SpinButton({
56
56
+
setup(self) {
57
57
+
self.set_range(0, 1000);
58
58
+
self.set_increments(1, 5);
59
59
+
},
60
60
+
connections: [
61
61
+
["value-changed", (self) => opt.setValue(self.value, true)],
62
62
+
[opt, (self) => (self.value = opt.value)],
63
63
+
],
64
64
+
});
65
65
+
case "float":
66
66
+
case "object":
67
67
+
return Widget.Entry({
68
68
+
on_accept: (self) => opt.setValue(JSON.parse(self.text || ""), true),
69
69
+
connections: [[opt, (self) => (self.text = JSON.stringify(opt.value))]],
70
70
+
});
71
71
+
case "string":
72
72
+
return Widget.Entry({
73
73
+
on_accept: (self) => opt.setValue(self.text, true),
74
74
+
connections: [[opt, (self) => (self.text = opt.value)]],
75
75
+
});
76
76
+
case "enum":
77
77
+
return EnumSetter(opt);
78
78
+
case "boolean":
79
79
+
return Widget.Switch({
80
80
+
connections: [
81
81
+
["notify::active", (self) => opt.setValue(self.active, true)],
82
82
+
[opt, (self) => (self.active = opt.value)],
83
83
+
],
84
84
+
});
85
85
+
case "img":
86
86
+
return Widget.FileChooserButton({
87
87
+
connections: [
88
88
+
[
89
89
+
"selection-changed",
90
90
+
(self) => {
91
91
+
opt.setValue(self.get_uri()?.replace("file://", ""), true);
92
92
+
},
93
93
+
],
94
94
+
],
95
95
+
});
96
96
+
case "font":
97
97
+
return Widget.FontButton({
98
98
+
show_size: false,
99
99
+
use_size: false,
100
100
+
connections: [
101
101
+
["notify::font", ({ font }) => opt.setValue(font, true)],
102
102
+
[opt, (self) => (self.font = opt.value)],
103
103
+
],
104
104
+
});
105
105
+
default:
106
106
+
return Widget.Label({
107
107
+
label: "no setter with type " + opt.type,
108
108
+
});
109
109
+
}
119
110
};
120
111
121
112
/** @param {import('./option.js').Opt} opt */
122
113
const Row = (opt) =>
123
123
-
Widget.Box({
124
124
-
class_name: "row",
125
125
-
setup: (self) => (self.opt = opt),
114
114
+
Widget.Box({
115
115
+
class_name: "row",
116
116
+
setup: (self) => (self.opt = opt),
117
117
+
children: [
118
118
+
Widget.Box({
119
119
+
vertical: true,
120
120
+
vpack: "center",
126
121
children: [
127
127
-
Widget.Box({
128
128
-
vertical: true,
129
129
-
vpack: "center",
130
130
-
children: [
131
131
-
opt.title &&
132
132
-
Widget.Label({
133
133
-
xalign: 0,
134
134
-
class_name: "summary",
135
135
-
label: opt.title,
136
136
-
}),
137
137
-
Widget.Label({
138
138
-
xalign: 0,
139
139
-
class_name: "id",
140
140
-
label: `id: "${opt.id}"`,
141
141
-
}),
142
142
-
],
122
122
+
opt.title &&
123
123
+
Widget.Label({
124
124
+
xalign: 0,
125
125
+
class_name: "summary",
126
126
+
label: opt.title,
143
127
}),
144
144
-
Widget.Box({ hexpand: true }),
145
145
-
Widget.Box({
146
146
-
vpack: "center",
147
147
-
vertical: true,
148
148
-
children: [
149
149
-
Widget.Box({
150
150
-
hpack: "end",
151
151
-
child: Setter(opt),
152
152
-
}),
153
153
-
opt.note &&
154
154
-
Widget.Label({
155
155
-
xalign: 1,
156
156
-
class_name: "note",
157
157
-
label: opt.note,
158
158
-
}),
159
159
-
],
128
128
+
Widget.Label({
129
129
+
xalign: 0,
130
130
+
class_name: "id",
131
131
+
label: `id: "${opt.id}"`,
132
132
+
}),
133
133
+
],
134
134
+
}),
135
135
+
Widget.Box({ hexpand: true }),
136
136
+
Widget.Box({
137
137
+
vpack: "center",
138
138
+
vertical: true,
139
139
+
children: [
140
140
+
Widget.Box({
141
141
+
hpack: "end",
142
142
+
child: Setter(opt),
143
143
+
}),
144
144
+
opt.note &&
145
145
+
Widget.Label({
146
146
+
xalign: 1,
147
147
+
class_name: "note",
148
148
+
label: opt.note,
160
149
}),
161
150
],
162
162
-
});
151
151
+
}),
152
152
+
],
153
153
+
});
163
154
164
155
/** @param {string} category */
165
156
const Page = (category) =>
166
166
-
Widget.Scrollable({
157
157
+
Widget.Scrollable({
158
158
+
vexpand: true,
159
159
+
class_name: "page",
160
160
+
child: Widget.Box({
161
161
+
class_name: "page-content vertical",
162
162
+
vertical: true,
163
163
+
connections: [
164
164
+
[
165
165
+
search,
166
166
+
(self) => {
167
167
+
for (const child of self.children) {
168
168
+
child.visible =
169
169
+
child.opt.id.includes(search.value) ||
170
170
+
child.opt.title.includes(search.value) ||
171
171
+
child.opt.note.includes(search.value);
172
172
+
}
173
173
+
},
174
174
+
],
175
175
+
],
176
176
+
children: optionsList
177
177
+
.filter((opt) => opt.category.includes(category))
178
178
+
.map(Row),
179
179
+
}),
180
180
+
});
181
181
+
182
182
+
const sidebar = Widget.Revealer({
183
183
+
binds: [["reveal-child", search, "value", (v) => !v]],
184
184
+
transition: "slide_right",
185
185
+
child: Widget.Box({
186
186
+
hexpand: false,
187
187
+
vertical: true,
188
188
+
children: [
189
189
+
Widget.Box({
190
190
+
class_name: "sidebar-header",
191
191
+
child: Widget.Button({
192
192
+
hexpand: true,
193
193
+
label: icons.dialog.Search + " Search",
194
194
+
on_clicked: () => (showSearch.value = !showSearch.value),
195
195
+
}),
196
196
+
}),
197
197
+
Widget.Scrollable({
167
198
vexpand: true,
168
168
-
class_name: "page",
199
199
+
hscroll: "never",
169
200
child: Widget.Box({
170
170
-
class_name: "page-content vertical",
171
171
-
vertical: true,
172
172
-
connections: [
173
173
-
[
174
174
-
search,
175
175
-
(self) => {
176
176
-
for (const child of self.children) {
177
177
-
child.visible =
178
178
-
child.opt.id.includes(search.value) ||
179
179
-
child.opt.title.includes(search.value) ||
180
180
-
child.opt.note.includes(search.value);
181
181
-
}
182
182
-
},
201
201
+
class_name: "sidebar-box vertical",
202
202
+
vertical: true,
203
203
+
children: [
204
204
+
...categories.map((name) =>
205
205
+
Widget.Button({
206
206
+
label: (icons.dialog[name] || "") + " " + name,
207
207
+
xalign: 0,
208
208
+
binds: [
209
209
+
[
210
210
+
"class-name",
211
211
+
currentPage,
212
212
+
"value",
213
213
+
(v) => (v === name ? "active" : ""),
214
214
+
],
183
215
],
184
184
-
],
185
185
-
children: optionsList
186
186
-
.filter((opt) => opt.category.includes(category))
187
187
-
.map(Row),
216
216
+
on_clicked: () => currentPage.setValue(name),
217
217
+
}),
218
218
+
),
219
219
+
],
220
220
+
}),
221
221
+
}),
222
222
+
Widget.Box({
223
223
+
class_name: "sidebar-footer",
224
224
+
child: Widget.Button({
225
225
+
class_name: "copy",
226
226
+
child: Widget.Label({
227
227
+
label: " Save",
228
228
+
xalign: 0,
229
229
+
}),
230
230
+
hexpand: true,
231
231
+
on_clicked: () => {
232
232
+
Utils.execAsync(["wl-copy", getValues()]);
233
233
+
print(getValues());
234
234
+
Utils.execAsync([
235
235
+
"notify-send",
236
236
+
"-i",
237
237
+
"preferences-desktop-theme-symbolic",
238
238
+
"Theme copied to clipboard",
239
239
+
'To save it permanently, make a new theme in <span weight="bold">themes.js</span>',
240
240
+
]);
241
241
+
},
188
242
}),
189
189
-
});
190
190
-
191
191
-
const sidebar = Widget.Revealer({
192
192
-
binds: [["reveal-child", search, "value", (v) => !v]],
193
193
-
transition: "slide_right",
194
194
-
child: Widget.Box({
195
195
-
hexpand: false,
196
196
-
vertical: true,
197
197
-
children: [
198
198
-
Widget.Box({
199
199
-
class_name: "sidebar-header",
200
200
-
child: Widget.Button({
201
201
-
hexpand: true,
202
202
-
label: icons.dialog.Search + " Search",
203
203
-
on_clicked: () => (showSearch.value = !showSearch.value),
204
204
-
}),
205
205
-
}),
206
206
-
Widget.Scrollable({
207
207
-
vexpand: true,
208
208
-
hscroll: "never",
209
209
-
child: Widget.Box({
210
210
-
class_name: "sidebar-box vertical",
211
211
-
vertical: true,
212
212
-
children: [
213
213
-
...categories.map((name) =>
214
214
-
Widget.Button({
215
215
-
label: (icons.dialog[name] || "") + " " + name,
216
216
-
xalign: 0,
217
217
-
binds: [
218
218
-
[
219
219
-
"class-name",
220
220
-
currentPage,
221
221
-
"value",
222
222
-
(v) => (v === name ? "active" : ""),
223
223
-
],
224
224
-
],
225
225
-
on_clicked: () => currentPage.setValue(name),
226
226
-
}),
227
227
-
),
228
228
-
],
229
229
-
}),
230
230
-
}),
231
231
-
Widget.Box({
232
232
-
class_name: "sidebar-footer",
233
233
-
child: Widget.Button({
234
234
-
class_name: "copy",
235
235
-
child: Widget.Label({
236
236
-
label: " Save",
237
237
-
xalign: 0,
238
238
-
}),
239
239
-
hexpand: true,
240
240
-
on_clicked: () => {
241
241
-
Utils.execAsync(["wl-copy", getValues()]);
242
242
-
print(getValues());
243
243
-
Utils.execAsync([
244
244
-
"notify-send",
245
245
-
"-i",
246
246
-
"preferences-desktop-theme-symbolic",
247
247
-
"Theme copied to clipboard",
248
248
-
'To save it permanently, make a new theme in <span weight="bold">themes.js</span>',
249
249
-
]);
250
250
-
},
251
251
-
}),
252
252
-
}),
253
253
-
],
254
254
-
}),
243
243
+
}),
244
244
+
],
245
245
+
}),
255
246
});
256
247
257
248
const searchEntry = Widget.Revealer({
258
258
-
transition: "slide_down",
259
259
-
binds: [
260
260
-
["reveal-child", showSearch],
261
261
-
["transition-duration", options.transition],
249
249
+
transition: "slide_down",
250
250
+
binds: [
251
251
+
["reveal-child", showSearch],
252
252
+
["transition-duration", options.transition],
253
253
+
],
254
254
+
child: Widget.Entry({
255
255
+
connections: [
256
256
+
[
257
257
+
showSearch,
258
258
+
(self) => {
259
259
+
if (!showSearch.value) self.text = "";
260
260
+
261
261
+
if (showSearch.value) self.grab_focus();
262
262
+
},
263
263
+
],
262
264
],
263
263
-
child: Widget.Entry({
264
264
-
connections: [
265
265
-
[
266
266
-
showSearch,
267
267
-
(self) => {
268
268
-
if (!showSearch.value) self.text = "";
269
269
-
270
270
-
if (showSearch.value) self.grab_focus();
271
271
-
},
272
272
-
],
273
273
-
],
274
274
-
hexpand: true,
275
275
-
class_name: "search",
276
276
-
placeholder_text: "Search Options",
277
277
-
secondary_icon_name: icons.apps.search,
278
278
-
on_change: ({ text }) => (search.value = text || ""),
279
279
-
}),
265
265
+
hexpand: true,
266
266
+
class_name: "search",
267
267
+
placeholder_text: "Search Options",
268
268
+
secondary_icon_name: icons.apps.search,
269
269
+
on_change: ({ text }) => (search.value = text || ""),
270
270
+
}),
280
271
});
281
272
282
273
const categoriesStack = Widget.Stack({
283
283
-
transition: "slide_left_right",
284
284
-
items: categories.map((name) => [name, Page(name)]),
285
285
-
binds: [
286
286
-
["shown", currentPage],
287
287
-
["visible", search, "value", (v) => !v],
288
288
-
],
274
274
+
transition: "slide_left_right",
275
275
+
items: categories.map((name) => [name, Page(name)]),
276
276
+
binds: [
277
277
+
["shown", currentPage],
278
278
+
["visible", search, "value", (v) => !v],
279
279
+
],
289
280
});
290
281
291
282
const searchPage = Widget.Box({
292
292
-
binds: [["visible", search, "value", (v) => !!v]],
293
293
-
child: Page(""),
283
283
+
binds: [["visible", search, "value", (v) => !!v]],
284
284
+
child: Page(""),
294
285
});
295
286
296
287
export default RegularWindow({
297
297
-
name: "settings-dialog",
298
298
-
title: "Settings",
299
299
-
setup: (win) => win.set_default_size(800, 500),
300
300
-
connections: [
301
301
-
[
302
302
-
"delete-event",
303
303
-
(win) => {
304
304
-
win.hide();
305
305
-
return true;
306
306
-
},
307
307
-
],
308
308
-
[
309
309
-
"key-press-event",
310
310
-
(self, event) => {
311
311
-
if (event.get_keyval()[1] === imports.gi.Gdk.KEY_Escape) {
312
312
-
self.text = "";
313
313
-
showSearch.setValue(false);
314
314
-
search.setValue("");
315
315
-
}
316
316
-
},
317
317
-
],
288
288
+
name: "settings-dialog",
289
289
+
title: "Settings",
290
290
+
setup: (win) => win.set_default_size(800, 500),
291
291
+
connections: [
292
292
+
[
293
293
+
"delete-event",
294
294
+
(win) => {
295
295
+
win.hide();
296
296
+
return true;
297
297
+
},
298
298
+
],
299
299
+
[
300
300
+
"key-press-event",
301
301
+
(self, event) => {
302
302
+
if (event.get_keyval()[1] === imports.gi.Gdk.KEY_Escape) {
303
303
+
self.text = "";
304
304
+
showSearch.setValue(false);
305
305
+
search.setValue("");
306
306
+
}
307
307
+
},
308
308
+
],
309
309
+
],
310
310
+
child: Widget.Box({
311
311
+
children: [
312
312
+
sidebar,
313
313
+
Widget.Box({
314
314
+
vertical: true,
315
315
+
children: [searchEntry, categoriesStack, searchPage],
316
316
+
}),
318
317
],
319
319
-
child: Widget.Box({
320
320
-
children: [
321
321
-
sidebar,
322
322
-
Widget.Box({
323
323
-
vertical: true,
324
324
-
children: [searchEntry, categoriesStack, searchPage],
325
325
-
}),
326
326
-
],
327
327
-
}),
318
318
+
}),
328
319
});
+19
-19
home/isabel/programs/configs/gui/bars/ags/config/settings/globals.js
···
1
1
import Mpris from "resource:///com/github/Aylur/ags/service/mpris.js";
2
2
3
3
export async function globals() {
4
4
-
globalThis.options = (await import("../options.js")).default;
5
5
-
globalThis.iconBrowser = (await import("../misc/IconBrowser.js")).default;
6
6
-
globalThis.app = (
7
7
-
await import("resource:///com/github/Aylur/ags/app.js")
8
8
-
).default;
9
9
-
globalThis.audio = (
10
10
-
await import("resource:///com/github/Aylur/ags/service/audio.js")
11
11
-
).default;
12
12
-
globalThis.brightness = (await import("../services/brightness.js")).default;
13
13
-
globalThis.indicator = (
14
14
-
await import("../services/onScreenIndicator.js")
15
15
-
).default;
16
16
-
Mpris.connect("player-added", (mpris, bus) => {
17
17
-
mpris.getPlayer(bus)?.connect("changed", (player) => {
18
18
-
globalThis.mpris = player || Mpris.players[0];
19
19
-
});
20
20
-
});
21
21
-
Mpris.connect("player-closed", () => {
22
22
-
globalThis.mpris = Mpris.players[0];
4
4
+
globalThis.options = (await import("../options.js")).default;
5
5
+
globalThis.iconBrowser = (await import("../misc/IconBrowser.js")).default;
6
6
+
globalThis.app = (
7
7
+
await import("resource:///com/github/Aylur/ags/app.js")
8
8
+
).default;
9
9
+
globalThis.audio = (
10
10
+
await import("resource:///com/github/Aylur/ags/service/audio.js")
11
11
+
).default;
12
12
+
globalThis.brightness = (await import("../services/brightness.js")).default;
13
13
+
globalThis.indicator = (
14
14
+
await import("../services/onScreenIndicator.js")
15
15
+
).default;
16
16
+
Mpris.connect("player-added", (mpris, bus) => {
17
17
+
mpris.getPlayer(bus)?.connect("changed", (player) => {
18
18
+
globalThis.mpris = player || Mpris.players[0];
23
19
});
20
20
+
});
21
21
+
Mpris.connect("player-closed", () => {
22
22
+
globalThis.mpris = Mpris.players[0];
23
23
+
});
24
24
}
+26
-27
home/isabel/programs/configs/gui/bars/ags/config/settings/hyprland.js
···
7
7
8
8
/** @param {Array<string>} batch */
9
9
function sendBatch(batch) {
10
10
-
const cmd = batch
11
11
-
.filter((x) => !!x)
12
12
-
.map((x) => `keyword ${x}`)
13
13
-
.join("; ");
10
10
+
const cmd = batch
11
11
+
.filter((x) => !!x)
12
12
+
.map((x) => `keyword ${x}`)
13
13
+
.join("; ");
14
14
15
15
-
Hyprland.sendMessage(`[[BATCH]]/${cmd}`);
15
15
+
Hyprland.sendMessage(`[[BATCH]]/${cmd}`);
16
16
}
17
17
18
18
export function hyprlandInit() {
19
19
-
if (readFile("/tmp/ags/hyprland-init")) return;
19
19
+
if (readFile("/tmp/ags/hyprland-init")) return;
20
20
21
21
-
sendBatch(
22
22
-
Array.from(App.windows).flatMap(([name]) => [
23
23
-
`layerrule blur, ${name}`,
24
24
-
noIgnorealpha.some((skip) => name.includes(skip))
25
25
-
? ""
26
26
-
: `layerrule ignorealpha 0.6, ${name}`,
27
27
-
]),
28
28
-
);
21
21
+
sendBatch(
22
22
+
Array.from(App.windows).flatMap(([name]) => [
23
23
+
`layerrule blur, ${name}`,
24
24
+
noIgnorealpha.some((skip) => name.includes(skip))
25
25
+
? ""
26
26
+
: `layerrule ignorealpha 0.6, ${name}`,
27
27
+
]),
28
28
+
);
29
29
30
30
-
writeFile("init", "/tmp/ags/hyprland-init");
31
31
-
setupHyprland();
30
30
+
writeFile("init", "/tmp/ags/hyprland-init");
31
31
+
setupHyprland();
32
32
}
33
33
34
34
export async function setupHyprland() {
35
35
-
const wm_gaps = options.hypr.wm_gaps.value;
36
36
-
const bar_style = options.bar.style.value;
37
37
-
const bar_pos = options.bar.position.value;
35
35
+
const wm_gaps = options.hypr.wm_gaps.value;
36
36
+
const bar_style = options.bar.style.value;
37
37
+
const bar_pos = options.bar.position.value;
38
38
39
39
-
const batch = [];
39
39
+
const batch = [];
40
40
41
41
-
JSON.parse(await Hyprland.sendMessage("j/monitors")).forEach(({ name }) => {
42
42
-
const v = bar_pos === "top" ? `-${wm_gaps},0,0,0` : `0,-${wm_gaps},0,0`;
43
43
-
if (bar_style !== "normal")
44
44
-
batch.push(`monitor ${name},addreserved,${v}`);
45
45
-
else batch.push(`monitor ${name},addreserved,0,0,0,0`);
46
46
-
});
41
41
+
JSON.parse(await Hyprland.sendMessage("j/monitors")).forEach(({ name }) => {
42
42
+
const v = bar_pos === "top" ? `-${wm_gaps},0,0,0` : `0,-${wm_gaps},0,0`;
43
43
+
if (bar_style !== "normal") batch.push(`monitor ${name},addreserved,${v}`);
44
44
+
else batch.push(`monitor ${name},addreserved,0,0,0,0`);
45
45
+
});
47
46
48
48
-
sendBatch(batch);
47
47
+
sendBatch(batch);
49
48
}
+117
-119
home/isabel/programs/configs/gui/bars/ags/config/settings/option.js
···
1
1
import {
2
2
-
CACHE_DIR,
3
3
-
readFile,
4
4
-
writeFile,
2
2
+
CACHE_DIR,
3
3
+
readFile,
4
4
+
writeFile,
5
5
} from "resource:///com/github/Aylur/ags/utils.js";
6
6
import { exec } from "resource:///com/github/Aylur/ags/utils.js";
7
7
import options from "../options.js";
···
31
31
32
32
/** @template T */
33
33
export class Opt extends Service {
34
34
-
static {
35
35
-
Service.register(
36
36
-
this,
37
37
-
{},
38
38
-
{
39
39
-
value: ["jsobject"],
40
40
-
},
41
41
-
);
42
42
-
}
34
34
+
static {
35
35
+
Service.register(
36
36
+
this,
37
37
+
{},
38
38
+
{
39
39
+
value: ["jsobject"],
40
40
+
},
41
41
+
);
42
42
+
}
43
43
44
44
-
#value;
45
45
-
#scss = "";
46
46
-
unit = "px";
47
47
-
noReload = false;
48
48
-
id = "";
49
49
-
title = "";
50
50
-
note = "";
51
51
-
type = "";
52
52
-
category = "";
44
44
+
#value;
45
45
+
#scss = "";
46
46
+
unit = "px";
47
47
+
noReload = false;
48
48
+
id = "";
49
49
+
title = "";
50
50
+
note = "";
51
51
+
type = "";
52
52
+
category = "";
53
53
54
54
-
/** @type {Array<string>} */
55
55
-
enums = [];
54
54
+
/** @type {Array<string>} */
55
55
+
enums = [];
56
56
57
57
-
/** @type {(v: T) => any} */
58
58
-
format = (v) => v;
57
57
+
/** @type {(v: T) => any} */
58
58
+
format = (v) => v;
59
59
60
60
-
/** @type {(v: T) => any} */
61
61
-
scssFormat = (v) => v;
60
60
+
/** @type {(v: T) => any} */
61
61
+
scssFormat = (v) => v;
62
62
63
63
-
/**
64
64
-
* @param {T} value
65
65
-
* @param {OptionConfig<T> =} config
66
66
-
*/
67
67
-
constructor(value, config) {
68
68
-
super();
69
69
-
this.#value = value;
70
70
-
this.defaultValue = value;
71
71
-
this.type = typeof value;
63
63
+
/**
64
64
+
* @param {T} value
65
65
+
* @param {OptionConfig<T> =} config
66
66
+
*/
67
67
+
constructor(value, config) {
68
68
+
super();
69
69
+
this.#value = value;
70
70
+
this.defaultValue = value;
71
71
+
this.type = typeof value;
72
72
73
73
-
if (config) Object.keys(config).forEach((c) => (this[c] = config[c]));
73
73
+
if (config) Object.keys(config).forEach((c) => (this[c] = config[c]));
74
74
75
75
-
import("../options.js").then(this.#init.bind(this));
76
76
-
}
75
75
+
import("../options.js").then(this.#init.bind(this));
76
76
+
}
77
77
78
78
-
set scss(scss) {
79
79
-
this.#scss = scss;
80
80
-
}
81
81
-
get scss() {
82
82
-
return this.#scss || this.id.split(".").join("-").split("_").join("-");
83
83
-
}
78
78
+
set scss(scss) {
79
79
+
this.#scss = scss;
80
80
+
}
81
81
+
get scss() {
82
82
+
return this.#scss || this.id.split(".").join("-").split("_").join("-");
83
83
+
}
84
84
85
85
-
#init() {
86
86
-
getOptions(); // sets the ids as a side effect
85
85
+
#init() {
86
86
+
getOptions(); // sets the ids as a side effect
87
87
88
88
-
if (cacheObj[this.id] !== undefined) this.setValue(cacheObj[this.id]);
88
88
+
if (cacheObj[this.id] !== undefined) this.setValue(cacheObj[this.id]);
89
89
90
90
-
const words = this.id
91
91
-
.split(".")
92
92
-
.flatMap((w) => w.split("_"))
93
93
-
.map((word) => word.charAt(0).toUpperCase() + word.slice(1));
90
90
+
const words = this.id
91
91
+
.split(".")
92
92
+
.flatMap((w) => w.split("_"))
93
93
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1));
94
94
95
95
-
this.title ||= words.join(" ");
96
96
-
this.category ||=
97
97
-
words.length === 1 ? "General" : words.at(0) || "General";
95
95
+
this.title ||= words.join(" ");
96
96
+
this.category ||= words.length === 1 ? "General" : words.at(0) || "General";
98
97
99
99
-
this.connect("changed", () => {
100
100
-
cacheObj[this.id] = this.value;
101
101
-
writeFile(JSON.stringify(cacheObj, null, 2), CACHE_FILE);
102
102
-
});
103
103
-
}
98
98
+
this.connect("changed", () => {
99
99
+
cacheObj[this.id] = this.value;
100
100
+
writeFile(JSON.stringify(cacheObj, null, 2), CACHE_FILE);
101
101
+
});
102
102
+
}
104
103
105
105
-
get value() {
106
106
-
return this.#value;
107
107
-
}
108
108
-
set value(value) {
109
109
-
this.setValue(value);
110
110
-
}
104
104
+
get value() {
105
105
+
return this.#value;
106
106
+
}
107
107
+
set value(value) {
108
108
+
this.setValue(value);
109
109
+
}
111
110
112
112
-
/** @param {T} value */
113
113
-
setValue(value, reload = false) {
114
114
-
if (typeof value !== typeof this.defaultValue) {
115
115
-
console.error(
116
116
-
Error(
117
117
-
`WrongType: Option "${this.id}" can't be set to ${value}, ` +
118
118
-
`expected "${typeof this
119
119
-
.defaultValue}", but got "${typeof value}"`,
120
120
-
),
121
121
-
);
111
111
+
/** @param {T} value */
112
112
+
setValue(value, reload = false) {
113
113
+
if (typeof value !== typeof this.defaultValue) {
114
114
+
console.error(
115
115
+
Error(
116
116
+
`WrongType: Option "${this.id}" can't be set to ${value}, ` +
117
117
+
`expected "${typeof this.defaultValue}", but got "${typeof value}"`,
118
118
+
),
119
119
+
);
122
120
123
123
-
return;
124
124
-
}
121
121
+
return;
122
122
+
}
125
123
126
126
-
if (this.value !== value) {
127
127
-
this.#value = this.format(value);
128
128
-
this.changed("value");
124
124
+
if (this.value !== value) {
125
125
+
this.#value = this.format(value);
126
126
+
this.changed("value");
129
127
130
130
-
if (reload && !this.noReload) {
131
131
-
reloadScss();
132
132
-
setupHyprland();
133
133
-
}
134
134
-
}
128
128
+
if (reload && !this.noReload) {
129
129
+
reloadScss();
130
130
+
setupHyprland();
131
131
+
}
135
132
}
133
133
+
}
136
134
137
137
-
reset(reload = false) {
138
138
-
this.setValue(this.defaultValue, reload);
139
139
-
}
135
135
+
reset(reload = false) {
136
136
+
this.setValue(this.defaultValue, reload);
137
137
+
}
140
138
}
141
139
142
140
/**
···
146
144
* @returns {Opt<T>}
147
145
*/
148
146
export function Option(value, config) {
149
149
-
return new Opt(value, config);
147
147
+
return new Opt(value, config);
150
148
}
151
149
152
150
/** @returns {Array<Opt<any>>} */
153
151
export function getOptions(object = options, path = "") {
154
154
-
return Object.keys(object).flatMap((key) => {
155
155
-
/** @type Option<any> */
156
156
-
const obj = object[key];
157
157
-
const id = path ? path + "." + key : key;
152
152
+
return Object.keys(object).flatMap((key) => {
153
153
+
/** @type Option<any> */
154
154
+
const obj = object[key];
155
155
+
const id = path ? path + "." + key : key;
158
156
159
159
-
if (obj instanceof Opt) {
160
160
-
obj.id = id;
161
161
-
return obj;
162
162
-
}
157
157
+
if (obj instanceof Opt) {
158
158
+
obj.id = id;
159
159
+
return obj;
160
160
+
}
163
161
164
164
-
if (typeof obj === "object") return getOptions(obj, id);
162
162
+
if (typeof obj === "object") return getOptions(obj, id);
165
163
166
166
-
return [];
167
167
-
});
164
164
+
return [];
165
165
+
});
168
166
}
169
167
170
168
export function resetOptions() {
171
171
-
exec(`rm -rf ${CACHE_FILE}`);
172
172
-
cacheObj = {};
173
173
-
getOptions().forEach((opt) => opt.reset());
169
169
+
exec(`rm -rf ${CACHE_FILE}`);
170
170
+
cacheObj = {};
171
171
+
getOptions().forEach((opt) => opt.reset());
174
172
}
175
173
176
174
export function getValues() {
177
177
-
const obj = {};
178
178
-
for (const opt of getOptions()) {
179
179
-
if (opt.category !== "exclude") obj[opt.id] = opt.value;
180
180
-
}
175
175
+
const obj = {};
176
176
+
for (const opt of getOptions()) {
177
177
+
if (opt.category !== "exclude") obj[opt.id] = opt.value;
178
178
+
}
181
179
182
182
-
return JSON.stringify(obj, null, 2);
180
180
+
return JSON.stringify(obj, null, 2);
183
181
}
184
182
185
183
/** @param {string | object} config */
186
184
export function apply(config) {
187
187
-
const options = getOptions();
188
188
-
const settings = typeof config === "string" ? JSON.parse(config) : config;
185
185
+
const options = getOptions();
186
186
+
const settings = typeof config === "string" ? JSON.parse(config) : config;
189
187
190
190
-
for (const id of Object.keys(settings)) {
191
191
-
const opt = options.find((opt) => opt.id === id);
192
192
-
if (!opt) {
193
193
-
print(`No option with id: "${id}"`);
194
194
-
continue;
195
195
-
}
196
196
-
197
197
-
opt.setValue(settings[id]);
188
188
+
for (const id of Object.keys(settings)) {
189
189
+
const opt = options.find((opt) => opt.id === id);
190
190
+
if (!opt) {
191
191
+
print(`No option with id: "${id}"`);
192
192
+
continue;
198
193
}
194
194
+
195
195
+
opt.setValue(settings[id]);
196
196
+
}
199
197
}
+41
-41
home/isabel/programs/configs/gui/bars/ags/config/settings/scss.js
···
4
4
import { dependencies } from "../utils.js";
5
5
6
6
export function scssWatcher() {
7
7
-
return Utils.subprocess(
8
8
-
[
9
9
-
"inotifywait",
10
10
-
"--recursive",
11
11
-
"--event",
12
12
-
"create,modify",
13
13
-
"-m",
14
14
-
App.configDir + "/scss",
15
15
-
],
16
16
-
reloadScss,
17
17
-
() => print("missing dependancy for css hotreload: inotify-tools"),
18
18
-
);
7
7
+
return Utils.subprocess(
8
8
+
[
9
9
+
"inotifywait",
10
10
+
"--recursive",
11
11
+
"--event",
12
12
+
"create,modify",
13
13
+
"-m",
14
14
+
App.configDir + "/scss",
15
15
+
],
16
16
+
reloadScss,
17
17
+
() => print("missing dependancy for css hotreload: inotify-tools"),
18
18
+
);
19
19
}
20
20
21
21
/**
···
26
26
* options.bar.style.value => $bar-style
27
27
*/
28
28
export async function reloadScss() {
29
29
-
if (!dependencies(["sassc"])) return;
29
29
+
if (!dependencies(["sassc"])) return;
30
30
31
31
-
const opts = getOptions();
32
32
-
const vars = opts.map((opt) => {
33
33
-
if (opt.scss === "exclude") return "";
31
31
+
const opts = getOptions();
32
32
+
const vars = opts.map((opt) => {
33
33
+
if (opt.scss === "exclude") return "";
34
34
35
35
-
const name = opt.id.split(".").join("-").split("_").join("-");
36
36
-
const unit = typeof opt.value === "number" ? opt.unit : "";
37
37
-
const value = opt.scssFormat ? opt.scssFormat(opt.value) : opt.value;
38
38
-
print(opt.scss, opt.id);
39
39
-
return `$${opt.scss || name}: ${value}${unit};`;
40
40
-
});
35
35
+
const name = opt.id.split(".").join("-").split("_").join("-");
36
36
+
const unit = typeof opt.value === "number" ? opt.unit : "";
37
37
+
const value = opt.scssFormat ? opt.scssFormat(opt.value) : opt.value;
38
38
+
print(opt.scss, opt.id);
39
39
+
return `$${opt.scss || name}: ${value}${unit};`;
40
40
+
});
41
41
42
42
-
const bar_style = opts.find((opt) => opt.id === "bar.style")?.value || "";
43
43
-
const additional =
44
44
-
bar_style === "normal"
45
45
-
? "//"
46
46
-
: `
42
42
+
const bar_style = opts.find((opt) => opt.id === "bar.style")?.value || "";
43
43
+
const additional =
44
44
+
bar_style === "normal"
45
45
+
? "//"
46
46
+
: `
47
47
window#quicksettings .window-content {
48
48
margin-right: $wm-gaps;
49
49
}
···
53
53
}
54
54
`;
55
55
56
56
-
try {
57
57
-
const tmp = "/tmp/ags/scss";
58
58
-
Utils.ensureDirectory(tmp);
59
59
-
await Utils.writeFile(vars.join("\n"), `${tmp}/options.scss`);
60
60
-
await Utils.writeFile(additional, `${tmp}/additional.scss`);
61
61
-
await Utils.execAsync(
62
62
-
`sassc ${App.configDir}/scss/main.scss ${tmp}/style.css`,
63
63
-
);
64
64
-
App.resetCss();
65
65
-
App.applyCss(`${tmp}/style.css`);
66
66
-
} catch (error) {
67
67
-
if (error instanceof Error) console.error(error.message);
56
56
+
try {
57
57
+
const tmp = "/tmp/ags/scss";
58
58
+
Utils.ensureDirectory(tmp);
59
59
+
await Utils.writeFile(vars.join("\n"), `${tmp}/options.scss`);
60
60
+
await Utils.writeFile(additional, `${tmp}/additional.scss`);
61
61
+
await Utils.execAsync(
62
62
+
`sassc ${App.configDir}/scss/main.scss ${tmp}/style.css`,
63
63
+
);
64
64
+
App.resetCss();
65
65
+
App.applyCss(`${tmp}/style.css`);
66
66
+
} catch (error) {
67
67
+
if (error instanceof Error) console.error(error.message);
68
68
69
69
-
if (typeof error === "string") console.error(error);
70
70
-
}
69
69
+
if (typeof error === "string") console.error(error);
70
70
+
}
71
71
}
+50
-52
home/isabel/programs/configs/gui/bars/ags/config/settings/setup.js
···
10
10
import Gtk from "gi://Gtk";
11
11
12
12
export function init() {
13
13
-
notificationBlacklist();
14
14
-
warnOnLowBattery();
15
15
-
globals();
16
16
-
gsettigsColorScheme();
17
17
-
gtkFontSettings();
18
18
-
scssWatcher();
13
13
+
notificationBlacklist();
14
14
+
warnOnLowBattery();
15
15
+
globals();
16
16
+
gsettigsColorScheme();
17
17
+
gtkFontSettings();
18
18
+
scssWatcher();
19
19
20
20
-
reloadScss();
21
21
-
hyprlandInit();
22
22
-
setupHyprland();
23
23
-
wallpaper();
20
20
+
reloadScss();
21
21
+
hyprlandInit();
22
22
+
setupHyprland();
23
23
+
wallpaper();
24
24
}
25
25
26
26
function gsettigsColorScheme() {
27
27
-
if (!Utils.exec("which gsettings")) return;
27
27
+
if (!Utils.exec("which gsettings")) return;
28
28
29
29
-
options.theme.scheme.connect("changed", ({ value }) => {
30
30
-
const gsettings =
31
31
-
"gsettings set org.gnome.desktop.interface color-scheme";
32
32
-
Utils.execAsync(`${gsettings} "prefer-${value}"`).catch((err) =>
33
33
-
console.error(err.message),
34
34
-
);
35
35
-
});
29
29
+
options.theme.scheme.connect("changed", ({ value }) => {
30
30
+
const gsettings = "gsettings set org.gnome.desktop.interface color-scheme";
31
31
+
Utils.execAsync(`${gsettings} "prefer-${value}"`).catch((err) =>
32
32
+
console.error(err.message),
33
33
+
);
34
34
+
});
36
35
}
37
36
38
37
function gtkFontSettings() {
39
39
-
const settings = Gtk.Settings.get_default();
40
40
-
if (!settings) {
41
41
-
console.error(Error("Gtk.Settings unavailable"));
42
42
-
return;
43
43
-
}
38
38
+
const settings = Gtk.Settings.get_default();
39
39
+
if (!settings) {
40
40
+
console.error(Error("Gtk.Settings unavailable"));
41
41
+
return;
42
42
+
}
44
43
45
45
-
const callback = () => {
46
46
-
const { size, font } = options.font;
47
47
-
settings.gtk_font_name = `${font.value} ${size.value}`;
48
48
-
};
44
44
+
const callback = () => {
45
45
+
const { size, font } = options.font;
46
46
+
settings.gtk_font_name = `${font.value} ${size.value}`;
47
47
+
};
49
48
50
50
-
options.font.font.connect("notify::value", callback);
51
51
-
options.font.size.connect("notify::value", callback);
49
49
+
options.font.font.connect("notify::value", callback);
50
50
+
options.font.size.connect("notify::value", callback);
52
51
}
53
52
54
53
function notificationBlacklist() {
55
55
-
Notifications.connect("notified", (_, id) => {
56
56
-
const n = Notifications.getNotification(id);
57
57
-
options.notifications.black_list.value.forEach((item) => {
58
58
-
if (n?.app_name.includes(item) || n?.app_entry?.includes(item))
59
59
-
n.close();
60
60
-
});
54
54
+
Notifications.connect("notified", (_, id) => {
55
55
+
const n = Notifications.getNotification(id);
56
56
+
options.notifications.black_list.value.forEach((item) => {
57
57
+
if (n?.app_name.includes(item) || n?.app_entry?.includes(item)) n.close();
61
58
});
59
59
+
});
62
60
}
63
61
64
62
function warnOnLowBattery() {
65
65
-
Battery.connect("notify::percent", () => {
66
66
-
const low = options.battery.low.value;
67
67
-
if (
68
68
-
Battery.percent !== low ||
69
69
-
Battery.percent !== low / 2 ||
70
70
-
!Battery.charging
71
71
-
)
72
72
-
return;
63
63
+
Battery.connect("notify::percent", () => {
64
64
+
const low = options.battery.low.value;
65
65
+
if (
66
66
+
Battery.percent !== low ||
67
67
+
Battery.percent !== low / 2 ||
68
68
+
!Battery.charging
69
69
+
)
70
70
+
return;
73
71
74
74
-
Utils.execAsync([
75
75
-
"notify-send",
76
76
-
`${Battery.percent}% Battery Percentage`,
77
77
-
"-i",
78
78
-
icons.battery.warning,
79
79
-
"-u",
80
80
-
"critical",
81
81
-
]);
82
82
-
});
72
72
+
Utils.execAsync([
73
73
+
"notify-send",
74
74
+
`${Battery.percent}% Battery Percentage`,
75
75
+
"-i",
76
76
+
icons.battery.warning,
77
77
+
"-u",
78
78
+
"critical",
79
79
+
]);
80
80
+
});
83
81
}
+31
-31
home/isabel/programs/configs/gui/bars/ags/config/settings/theme.js
···
7
7
8
8
/** @param {string} name */
9
9
export function setTheme(name) {
10
10
-
options.reset();
11
11
-
const theme = themes.find((t) => t.name === name);
12
12
-
if (!theme) return print("No theme named " + name);
10
10
+
options.reset();
11
11
+
const theme = themes.find((t) => t.name === name);
12
12
+
if (!theme) return print("No theme named " + name);
13
13
14
14
-
options.apply(theme.options);
15
15
-
reloadScss();
16
16
-
setupHyprland();
17
17
-
wallpaper();
14
14
+
options.apply(theme.options);
15
15
+
reloadScss();
16
16
+
setupHyprland();
17
17
+
wallpaper();
18
18
}
19
19
20
20
export const WP = `/home/${USER}/media/pictures/wallpapers/`;
21
21
22
22
export const lightColors = {
23
23
-
"theme.scheme": "light",
24
24
-
"color.red": "#d20f39",
25
25
-
"color.green": "#40a02b",
26
26
-
"color.yellow": "#df8e1d",
27
27
-
"color.blue": "#209fb5",
28
28
-
"color.magenta": "#8839ef",
29
29
-
"color.teal": "#179299",
30
30
-
"color.orange": "#fe640b",
31
31
-
"theme.bg": "#eff1f5",
32
32
-
"theme.fg": "#4c4f69",
23
23
+
"theme.scheme": "light",
24
24
+
"color.red": "#d20f39",
25
25
+
"color.green": "#40a02b",
26
26
+
"color.yellow": "#df8e1d",
27
27
+
"color.blue": "#209fb5",
28
28
+
"color.magenta": "#8839ef",
29
29
+
"color.teal": "#179299",
30
30
+
"color.orange": "#fe640b",
31
31
+
"theme.bg": "#eff1f5",
32
32
+
"theme.fg": "#4c4f69",
33
33
};
34
34
35
35
export const Theme = ({ name, icon = " ", ...options }) => ({
36
36
-
name,
37
37
-
icon,
38
38
-
options: {
39
39
-
"theme.name": name,
40
40
-
"theme.icon": icon,
41
41
-
...options,
42
42
-
},
36
36
+
name,
37
37
+
icon,
38
38
+
options: {
39
39
+
"theme.name": name,
40
40
+
"theme.icon": icon,
41
41
+
...options,
42
42
+
},
43
43
});
44
44
45
45
let settingsDialog;
46
46
export async function openSettings() {
47
47
-
if (settingsDialog) return settingsDialog.present();
47
47
+
if (settingsDialog) return settingsDialog.present();
48
48
49
49
-
try {
50
50
-
settingsDialog = (await import("./SettingsDialog.js")).default;
51
51
-
settingsDialog.present();
52
52
-
} catch (error) {
53
53
-
if (error instanceof Error) console.error(error.message);
54
54
-
}
49
49
+
try {
50
50
+
settingsDialog = (await import("./SettingsDialog.js")).default;
51
51
+
settingsDialog.present();
52
52
+
} catch (error) {
53
53
+
if (error instanceof Error) console.error(error.message);
54
54
+
}
55
55
}
+8
-8
home/isabel/programs/configs/gui/bars/ags/config/settings/wallpaper.js
···
3
3
import { dependencies } from "../utils.js";
4
4
5
5
export function initWallpaper() {
6
6
-
if (dependencies(["swww"])) {
7
7
-
exec("swww init");
8
8
-
options.desktop.wallpaper.img.connect("changed", wallpaper);
9
9
-
}
6
6
+
if (dependencies(["swww"])) {
7
7
+
exec("swww init");
8
8
+
options.desktop.wallpaper.img.connect("changed", wallpaper);
9
9
+
}
10
10
}
11
11
12
12
export function wallpaper() {
13
13
-
if (!dependencies(["swww"])) return;
13
13
+
if (!dependencies(["swww"])) return;
14
14
15
15
-
execAsync(["swww", "img", options.desktop.wallpaper.img.value]).catch(
16
16
-
(err) => console.error(err),
17
17
-
);
15
15
+
execAsync(["swww", "img", options.desktop.wallpaper.img.value]).catch((err) =>
16
16
+
console.error(err),
17
17
+
);
18
18
}
+11
-11
home/isabel/programs/configs/gui/bars/ags/config/themes.js
···
1
1
import { Theme, WP, lightColors } from "./settings/theme.js";
2
2
3
3
export default [
4
4
-
Theme({
5
5
-
name: "Mocha",
6
6
-
icon: "",
7
7
-
"desktop.wallpaper.img": WP + "walking.png",
8
8
-
}),
9
9
-
Theme({
10
10
-
name: "Latte",
11
11
-
icon: "",
12
12
-
"desktop.wallpaper.img": WP + "card_after_training.png",
13
13
-
...lightColors,
14
14
-
}),
4
4
+
Theme({
5
5
+
name: "Mocha",
6
6
+
icon: "",
7
7
+
"desktop.wallpaper.img": WP + "walking.png",
8
8
+
}),
9
9
+
Theme({
10
10
+
name: "Latte",
11
11
+
icon: "",
12
12
+
"desktop.wallpaper.img": WP + "card_after_training.png",
13
13
+
...lightColors,
14
14
+
}),
15
15
];
+30
-30
home/isabel/programs/configs/gui/bars/ags/config/utils.js
···
9
9
* @returns {Array<number>}
10
10
*/
11
11
export function range(length, start = 1) {
12
12
-
return Array.from({ length }, (_, i) => i + start);
12
12
+
return Array.from({ length }, (_, i) => i + start);
13
13
}
14
14
15
15
/**
···
18
18
* @returns {string}
19
19
*/
20
20
export function substitute(collection, item) {
21
21
-
return collection.find(([from]) => from === item)?.[1] || item;
21
21
+
return collection.find(([from]) => from === item)?.[1] || item;
22
22
}
23
23
24
24
/**
···
26
26
* @returns {Array<import('types/widgets/window').default>}
27
27
*/
28
28
export function forMonitors(widget) {
29
29
-
const n = Gdk.Display.get_default()?.get_n_monitors() || 1;
30
30
-
return range(n, 0).map(widget).flat(1);
29
29
+
const n = Gdk.Display.get_default()?.get_n_monitors() || 1;
30
30
+
return range(n, 0).map(widget).flat(1);
31
31
}
32
32
33
33
/**
···
35
35
* @returns {any} - missing cairo type
36
36
*/
37
37
export function createSurfaceFromWidget(widget) {
38
38
-
const alloc = widget.get_allocation();
39
39
-
const surface = new cairo.ImageSurface(
40
40
-
cairo.Format.ARGB32,
41
41
-
alloc.width,
42
42
-
alloc.height,
43
43
-
);
44
44
-
const cr = new cairo.Context(surface);
45
45
-
cr.setSourceRGBA(255, 255, 255, 0);
46
46
-
cr.rectangle(0, 0, alloc.width, alloc.height);
47
47
-
cr.fill();
48
48
-
widget.draw(cr);
38
38
+
const alloc = widget.get_allocation();
39
39
+
const surface = new cairo.ImageSurface(
40
40
+
cairo.Format.ARGB32,
41
41
+
alloc.width,
42
42
+
alloc.height,
43
43
+
);
44
44
+
const cr = new cairo.Context(surface);
45
45
+
cr.setSourceRGBA(255, 255, 255, 0);
46
46
+
cr.rectangle(0, 0, alloc.width, alloc.height);
47
47
+
cr.fill();
48
48
+
widget.draw(cr);
49
49
50
50
-
return surface;
50
50
+
return surface;
51
51
}
52
52
53
53
/** @param {string} icon */
54
54
export function getAudioTypeIcon(icon) {
55
55
-
const substitues = [
56
56
-
["audio-headset-bluetooth", icons.audio.type.headset],
57
57
-
["audio-card-analog-usb", icons.audio.type.speaker],
58
58
-
["audio-card-analog-pci", icons.audio.type.card],
59
59
-
];
55
55
+
const substitues = [
56
56
+
["audio-headset-bluetooth", icons.audio.type.headset],
57
57
+
["audio-card-analog-usb", icons.audio.type.speaker],
58
58
+
["audio-card-analog-pci", icons.audio.type.card],
59
59
+
];
60
60
61
61
-
return substitute(substitues, icon);
61
61
+
return substitute(substitues, icon);
62
62
}
63
63
64
64
/** @param {import('types/service/applications').Application} app */
65
65
export function launchApp(app) {
66
66
-
Utils.execAsync(["hyprctl", "dispatch", "exec", `sh -c ${app.executable}`]);
67
67
-
app.frequency += 1;
66
66
+
Utils.execAsync(["hyprctl", "dispatch", "exec", `sh -c ${app.executable}`]);
67
67
+
app.frequency += 1;
68
68
}
69
69
70
70
/** @param {Array<string>} bins */
71
71
export function dependencies(bins) {
72
72
-
const deps = bins.map((bin) => {
73
73
-
const has = Utils.exec(`which ${bin}`);
74
74
-
if (!has) print(`missing dependency: ${bin}`);
72
72
+
const deps = bins.map((bin) => {
73
73
+
const has = Utils.exec(`which ${bin}`);
74
74
+
if (!has) print(`missing dependency: ${bin}`);
75
75
76
76
-
return !!has;
77
77
-
});
76
76
+
return !!has;
77
77
+
});
78
78
79
79
-
return deps.every((has) => has);
79
79
+
return deps.every((has) => has);
80
80
}
+54
-54
home/isabel/programs/configs/gui/bars/ags/config/variables.js
···
5
5
const interval = options.systemFetchInterval;
6
6
7
7
export const uptime = Variable("", {
8
8
-
poll: [
9
9
-
60_000,
10
10
-
"cat /proc/uptime",
11
11
-
(line) => {
12
12
-
const uptime = Number.parseInt(line.split(".")[0]) / 60;
13
13
-
const h = Math.floor(uptime / 60);
14
14
-
const s = Math.floor(uptime % 60);
15
15
-
return `${h}:${s < 10 ? "0" + s : s}`;
16
16
-
},
17
17
-
],
8
8
+
poll: [
9
9
+
60_000,
10
10
+
"cat /proc/uptime",
11
11
+
(line) => {
12
12
+
const uptime = Number.parseInt(line.split(".")[0]) / 60;
13
13
+
const h = Math.floor(uptime / 60);
14
14
+
const s = Math.floor(uptime % 60);
15
15
+
return `${h}:${s < 10 ? "0" + s : s}`;
16
16
+
},
17
17
+
],
18
18
});
19
19
20
20
export const distro = GLib.get_os_info("ID");
21
21
22
22
export const distroIcon = (() => {
23
23
-
switch (distro) {
24
24
-
case "fedora":
25
25
-
return "";
26
26
-
case "arch":
27
27
-
return "";
28
28
-
case "nixos":
29
29
-
return "";
30
30
-
case "debian":
31
31
-
return "";
32
32
-
case "opensuse-tumbleweed":
33
33
-
return "";
34
34
-
case "ubuntu":
35
35
-
return "";
36
36
-
case "endeavouros":
37
37
-
return "";
38
38
-
default:
39
39
-
return "";
40
40
-
}
23
23
+
switch (distro) {
24
24
+
case "fedora":
25
25
+
return "";
26
26
+
case "arch":
27
27
+
return "";
28
28
+
case "nixos":
29
29
+
return "";
30
30
+
case "debian":
31
31
+
return "";
32
32
+
case "opensuse-tumbleweed":
33
33
+
return "";
34
34
+
case "ubuntu":
35
35
+
return "";
36
36
+
case "endeavouros":
37
37
+
return "";
38
38
+
default:
39
39
+
return "";
40
40
+
}
41
41
})();
42
42
43
43
/** @type {function([string, string] | string[]): number} */
44
44
const divide = ([total, free]) => free / total;
45
45
46
46
export const cpu = Variable(0, {
47
47
-
poll: [
48
48
-
interval,
49
49
-
"top -b -n 1",
50
50
-
(out) =>
51
51
-
divide([
52
52
-
100,
53
53
-
out
54
54
-
.split("\n")
55
55
-
.find((line) => line.includes("Cpu(s)"))
56
56
-
?.split(/\s+/)[1]
57
57
-
.replace(",", "."),
58
58
-
]),
59
59
-
],
47
47
+
poll: [
48
48
+
interval,
49
49
+
"top -b -n 1",
50
50
+
(out) =>
51
51
+
divide([
52
52
+
100,
53
53
+
out
54
54
+
.split("\n")
55
55
+
.find((line) => line.includes("Cpu(s)"))
56
56
+
?.split(/\s+/)[1]
57
57
+
.replace(",", "."),
58
58
+
]),
59
59
+
],
60
60
});
61
61
62
62
export const ram = Variable(0, {
63
63
-
poll: [
64
64
-
interval,
65
65
-
"free",
66
66
-
(out) =>
67
67
-
divide(
68
68
-
out
69
69
-
.split("\n")
70
70
-
.find((line) => line.includes("Mem:"))
71
71
-
?.split(/\s+/)
72
72
-
.splice(1, 2),
73
73
-
),
74
74
-
],
63
63
+
poll: [
64
64
+
interval,
65
65
+
"free",
66
66
+
(out) =>
67
67
+
divide(
68
68
+
out
69
69
+
.split("\n")
70
70
+
.find((line) => line.includes("Mem:"))
71
71
+
?.split(/\s+/)
72
72
+
.splice(1, 2),
73
73
+
),
74
74
+
],
75
75
});
76
76
77
77
export const temp = Variable(0, {
78
78
-
poll: [interval, "cat " + options.temperature, (n) => n / 100_000],
78
78
+
poll: [interval, "cat " + options.temperature, (n) => n / 100_000],
79
79
});
+35
-35
home/isabel/programs/configs/gui/bars/ags/config/windows/applauncher/AppItem.js
···
5
5
6
6
/** @param {import('resource:///com/github/Aylur/ags/service/applications.js').Application} app */
7
7
export default (app) => {
8
8
-
const title = Widget.Label({
9
9
-
class_name: "title",
10
10
-
label: app.name,
11
11
-
xalign: 0,
12
12
-
vpack: "center",
13
13
-
truncate: "end",
14
14
-
});
8
8
+
const title = Widget.Label({
9
9
+
class_name: "title",
10
10
+
label: app.name,
11
11
+
xalign: 0,
12
12
+
vpack: "center",
13
13
+
truncate: "end",
14
14
+
});
15
15
16
16
-
const description = Widget.Label({
17
17
-
class_name: "description",
18
18
-
label: app.description || "",
19
19
-
wrap: true,
20
20
-
xalign: 0,
21
21
-
justification: "left",
22
22
-
vpack: "center",
23
23
-
});
16
16
+
const description = Widget.Label({
17
17
+
class_name: "description",
18
18
+
label: app.description || "",
19
19
+
wrap: true,
20
20
+
xalign: 0,
21
21
+
justification: "left",
22
22
+
vpack: "center",
23
23
+
});
24
24
25
25
-
const icon = Widget.Icon({
26
26
-
icon: lookUpIcon(app.icon_name || "") ? app.icon_name || "" : "",
27
27
-
binds: [["size", options.applauncher.icon_size]],
28
28
-
});
25
25
+
const icon = Widget.Icon({
26
26
+
icon: lookUpIcon(app.icon_name || "") ? app.icon_name || "" : "",
27
27
+
binds: [["size", options.applauncher.icon_size]],
28
28
+
});
29
29
30
30
-
const textBox = Widget.Box({
31
31
-
vertical: true,
32
32
-
vpack: "center",
33
33
-
children: app.description ? [title, description] : [title],
34
34
-
});
30
30
+
const textBox = Widget.Box({
31
31
+
vertical: true,
32
32
+
vpack: "center",
33
33
+
children: app.description ? [title, description] : [title],
34
34
+
});
35
35
36
36
-
return Widget.Button({
37
37
-
class_name: "app-item",
38
38
-
setup: (self) => (self.app = app),
39
39
-
on_clicked: () => {
40
40
-
App.closeWindow("applauncher");
41
41
-
app.launch();
42
42
-
},
43
43
-
child: Widget.Box({
44
44
-
children: [icon, textBox],
45
45
-
}),
46
46
-
});
36
36
+
return Widget.Button({
37
37
+
class_name: "app-item",
38
38
+
setup: (self) => (self.app = app),
39
39
+
on_clicked: () => {
40
40
+
App.closeWindow("applauncher");
41
41
+
app.launch();
42
42
+
},
43
43
+
child: Widget.Box({
44
44
+
children: [icon, textBox],
45
45
+
}),
46
46
+
});
47
47
};
+57
-57
home/isabel/programs/configs/gui/bars/ags/config/windows/applauncher/Applauncher.js
···
9
9
const WINDOW_NAME = "applauncher";
10
10
11
11
const Applauncher = () => {
12
12
-
const children = () => [
13
13
-
...Applications.query("").flatMap((app) => {
14
14
-
const item = AppItem(app);
15
15
-
return [
16
16
-
Widget.Separator({
17
17
-
hexpand: true,
18
18
-
binds: [["visible", item, "visible"]],
19
19
-
}),
20
20
-
item,
21
21
-
];
12
12
+
const children = () => [
13
13
+
...Applications.query("").flatMap((app) => {
14
14
+
const item = AppItem(app);
15
15
+
return [
16
16
+
Widget.Separator({
17
17
+
hexpand: true,
18
18
+
binds: [["visible", item, "visible"]],
22
19
}),
23
23
-
Widget.Separator({ hexpand: true }),
24
24
-
];
20
20
+
item,
21
21
+
];
22
22
+
}),
23
23
+
Widget.Separator({ hexpand: true }),
24
24
+
];
25
25
26
26
-
const list = Widget.Box({
27
27
-
vertical: true,
28
28
-
children: children(),
29
29
-
});
26
26
+
const list = Widget.Box({
27
27
+
vertical: true,
28
28
+
children: children(),
29
29
+
});
30
30
31
31
-
const entry = Widget.Entry({
32
32
-
hexpand: true,
33
33
-
primary_icon_name: icons.apps.search,
34
34
-
text: "-",
35
35
-
on_accept: ({ text }) => {
36
36
-
const list = Applications.query(text || "");
37
37
-
if (list[0]) {
38
38
-
App.toggleWindow(WINDOW_NAME);
39
39
-
launchApp(list[0]);
40
40
-
}
41
41
-
},
42
42
-
on_change: ({ text }) =>
43
43
-
list.children.map((item) => {
44
44
-
if (item.app) item.visible = item.app.match(text);
45
45
-
}),
46
46
-
});
31
31
+
const entry = Widget.Entry({
32
32
+
hexpand: true,
33
33
+
primary_icon_name: icons.apps.search,
34
34
+
text: "-",
35
35
+
on_accept: ({ text }) => {
36
36
+
const list = Applications.query(text || "");
37
37
+
if (list[0]) {
38
38
+
App.toggleWindow(WINDOW_NAME);
39
39
+
launchApp(list[0]);
40
40
+
}
41
41
+
},
42
42
+
on_change: ({ text }) =>
43
43
+
list.children.map((item) => {
44
44
+
if (item.app) item.visible = item.app.match(text);
45
45
+
}),
46
46
+
});
47
47
48
48
-
return Widget.Box({
49
49
-
vertical: true,
50
50
-
children: [
51
51
-
entry,
52
52
-
Widget.Scrollable({
53
53
-
hscroll: "never",
54
54
-
child: list,
55
55
-
}),
56
56
-
],
57
57
-
connections: [
58
58
-
[
59
59
-
App,
60
60
-
(_, name, visible) => {
61
61
-
if (name !== WINDOW_NAME) return;
48
48
+
return Widget.Box({
49
49
+
vertical: true,
50
50
+
children: [
51
51
+
entry,
52
52
+
Widget.Scrollable({
53
53
+
hscroll: "never",
54
54
+
child: list,
55
55
+
}),
56
56
+
],
57
57
+
connections: [
58
58
+
[
59
59
+
App,
60
60
+
(_, name, visible) => {
61
61
+
if (name !== WINDOW_NAME) return;
62
62
63
63
-
entry.text = "";
64
64
-
if (visible) entry.grab_focus();
65
65
-
},
66
66
-
],
67
67
-
],
68
68
-
});
63
63
+
entry.text = "";
64
64
+
if (visible) entry.grab_focus();
65
65
+
},
66
66
+
],
67
67
+
],
68
68
+
});
69
69
};
70
70
71
71
export default () =>
72
72
-
PopupWindow({
73
73
-
name: WINDOW_NAME,
74
74
-
transition: "slide_down",
75
75
-
child: Applauncher(),
76
76
-
});
72
72
+
PopupWindow({
73
73
+
name: WINDOW_NAME,
74
74
+
transition: "slide_down",
75
75
+
child: Applauncher(),
76
76
+
});
+64
-66
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/LeftBar.js
···
17
17
18
18
const submenuItems = Variable(1);
19
19
SystemTray.connect("changed", () => {
20
20
-
submenuItems.setValue(SystemTray.items.length + 1);
20
20
+
submenuItems.setValue(SystemTray.items.length + 1);
21
21
});
22
22
23
23
/**
···
26
26
* @param {(self: T) => boolean=} condition
27
27
*/
28
28
const SeparatorDot = (service, condition) => {
29
29
-
const visibility = (self) => {
30
30
-
if (!options.bar.separators.value) return (self.visible = false);
29
29
+
const visibility = (self) => {
30
30
+
if (!options.bar.separators.value) return (self.visible = false);
31
31
32
32
-
self.visible =
33
33
-
condition && service
34
34
-
? condition(service)
35
35
-
: options.bar.separators.value;
36
36
-
};
32
32
+
self.visible =
33
33
+
condition && service ? condition(service) : options.bar.separators.value;
34
34
+
};
37
35
38
38
-
const conn = service ? [[service, visibility]] : [];
39
39
-
return Widget.Separator({
40
40
-
connections: [["draw", visibility], ...conn],
41
41
-
binds: [["visible", options.bar.separators]],
42
42
-
vpack: "center",
43
43
-
});
36
36
+
const conn = service ? [[service, visibility]] : [];
37
37
+
return Widget.Separator({
38
38
+
connections: [["draw", visibility], ...conn],
39
39
+
binds: [["visible", options.bar.separators]],
40
40
+
vpack: "center",
41
41
+
});
44
42
};
45
43
46
44
const Start = () =>
47
47
-
Widget.Box({
48
48
-
class_name: "start",
49
49
-
vertical: true,
50
50
-
children: [
51
51
-
ApplauncherButton(),
52
52
-
Workspaces(),
53
53
-
Widget.Box({ hexpand: true }),
54
54
-
NotificationIndicator(),
55
55
-
],
56
56
-
});
45
45
+
Widget.Box({
46
46
+
class_name: "start",
47
47
+
vertical: true,
48
48
+
children: [
49
49
+
ApplauncherButton(),
50
50
+
Workspaces(),
51
51
+
Widget.Box({ hexpand: true }),
52
52
+
NotificationIndicator(),
53
53
+
],
54
54
+
});
57
55
58
56
const Center = () =>
59
59
-
Widget.Box({
60
60
-
class_name: "center",
61
61
-
vertical: true,
62
62
-
children: [DateButton()],
63
63
-
});
57
57
+
Widget.Box({
58
58
+
class_name: "center",
59
59
+
vertical: true,
60
60
+
children: [DateButton()],
61
61
+
});
64
62
65
63
const End = () =>
66
66
-
Widget.Box({
67
67
-
class_name: "end",
68
68
-
vertical: true,
69
69
-
children: [
70
70
-
SeparatorDot(Mpris, (m) => m.players.length > 0),
71
71
-
MediaIndicator({ vertical: true }),
72
72
-
Widget.Box({ hexpand: true }),
64
64
+
Widget.Box({
65
65
+
class_name: "end",
66
66
+
vertical: true,
67
67
+
children: [
68
68
+
SeparatorDot(Mpris, (m) => m.players.length > 0),
69
69
+
MediaIndicator({ vertical: true }),
70
70
+
Widget.Box({ hexpand: true }),
73
71
74
74
-
SubMenu({
75
75
-
items: submenuItems,
76
76
-
children: [SysTray({ vertical: true }), ColorPicker()],
77
77
-
}),
78
78
-
SystemIndicators({ vertical: true }),
79
79
-
BatteryBar({ vertical: true }),
80
80
-
PowerMenu({ vertical: true }),
81
81
-
],
82
82
-
});
72
72
+
SubMenu({
73
73
+
items: submenuItems,
74
74
+
children: [SysTray({ vertical: true }), ColorPicker()],
75
75
+
}),
76
76
+
SystemIndicators({ vertical: true }),
77
77
+
BatteryBar({ vertical: true }),
78
78
+
PowerMenu({ vertical: true }),
79
79
+
],
80
80
+
});
83
81
84
82
/** @param {number} monitor */
85
83
export default (monitor) =>
86
86
-
Widget.Window({
87
87
-
name: `bar${monitor}`,
88
88
-
class_name: "transparent",
89
89
-
exclusivity: "exclusive",
90
90
-
monitor,
91
91
-
binds: [
92
92
-
[
93
93
-
"anchor",
94
94
-
options.bar.position,
95
95
-
"value",
96
96
-
(pos) => [pos, "left", "bottom"],
97
97
-
],
98
98
-
],
99
99
-
child: Widget.CenterBox({
100
100
-
class_name: "panel",
101
101
-
vertical: true,
102
102
-
start_widget: Start(),
103
103
-
center_widget: Center(),
104
104
-
end_widget: End(),
105
105
-
}),
106
106
-
});
84
84
+
Widget.Window({
85
85
+
name: `bar${monitor}`,
86
86
+
class_name: "transparent",
87
87
+
exclusivity: "exclusive",
88
88
+
monitor,
89
89
+
binds: [
90
90
+
[
91
91
+
"anchor",
92
92
+
options.bar.position,
93
93
+
"value",
94
94
+
(pos) => [pos, "left", "bottom"],
95
95
+
],
96
96
+
],
97
97
+
child: Widget.CenterBox({
98
98
+
class_name: "panel",
99
99
+
vertical: true,
100
100
+
start_widget: Start(),
101
101
+
center_widget: Center(),
102
102
+
end_widget: End(),
103
103
+
}),
104
104
+
});
+28
-28
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/PanelButton.js
···
11
11
* @param {import('types/widgets/button').ButtonProps & PanelButtonProps} o
12
12
*/
13
13
export default ({
14
14
-
class_name,
15
15
-
content,
16
16
-
window = "",
17
17
-
connections = [],
18
18
-
...rest
14
14
+
class_name,
15
15
+
content,
16
16
+
window = "",
17
17
+
connections = [],
18
18
+
...rest
19
19
}) => {
20
20
-
let open = false;
20
20
+
let open = false;
21
21
22
22
-
const connection = [
23
23
-
[
24
24
-
App,
25
25
-
(self, win, visible) => {
26
26
-
if (win !== window) return;
22
22
+
const connection = [
23
23
+
[
24
24
+
App,
25
25
+
(self, win, visible) => {
26
26
+
if (win !== window) return;
27
27
28
28
-
if (open && !visible) {
29
29
-
open = false;
30
30
-
self.toggleClassName("active", false);
31
31
-
}
28
28
+
if (open && !visible) {
29
29
+
open = false;
30
30
+
self.toggleClassName("active", false);
31
31
+
}
32
32
33
33
-
if (visible) {
34
34
-
open = true;
35
35
-
self.toggleClassName("active");
36
36
-
}
37
37
-
},
38
38
-
],
39
39
-
];
33
33
+
if (visible) {
34
34
+
open = true;
35
35
+
self.toggleClassName("active");
36
36
+
}
37
37
+
},
38
38
+
],
39
39
+
];
40
40
41
41
-
return Widget.Button({
42
42
-
class_name: `panel-button ${class_name}`,
43
43
-
child: Widget.Box({ children: [content] }),
44
44
-
connections: connections.concat(connection),
45
45
-
...rest,
46
46
-
});
41
41
+
return Widget.Button({
42
42
+
class_name: `panel-button ${class_name}`,
43
43
+
child: Widget.Box({ children: [content] }),
44
44
+
connections: connections.concat(connection),
45
45
+
...rest,
46
46
+
});
47
47
};
+60
-62
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/TopBar.js
···
17
17
18
18
const submenuItems = Variable(1);
19
19
SystemTray.connect("changed", () => {
20
20
-
submenuItems.setValue(SystemTray.items.length + 1);
20
20
+
submenuItems.setValue(SystemTray.items.length + 1);
21
21
});
22
22
23
23
/**
···
26
26
* @param {(self: T) => boolean=} condition
27
27
*/
28
28
const SeparatorDot = (service, condition) => {
29
29
-
const visibility = (self) => {
30
30
-
if (!options.bar.separators.value) return (self.visible = false);
29
29
+
const visibility = (self) => {
30
30
+
if (!options.bar.separators.value) return (self.visible = false);
31
31
32
32
-
self.visible =
33
33
-
condition && service
34
34
-
? condition(service)
35
35
-
: options.bar.separators.value;
36
36
-
};
32
32
+
self.visible =
33
33
+
condition && service ? condition(service) : options.bar.separators.value;
34
34
+
};
37
35
38
38
-
const conn = service ? [[service, visibility]] : [];
39
39
-
return Widget.Separator({
40
40
-
connections: [["draw", visibility], ...conn],
41
41
-
binds: [["visible", options.bar.separators]],
42
42
-
vpack: "center",
43
43
-
});
36
36
+
const conn = service ? [[service, visibility]] : [];
37
37
+
return Widget.Separator({
38
38
+
connections: [["draw", visibility], ...conn],
39
39
+
binds: [["visible", options.bar.separators]],
40
40
+
vpack: "center",
41
41
+
});
44
42
};
45
43
46
44
const Start = () =>
47
47
-
Widget.Box({
48
48
-
class_name: "start",
49
49
-
children: [
50
50
-
ApplauncherButton(),
51
51
-
Workspaces(),
52
52
-
Widget.Box({ hexpand: true }),
53
53
-
NotificationIndicator(),
54
54
-
],
55
55
-
});
45
45
+
Widget.Box({
46
46
+
class_name: "start",
47
47
+
children: [
48
48
+
ApplauncherButton(),
49
49
+
Workspaces(),
50
50
+
Widget.Box({ hexpand: true }),
51
51
+
NotificationIndicator(),
52
52
+
],
53
53
+
});
56
54
57
55
const Center = () =>
58
58
-
Widget.Box({
59
59
-
class_name: "center",
60
60
-
children: [DateButton()],
61
61
-
});
56
56
+
Widget.Box({
57
57
+
class_name: "center",
58
58
+
children: [DateButton()],
59
59
+
});
62
60
63
61
const End = () =>
64
64
-
Widget.Box({
65
65
-
class_name: "end",
66
66
-
children: [
67
67
-
SeparatorDot(Mpris, (m) => m.players.length > 0),
68
68
-
MediaIndicator(),
69
69
-
Widget.Box({ hexpand: true }),
62
62
+
Widget.Box({
63
63
+
class_name: "end",
64
64
+
children: [
65
65
+
SeparatorDot(Mpris, (m) => m.players.length > 0),
66
66
+
MediaIndicator(),
67
67
+
Widget.Box({ hexpand: true }),
70
68
71
71
-
SubMenu({
72
72
-
items: submenuItems,
73
73
-
children: [SysTray(), ColorPicker()],
74
74
-
}),
75
75
-
SystemIndicators(),
76
76
-
BatteryBar(),
77
77
-
PowerMenu(),
78
78
-
],
79
79
-
});
69
69
+
SubMenu({
70
70
+
items: submenuItems,
71
71
+
children: [SysTray(), ColorPicker()],
72
72
+
}),
73
73
+
SystemIndicators(),
74
74
+
BatteryBar(),
75
75
+
PowerMenu(),
76
76
+
],
77
77
+
});
80
78
81
79
/** @param {number} monitor */
82
80
export default (monitor) =>
83
83
-
Widget.Window({
84
84
-
name: `bar${monitor}`,
85
85
-
class_name: "transparent",
86
86
-
exclusivity: "exclusive",
87
87
-
monitor,
88
88
-
binds: [
89
89
-
[
90
90
-
"anchor",
91
91
-
options.bar.position,
92
92
-
"value",
93
93
-
(pos) => [pos, "left", "right"],
94
94
-
],
95
95
-
],
96
96
-
child: Widget.CenterBox({
97
97
-
class_name: "panel",
98
98
-
start_widget: Start(),
99
99
-
center_widget: Center(),
100
100
-
end_widget: End(),
101
101
-
}),
102
102
-
});
81
81
+
Widget.Window({
82
82
+
name: `bar${monitor}`,
83
83
+
class_name: "transparent",
84
84
+
exclusivity: "exclusive",
85
85
+
monitor,
86
86
+
binds: [
87
87
+
[
88
88
+
"anchor",
89
89
+
options.bar.position,
90
90
+
"value",
91
91
+
(pos) => [pos, "left", "right"],
92
92
+
],
93
93
+
],
94
94
+
child: Widget.CenterBox({
95
95
+
class_name: "panel",
96
96
+
start_widget: Start(),
97
97
+
center_widget: Center(),
98
98
+
end_widget: End(),
99
99
+
}),
100
100
+
});
+13
-16
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/ApplauncherButton.js
···
4
4
import { distroIcon } from "../../../variables.js";
5
5
6
6
export default () =>
7
7
-
PanelButton({
8
8
-
class_name: "applauncher",
9
9
-
connections: [
10
10
-
[
11
11
-
App,
12
12
-
(btn, win, visible) => {
13
13
-
btn.toggleClassName(
14
14
-
"active",
15
15
-
win === "applauncher" && visible,
16
16
-
);
17
17
-
},
18
18
-
],
19
19
-
],
20
20
-
on_clicked: () => App.toggleWindow("applauncher"),
21
21
-
content: FontIcon(distroIcon),
22
22
-
});
7
7
+
PanelButton({
8
8
+
class_name: "applauncher",
9
9
+
connections: [
10
10
+
[
11
11
+
App,
12
12
+
(btn, win, visible) => {
13
13
+
btn.toggleClassName("active", win === "applauncher" && visible);
14
14
+
},
15
15
+
],
16
16
+
],
17
17
+
on_clicked: () => App.toggleWindow("applauncher"),
18
18
+
content: FontIcon(distroIcon),
19
19
+
});
+54
-57
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/BatteryBar.js
···
6
6
import PanelButton from "../PanelButton.js";
7
7
8
8
const Indicator = () =>
9
9
-
Widget.Stack({
10
10
-
items: [
11
11
-
["false", Widget.Icon({ binds: [["icon", Battery, "icon-name"]] })],
12
12
-
["true", FontIcon(icons.battery.charging)],
13
13
-
],
14
14
-
connections: [
15
15
-
[
16
16
-
Battery,
17
17
-
(stack) => {
18
18
-
stack.shown = `${Battery.charging || Battery.charged}`;
19
19
-
},
20
20
-
],
21
21
-
],
22
22
-
});
9
9
+
Widget.Stack({
10
10
+
items: [
11
11
+
["false", Widget.Icon({ binds: [["icon", Battery, "icon-name"]] })],
12
12
+
["true", FontIcon(icons.battery.charging)],
13
13
+
],
14
14
+
connections: [
15
15
+
[
16
16
+
Battery,
17
17
+
(stack) => {
18
18
+
stack.shown = `${Battery.charging || Battery.charged}`;
19
19
+
},
20
20
+
],
21
21
+
],
22
22
+
});
23
23
24
24
const PercentLabel = () =>
25
25
-
Widget.Revealer({
26
26
-
transition: "slide_right",
27
27
-
binds: [["reveal-child", options.battery.show_percentage]],
28
28
-
child: Widget.Label({
29
29
-
binds: [["label", Battery, "percent", (p) => `${p}%`]],
30
30
-
}),
31
31
-
});
25
25
+
Widget.Revealer({
26
26
+
transition: "slide_right",
27
27
+
binds: [["reveal-child", options.battery.show_percentage]],
28
28
+
child: Widget.Label({
29
29
+
binds: [["label", Battery, "percent", (p) => `${p}%`]],
30
30
+
}),
31
31
+
});
32
32
33
33
const LevelBar = () =>
34
34
-
Widget.LevelBar({
35
35
-
vpack: "center",
36
36
-
binds: [["value", Battery, "percent", (p) => p / 100]],
37
37
-
});
34
34
+
Widget.LevelBar({
35
35
+
vpack: "center",
36
36
+
binds: [["value", Battery, "percent", (p) => p / 100]],
37
37
+
});
38
38
39
39
export default () => {
40
40
-
const revaler = PercentLabel();
40
40
+
const revaler = PercentLabel();
41
41
42
42
-
return PanelButton({
43
43
-
class_name: "battery-bar",
44
44
-
on_clicked: () => {
45
45
-
const v = options.battery.show_percentage.value;
46
46
-
options.battery.show_percentage.value = !v;
47
47
-
},
48
48
-
content: Widget.Box({
49
49
-
binds: [["visible", Battery, "available"]],
50
50
-
connections: [
51
51
-
[
52
52
-
Battery,
53
53
-
(w) => {
54
54
-
w.toggleClassName(
55
55
-
"charging",
56
56
-
Battery.charging || Battery.charged,
57
57
-
);
58
58
-
w.toggleClassName(
59
59
-
"medium",
60
60
-
Battery.percent < options.battery.medium.value,
61
61
-
);
62
62
-
w.toggleClassName(
63
63
-
"low",
64
64
-
Battery.percent < options.battery.low.value,
65
65
-
);
66
66
-
w.toggleClassName("half", Battery.percent < 48);
67
67
-
},
68
68
-
],
69
69
-
],
70
70
-
children: [Indicator(), Widget.Box({ child: revaler }), LevelBar()],
71
71
-
}),
72
72
-
});
42
42
+
return PanelButton({
43
43
+
class_name: "battery-bar",
44
44
+
on_clicked: () => {
45
45
+
const v = options.battery.show_percentage.value;
46
46
+
options.battery.show_percentage.value = !v;
47
47
+
},
48
48
+
content: Widget.Box({
49
49
+
binds: [["visible", Battery, "available"]],
50
50
+
connections: [
51
51
+
[
52
52
+
Battery,
53
53
+
(w) => {
54
54
+
w.toggleClassName("charging", Battery.charging || Battery.charged);
55
55
+
w.toggleClassName(
56
56
+
"medium",
57
57
+
Battery.percent < options.battery.medium.value,
58
58
+
);
59
59
+
w.toggleClassName(
60
60
+
"low",
61
61
+
Battery.percent < options.battery.low.value,
62
62
+
);
63
63
+
w.toggleClassName("half", Battery.percent < 48);
64
64
+
},
65
65
+
],
66
66
+
],
67
67
+
children: [Indicator(), Widget.Box({ child: revaler }), LevelBar()],
68
68
+
}),
69
69
+
});
73
70
};
+19
-21
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/ColorPicker.js
···
4
4
import Gdk from "gi://Gdk";
5
5
6
6
export default () =>
7
7
-
PanelButton({
8
8
-
class_name: "color-picker",
9
9
-
content: Widget.Icon("color-select-symbolic"),
10
10
-
binds: [
11
11
-
["tooltip-text", Colors, "colors", (v) => `${v.length} colors`],
12
12
-
],
13
13
-
on_clicked: () => Colors.pick(),
7
7
+
PanelButton({
8
8
+
class_name: "color-picker",
9
9
+
content: Widget.Icon("color-select-symbolic"),
10
10
+
binds: [["tooltip-text", Colors, "colors", (v) => `${v.length} colors`]],
11
11
+
on_clicked: () => Colors.pick(),
14
12
15
15
-
on_secondary_click: (btn) => {
16
16
-
if (Colors.colors.length === 0) return;
13
13
+
on_secondary_click: (btn) => {
14
14
+
if (Colors.colors.length === 0) return;
17
15
18
18
-
Widget.Menu({
19
19
-
class_name: "colorpicker",
20
20
-
children: Colors.colors.map((color) =>
21
21
-
Widget.MenuItem({
22
22
-
child: Widget.Label(color),
23
23
-
css: `background-color: ${color}`,
24
24
-
on_activate: () => Colors.wlCopy(color),
25
25
-
}),
26
26
-
),
27
27
-
}).popup_at_widget(btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null);
28
28
-
},
29
29
-
});
16
16
+
Widget.Menu({
17
17
+
class_name: "colorpicker",
18
18
+
children: Colors.colors.map((color) =>
19
19
+
Widget.MenuItem({
20
20
+
child: Widget.Label(color),
21
21
+
css: `background-color: ${color}`,
22
22
+
on_activate: () => Colors.wlCopy(color),
23
23
+
}),
24
24
+
),
25
25
+
}).popup_at_widget(btn, Gdk.Gravity.SOUTH, Gdk.Gravity.NORTH, null);
26
26
+
},
27
27
+
});
+6
-6
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/DateButton.js
···
3
3
import PanelButton from "../PanelButton.js";
4
4
5
5
export default ({ format = "%I:%M:%S | %d/%m/%y" } = {}) =>
6
6
-
PanelButton({
7
7
-
class_name: "dashboard panel-button",
8
8
-
on_clicked: () => App.toggleWindow("dashboard"),
9
9
-
window: "dashboard",
10
10
-
content: Clock({ format }),
11
11
-
});
6
6
+
PanelButton({
7
7
+
class_name: "dashboard panel-button",
8
8
+
on_clicked: () => App.toggleWindow("dashboard"),
9
9
+
window: "dashboard",
10
10
+
content: Clock({ format }),
11
11
+
});
+56
-56
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/MediaIndicator.js
···
6
6
import options from "../../../options.js";
7
7
8
8
export const getPlayer = (name = options.mpris.preferred.value) =>
9
9
-
Mpris.getPlayer(name) || Mpris.players[0] || null;
9
9
+
Mpris.getPlayer(name) || Mpris.players[0] || null;
10
10
11
11
/**
12
12
* @param {Object} o
···
14
14
* @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction
15
15
*/
16
16
const Indicator = ({ player, direction = "right" }) =>
17
17
-
HoverRevealer({
18
18
-
class_name: `media panel-button ${player.name}`,
19
19
-
direction,
20
20
-
on_primary_click: () => player.playPause(),
21
21
-
on_scroll_up: () => player.next(),
22
22
-
on_scroll_down: () => player.previous(),
23
23
-
on_secondary_click: () => player.playPause(),
24
24
-
indicator: mpris.PlayerIcon(player),
25
25
-
child: Widget.Label({
26
26
-
vexpand: true,
27
27
-
truncate: "end",
28
28
-
max_width_chars: 40,
29
29
-
connections: [
30
30
-
[
31
31
-
player,
32
32
-
(label) => {
33
33
-
label.label = `${player.track_artists.join(", ")} - ${
34
34
-
player.track_title
35
35
-
}`;
36
36
-
},
37
37
-
],
38
38
-
],
39
39
-
}),
40
40
-
connections: [
41
41
-
[
42
42
-
player,
43
43
-
(revealer) => {
44
44
-
if (revealer._current === player.track_title) return;
45
45
-
46
46
-
revealer._current = player.track_title;
47
47
-
revealer.reveal_child = true;
48
48
-
Utils.timeout(3000, () => {
49
49
-
revealer.reveal_child = false;
50
50
-
});
51
51
-
},
52
52
-
],
17
17
+
HoverRevealer({
18
18
+
class_name: `media panel-button ${player.name}`,
19
19
+
direction,
20
20
+
on_primary_click: () => player.playPause(),
21
21
+
on_scroll_up: () => player.next(),
22
22
+
on_scroll_down: () => player.previous(),
23
23
+
on_secondary_click: () => player.playPause(),
24
24
+
indicator: mpris.PlayerIcon(player),
25
25
+
child: Widget.Label({
26
26
+
vexpand: true,
27
27
+
truncate: "end",
28
28
+
max_width_chars: 40,
29
29
+
connections: [
30
30
+
[
31
31
+
player,
32
32
+
(label) => {
33
33
+
label.label = `${player.track_artists.join(", ")} - ${
34
34
+
player.track_title
35
35
+
}`;
36
36
+
},
53
37
],
54
54
-
});
38
38
+
],
39
39
+
}),
40
40
+
connections: [
41
41
+
[
42
42
+
player,
43
43
+
(revealer) => {
44
44
+
if (revealer._current === player.track_title) return;
45
45
+
46
46
+
revealer._current = player.track_title;
47
47
+
revealer.reveal_child = true;
48
48
+
Utils.timeout(3000, () => {
49
49
+
revealer.reveal_child = false;
50
50
+
});
51
51
+
},
52
52
+
],
53
53
+
],
54
54
+
});
55
55
56
56
/**
57
57
* @param {Object} o
58
58
* @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction
59
59
*/
60
60
export default ({ direction = "right" } = {}) => {
61
61
-
let current = null;
61
61
+
let current = null;
62
62
63
63
-
const update = (box) => {
64
64
-
const player = getPlayer();
65
65
-
box.visible = !!player;
63
63
+
const update = (box) => {
64
64
+
const player = getPlayer();
65
65
+
box.visible = !!player;
66
66
67
67
-
if (!player) {
68
68
-
current = null;
69
69
-
return;
70
70
-
}
67
67
+
if (!player) {
68
68
+
current = null;
69
69
+
return;
70
70
+
}
71
71
72
72
-
if (current === player) return;
72
72
+
if (current === player) return;
73
73
74
74
-
current = player;
75
75
-
box.children = [Indicator({ player, direction })];
76
76
-
};
74
74
+
current = player;
75
75
+
box.children = [Indicator({ player, direction })];
76
76
+
};
77
77
78
78
-
return Widget.Box({
79
79
-
connections: [
80
80
-
[options.mpris.preferred, update],
81
81
-
[Mpris, update, "notify::players"],
82
82
-
],
83
83
-
});
78
78
+
return Widget.Box({
79
79
+
connections: [
80
80
+
[options.mpris.preferred, update],
81
81
+
[Mpris, update, "notify::players"],
82
82
+
],
83
83
+
});
84
84
};
+44
-52
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/NotificationIndicator.js
···
10
10
* @param {import('../../misc/HoverRevealer').HoverRevealProps['direction']=} o.direction
11
11
*/
12
12
export default ({ direction = "left" } = {}) =>
13
13
-
HoverRevealer({
14
14
-
class_name: "notifications panel-button",
15
15
-
eventboxConnections: [
16
16
-
["button-press-event", () => App.openWindow("dashboard")],
17
17
-
[
18
18
-
Notifications,
19
19
-
(box) =>
20
20
-
(box.visible =
21
21
-
Notifications.notifications.length > 0 ||
22
22
-
Notifications.dnd),
23
23
-
],
24
24
-
],
25
25
-
connections: [
26
26
-
[
27
27
-
Notifications,
28
28
-
(revealer) => {
29
29
-
const title = Notifications.notifications[0]?.summary;
30
30
-
if (revealer._title === title) return;
13
13
+
HoverRevealer({
14
14
+
class_name: "notifications panel-button",
15
15
+
eventboxConnections: [
16
16
+
["button-press-event", () => App.openWindow("dashboard")],
17
17
+
[
18
18
+
Notifications,
19
19
+
(box) =>
20
20
+
(box.visible =
21
21
+
Notifications.notifications.length > 0 || Notifications.dnd),
22
22
+
],
23
23
+
],
24
24
+
connections: [
25
25
+
[
26
26
+
Notifications,
27
27
+
(revealer) => {
28
28
+
const title = Notifications.notifications[0]?.summary;
29
29
+
if (revealer._title === title) return;
31
30
32
32
-
revealer._title = title;
33
33
-
revealer.reveal_child = true;
34
34
-
Utils.timeout(3000, () => {
35
35
-
revealer.reveal_child = false;
36
36
-
});
37
37
-
},
38
38
-
],
31
31
+
revealer._title = title;
32
32
+
revealer.reveal_child = true;
33
33
+
Utils.timeout(3000, () => {
34
34
+
revealer.reveal_child = false;
35
35
+
});
36
36
+
},
37
37
+
],
38
38
+
],
39
39
+
direction,
40
40
+
indicator: Widget.Icon({
41
41
+
binds: [
42
42
+
[
43
43
+
"icon",
44
44
+
Notifications,
45
45
+
"dnd",
46
46
+
(dnd) =>
47
47
+
dnd ? icons.notifications.silent : icons.notifications.noisy,
39
48
],
40
40
-
direction,
41
41
-
indicator: Widget.Icon({
42
42
-
binds: [
43
43
-
[
44
44
-
"icon",
45
45
-
Notifications,
46
46
-
"dnd",
47
47
-
(dnd) =>
48
48
-
dnd
49
49
-
? icons.notifications.silent
50
50
-
: icons.notifications.noisy,
51
51
-
],
52
52
-
],
53
53
-
}),
54
54
-
child: Widget.Label({
55
55
-
truncate: "end",
56
56
-
max_width_chars: 40,
57
57
-
binds: [
58
58
-
[
59
59
-
"label",
60
60
-
Notifications,
61
61
-
"notifications",
62
62
-
(n) => n[0]?.summary || "",
63
63
-
],
64
64
-
],
65
65
-
}),
66
66
-
});
49
49
+
],
50
50
+
}),
51
51
+
child: Widget.Label({
52
52
+
truncate: "end",
53
53
+
max_width_chars: 40,
54
54
+
binds: [
55
55
+
["label", Notifications, "notifications", (n) => n[0]?.summary || ""],
56
56
+
],
57
57
+
}),
58
58
+
});
+5
-5
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/PowerMenu.js
···
4
4
import PanelButton from "../PanelButton.js";
5
5
6
6
export default () =>
7
7
-
PanelButton({
8
8
-
class_name: "powermenu",
9
9
-
content: Widget.Icon(icons.powermenu.shutdown),
10
10
-
on_clicked: () => App.openWindow("powermenu"),
11
11
-
});
7
7
+
PanelButton({
8
8
+
class_name: "powermenu",
9
9
+
content: Widget.Icon(icons.powermenu.shutdown),
10
10
+
on_clicked: () => App.openWindow("powermenu"),
11
11
+
});
+45
-45
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/SubMenu.js
···
10
10
* @param {import('types/variable').Variable} items
11
11
*/
12
12
const Arrow = (revealer, direction, items) => {
13
13
-
let deg = 0;
13
13
+
let deg = 0;
14
14
15
15
-
const icon = Widget.Icon({
16
16
-
icon: icons.ui.arrow[direction],
17
17
-
});
15
15
+
const icon = Widget.Icon({
16
16
+
icon: icons.ui.arrow[direction],
17
17
+
});
18
18
19
19
-
const animate = () => {
20
20
-
const t = options.transition.value / 20;
21
21
-
const step = revealer.reveal_child ? 10 : -10;
22
22
-
for (let i = 0; i < 18; ++i) {
23
23
-
Utils.timeout(t * i, () => {
24
24
-
deg += step;
25
25
-
icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`);
26
26
-
});
27
27
-
}
28
28
-
};
19
19
+
const animate = () => {
20
20
+
const t = options.transition.value / 20;
21
21
+
const step = revealer.reveal_child ? 10 : -10;
22
22
+
for (let i = 0; i < 18; ++i) {
23
23
+
Utils.timeout(t * i, () => {
24
24
+
deg += step;
25
25
+
icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`);
26
26
+
});
27
27
+
}
28
28
+
};
29
29
30
30
-
return Widget.Button({
31
31
-
class_name: "panel-button sub-menu",
32
32
-
connections: [
33
33
-
[
34
34
-
items,
35
35
-
(btn) => {
36
36
-
btn.tooltip_text = `${items.value} Items`;
37
37
-
},
38
38
-
],
39
39
-
],
40
40
-
on_clicked: () => {
41
41
-
animate();
42
42
-
revealer.reveal_child = !revealer.reveal_child;
30
30
+
return Widget.Button({
31
31
+
class_name: "panel-button sub-menu",
32
32
+
connections: [
33
33
+
[
34
34
+
items,
35
35
+
(btn) => {
36
36
+
btn.tooltip_text = `${items.value} Items`;
43
37
},
44
44
-
child: icon,
45
45
-
});
38
38
+
],
39
39
+
],
40
40
+
on_clicked: () => {
41
41
+
animate();
42
42
+
revealer.reveal_child = !revealer.reveal_child;
43
43
+
},
44
44
+
child: icon,
45
45
+
});
46
46
};
47
47
48
48
/**
···
52
52
* @param {import('types/variable').Variable} o.items
53
53
*/
54
54
export default ({ children, direction = "left", items = Variable(0) }) => {
55
55
-
const posStart = direction === "up" || direction === "left";
56
56
-
const posEnd = direction === "down" || direction === "right";
57
57
-
const revealer = Widget.Revealer({
58
58
-
transition: `slide_${direction}`,
59
59
-
child: Widget.Box({
60
60
-
children,
61
61
-
}),
62
62
-
});
55
55
+
const posStart = direction === "up" || direction === "left";
56
56
+
const posEnd = direction === "down" || direction === "right";
57
57
+
const revealer = Widget.Revealer({
58
58
+
transition: `slide_${direction}`,
59
59
+
child: Widget.Box({
60
60
+
children,
61
61
+
}),
62
62
+
});
63
63
64
64
-
return Widget.Box({
65
65
-
vertical: direction === "up" || direction === "down",
66
66
-
children: [
67
67
-
posStart && revealer,
68
68
-
Arrow(revealer, direction, items),
69
69
-
posEnd && revealer,
70
70
-
],
71
71
-
});
64
64
+
return Widget.Box({
65
65
+
vertical: direction === "up" || direction === "down",
66
66
+
children: [
67
67
+
posStart && revealer,
68
68
+
Arrow(revealer, direction, items),
69
69
+
posEnd && revealer,
70
70
+
],
71
71
+
});
72
72
};
+33
-33
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/SysTray.js
···
5
5
6
6
/** @param {import('types/service/systemtray').TrayItem} item */
7
7
const SysTrayItem = (item) =>
8
8
-
PanelButton({
9
9
-
class_name: "tray-item",
10
10
-
content: Widget.Icon({ binds: [["icon", item, "icon"]] }),
11
11
-
binds: [["tooltipMarkup", item, "tooltip-markup"]],
12
12
-
setup: (btn) => {
13
13
-
const id = item.menu?.connect("popped-up", (menu) => {
14
14
-
btn.toggleClassName("active");
15
15
-
menu.connect("notify::visible", (menu) => {
16
16
-
btn.toggleClassName("active", menu.visible);
17
17
-
});
18
18
-
menu.disconnect(id);
19
19
-
});
20
20
-
},
21
21
-
// @ts-expect-error popup_at_widget missing from types?
22
22
-
on_primary_click: (btn) =>
23
23
-
item.menu?.popup_at_widget(
24
24
-
btn,
25
25
-
Gdk.Gravity.SOUTH,
26
26
-
Gdk.Gravity.NORTH,
27
27
-
null,
28
28
-
),
8
8
+
PanelButton({
9
9
+
class_name: "tray-item",
10
10
+
content: Widget.Icon({ binds: [["icon", item, "icon"]] }),
11
11
+
binds: [["tooltipMarkup", item, "tooltip-markup"]],
12
12
+
setup: (btn) => {
13
13
+
const id = item.menu?.connect("popped-up", (menu) => {
14
14
+
btn.toggleClassName("active");
15
15
+
menu.connect("notify::visible", (menu) => {
16
16
+
btn.toggleClassName("active", menu.visible);
17
17
+
});
18
18
+
menu.disconnect(id);
19
19
+
});
20
20
+
},
21
21
+
// @ts-expect-error popup_at_widget missing from types?
22
22
+
on_primary_click: (btn) =>
23
23
+
item.menu?.popup_at_widget(
24
24
+
btn,
25
25
+
Gdk.Gravity.SOUTH,
26
26
+
Gdk.Gravity.NORTH,
27
27
+
null,
28
28
+
),
29
29
30
30
-
// @ts-expect-error popup_at_widget missing from types?
31
31
-
on_secondary_click: (btn) =>
32
32
-
item.menu?.popup_at_widget(
33
33
-
btn,
34
34
-
Gdk.Gravity.SOUTH,
35
35
-
Gdk.Gravity.NORTH,
36
36
-
null,
37
37
-
),
38
38
-
});
30
30
+
// @ts-expect-error popup_at_widget missing from types?
31
31
+
on_secondary_click: (btn) =>
32
32
+
item.menu?.popup_at_widget(
33
33
+
btn,
34
34
+
Gdk.Gravity.SOUTH,
35
35
+
Gdk.Gravity.NORTH,
36
36
+
null,
37
37
+
),
38
38
+
});
39
39
40
40
export default () =>
41
41
-
Widget.Box({
42
42
-
binds: [["children", SystemTray, "items", (i) => i.map(SysTrayItem)]],
43
43
-
});
41
41
+
Widget.Box({
42
42
+
binds: [["children", SystemTray, "items", (i) => i.map(SysTrayItem)]],
43
43
+
});
+114
-122
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/SystemIndicators.js
···
10
10
import icons from "../../../icons.js";
11
11
12
12
const MicrophoneIndicator = () =>
13
13
-
Widget.Icon({
14
14
-
connections: [
15
15
-
[
16
16
-
Audio,
17
17
-
(icon) => {
18
18
-
if (!Audio.microphone) return;
13
13
+
Widget.Icon({
14
14
+
connections: [
15
15
+
[
16
16
+
Audio,
17
17
+
(icon) => {
18
18
+
if (!Audio.microphone) return;
19
19
20
20
-
const { muted, low, medium, high } = icons.audio.mic;
21
21
-
if (Audio.microphone.is_muted) return (icon.icon = muted);
20
20
+
const { muted, low, medium, high } = icons.audio.mic;
21
21
+
if (Audio.microphone.is_muted) return (icon.icon = muted);
22
22
23
23
-
/** @type {Array<[number, string]>} */
24
24
-
const cons = [
25
25
-
[67, high],
26
26
-
[34, medium],
27
27
-
[1, low],
28
28
-
[0, muted],
29
29
-
];
30
30
-
icon.icon =
31
31
-
cons.find(
32
32
-
([n]) => n <= Audio.microphone.volume * 100,
33
33
-
)?.[1] || "";
23
23
+
/** @type {Array<[number, string]>} */
24
24
+
const cons = [
25
25
+
[67, high],
26
26
+
[34, medium],
27
27
+
[1, low],
28
28
+
[0, muted],
29
29
+
];
30
30
+
icon.icon =
31
31
+
cons.find(([n]) => n <= Audio.microphone.volume * 100)?.[1] || "";
34
32
35
35
-
icon.visible =
36
36
-
Audio.recorders.length > 0 || Audio.microphone.is_muted;
37
37
-
},
38
38
-
],
39
39
-
],
40
40
-
});
33
33
+
icon.visible =
34
34
+
Audio.recorders.length > 0 || Audio.microphone.is_muted;
35
35
+
},
36
36
+
],
37
37
+
],
38
38
+
});
41
39
42
40
const DNDIndicator = () =>
43
43
-
Widget.Icon({
44
44
-
icon: icons.notifications.silent,
45
45
-
binds: [["visible", Notifications, "dnd"]],
46
46
-
});
41
41
+
Widget.Icon({
42
42
+
icon: icons.notifications.silent,
43
43
+
binds: [["visible", Notifications, "dnd"]],
44
44
+
});
47
45
48
46
const BluetoothDevicesIndicator = () =>
49
49
-
Widget.Box({
50
50
-
connections: [
51
51
-
[
52
52
-
Bluetooth,
53
53
-
(box) => {
54
54
-
box.children = Bluetooth.connectedDevices.map(
55
55
-
({ iconName, name }) =>
56
56
-
HoverRevealer({
57
57
-
indicator: Widget.Icon(iconName + "-symbolic"),
58
58
-
child: Widget.Label(name),
59
59
-
}),
60
60
-
);
47
47
+
Widget.Box({
48
48
+
connections: [
49
49
+
[
50
50
+
Bluetooth,
51
51
+
(box) => {
52
52
+
box.children = Bluetooth.connectedDevices.map(({ iconName, name }) =>
53
53
+
HoverRevealer({
54
54
+
indicator: Widget.Icon(iconName + "-symbolic"),
55
55
+
child: Widget.Label(name),
56
56
+
}),
57
57
+
);
61
58
62
62
-
box.visible = Bluetooth.connectedDevices.length > 0;
63
63
-
},
64
64
-
"notify::connected-devices",
65
65
-
],
66
66
-
],
67
67
-
});
59
59
+
box.visible = Bluetooth.connectedDevices.length > 0;
60
60
+
},
61
61
+
"notify::connected-devices",
62
62
+
],
63
63
+
],
64
64
+
});
68
65
69
66
const BluetoothIndicator = () =>
70
70
-
Widget.Icon({
71
71
-
class_name: "bluetooth",
72
72
-
icon: icons.bluetooth.enabled,
73
73
-
binds: [["visible", Bluetooth, "enabled"]],
74
74
-
});
67
67
+
Widget.Icon({
68
68
+
class_name: "bluetooth",
69
69
+
icon: icons.bluetooth.enabled,
70
70
+
binds: [["visible", Bluetooth, "enabled"]],
71
71
+
});
75
72
76
73
const NetworkIndicator = () =>
77
77
-
Widget.Icon({
78
78
-
connections: [
79
79
-
[
80
80
-
Network,
81
81
-
(self) => {
82
82
-
const icon = Network[Network.primary || "wifi"]?.iconName;
83
83
-
self.icon = icon || "";
84
84
-
self.visible = icon;
85
85
-
},
86
86
-
],
87
87
-
],
88
88
-
});
74
74
+
Widget.Icon({
75
75
+
connections: [
76
76
+
[
77
77
+
Network,
78
78
+
(self) => {
79
79
+
const icon = Network[Network.primary || "wifi"]?.iconName;
80
80
+
self.icon = icon || "";
81
81
+
self.visible = icon;
82
82
+
},
83
83
+
],
84
84
+
],
85
85
+
});
89
86
90
87
const AudioIndicator = () =>
91
91
-
Widget.Icon({
92
92
-
connections: [
93
93
-
[
94
94
-
Audio,
95
95
-
(icon) => {
96
96
-
if (!Audio.speaker) return;
88
88
+
Widget.Icon({
89
89
+
connections: [
90
90
+
[
91
91
+
Audio,
92
92
+
(icon) => {
93
93
+
if (!Audio.speaker) return;
97
94
98
98
-
const { muted, low, medium, high, overamplified } =
99
99
-
icons.audio.volume;
100
100
-
if (Audio.speaker.is_muted) return (icon.icon = muted);
95
95
+
const { muted, low, medium, high, overamplified } =
96
96
+
icons.audio.volume;
97
97
+
if (Audio.speaker.is_muted) return (icon.icon = muted);
101
98
102
102
-
/** @type {Array<[number, string]>} */
103
103
-
const cons = [
104
104
-
[101, overamplified],
105
105
-
[67, high],
106
106
-
[34, medium],
107
107
-
[1, low],
108
108
-
[0, muted],
109
109
-
];
110
110
-
icon.icon =
111
111
-
cons.find(
112
112
-
([n]) => n <= Audio.speaker.volume * 100,
113
113
-
)?.[1] || "";
114
114
-
},
115
115
-
"speaker-changed",
116
116
-
],
117
117
-
],
118
118
-
});
99
99
+
/** @type {Array<[number, string]>} */
100
100
+
const cons = [
101
101
+
[101, overamplified],
102
102
+
[67, high],
103
103
+
[34, medium],
104
104
+
[1, low],
105
105
+
[0, muted],
106
106
+
];
107
107
+
icon.icon =
108
108
+
cons.find(([n]) => n <= Audio.speaker.volume * 100)?.[1] || "";
109
109
+
},
110
110
+
"speaker-changed",
111
111
+
],
112
112
+
],
113
113
+
});
119
114
120
115
export default () =>
121
121
-
PanelButton({
122
122
-
class_name: "quicksettings panel-button",
123
123
-
on_clicked: () => App.toggleWindow("quicksettings"),
124
124
-
on_scroll_up: () => {
125
125
-
Audio.speaker.volume += 0.02;
126
126
-
Indicator.speaker();
116
116
+
PanelButton({
117
117
+
class_name: "quicksettings panel-button",
118
118
+
on_clicked: () => App.toggleWindow("quicksettings"),
119
119
+
on_scroll_up: () => {
120
120
+
Audio.speaker.volume += 0.02;
121
121
+
Indicator.speaker();
122
122
+
},
123
123
+
on_scroll_down: () => {
124
124
+
Audio.speaker.volume -= 0.02;
125
125
+
Indicator.speaker();
126
126
+
},
127
127
+
connections: [
128
128
+
[
129
129
+
App,
130
130
+
(btn, win, visible) => {
131
131
+
btn.toggleClassName("active", win === "quicksettings" && visible);
127
132
},
128
128
-
on_scroll_down: () => {
129
129
-
Audio.speaker.volume -= 0.02;
130
130
-
Indicator.speaker();
131
131
-
},
132
132
-
connections: [
133
133
-
[
134
134
-
App,
135
135
-
(btn, win, visible) => {
136
136
-
btn.toggleClassName(
137
137
-
"active",
138
138
-
win === "quicksettings" && visible,
139
139
-
);
140
140
-
},
141
141
-
],
142
142
-
],
143
143
-
child: Widget.Box({
144
144
-
children: [
145
145
-
DNDIndicator(),
146
146
-
BluetoothDevicesIndicator(),
147
147
-
BluetoothIndicator(),
148
148
-
NetworkIndicator(),
149
149
-
AudioIndicator(),
150
150
-
MicrophoneIndicator(),
151
151
-
],
152
152
-
}),
153
153
-
});
133
133
+
],
134
134
+
],
135
135
+
child: Widget.Box({
136
136
+
children: [
137
137
+
DNDIndicator(),
138
138
+
BluetoothDevicesIndicator(),
139
139
+
BluetoothIndicator(),
140
140
+
NetworkIndicator(),
141
141
+
AudioIndicator(),
142
142
+
MicrophoneIndicator(),
143
143
+
],
144
144
+
}),
145
145
+
});
+52
-55
home/isabel/programs/configs/gui/bars/ags/config/windows/bar/buttons/Workspaces.js
···
6
6
7
7
/** @param {any} arg */
8
8
const dispatch = (arg) => () =>
9
9
-
Utils.execAsync(`hyprctl dispatch workspace ${arg}`);
9
9
+
Utils.execAsync(`hyprctl dispatch workspace ${arg}`);
10
10
11
11
const Workspaces = () => {
12
12
-
const ws = options.workspaces.value;
13
13
-
return Widget.Box({
14
14
-
children: range(ws || 20).map((i) =>
15
15
-
Widget.Button({
16
16
-
setup: (btn) => (btn.id = i),
17
17
-
on_clicked: () => dispatch(i),
18
18
-
child: Widget.Label({
19
19
-
label: `${i}`,
20
20
-
class_name: "indicator",
21
21
-
vpack: "center",
22
22
-
}),
23
23
-
connections: [
24
24
-
[
25
25
-
Hyprland,
26
26
-
(btn) => {
27
27
-
btn.toggleClassName(
28
28
-
"active",
29
29
-
Hyprland.active.workspace.id === i,
30
30
-
);
31
31
-
btn.toggleClassName(
32
32
-
"occupied",
33
33
-
Hyprland.getWorkspace(i)?.windows > 0,
34
34
-
);
35
35
-
},
36
36
-
],
37
37
-
],
38
38
-
}),
39
39
-
),
40
40
-
connections: ws
41
41
-
? []
42
42
-
: [
43
43
-
[
44
44
-
Hyprland.active.workspace,
45
45
-
(box) =>
46
46
-
box.children.map((btn) => {
47
47
-
btn.visible = Hyprland.workspaces.some(
48
48
-
(ws) => ws.id === btn.id,
49
49
-
);
50
50
-
}),
51
51
-
],
52
52
-
],
53
53
-
});
12
12
+
const ws = options.workspaces.value;
13
13
+
return Widget.Box({
14
14
+
children: range(ws || 20).map((i) =>
15
15
+
Widget.Button({
16
16
+
setup: (btn) => (btn.id = i),
17
17
+
on_clicked: () => dispatch(i),
18
18
+
child: Widget.Label({
19
19
+
label: `${i}`,
20
20
+
class_name: "indicator",
21
21
+
vpack: "center",
22
22
+
}),
23
23
+
connections: [
24
24
+
[
25
25
+
Hyprland,
26
26
+
(btn) => {
27
27
+
btn.toggleClassName("active", Hyprland.active.workspace.id === i);
28
28
+
btn.toggleClassName(
29
29
+
"occupied",
30
30
+
Hyprland.getWorkspace(i)?.windows > 0,
31
31
+
);
32
32
+
},
33
33
+
],
34
34
+
],
35
35
+
}),
36
36
+
),
37
37
+
connections: ws
38
38
+
? []
39
39
+
: [
40
40
+
[
41
41
+
Hyprland.active.workspace,
42
42
+
(box) =>
43
43
+
box.children.map((btn) => {
44
44
+
btn.visible = Hyprland.workspaces.some(
45
45
+
(ws) => ws.id === btn.id,
46
46
+
);
47
47
+
}),
48
48
+
],
49
49
+
],
50
50
+
});
54
51
};
55
52
56
53
export default () =>
57
57
-
Widget.EventBox({
58
58
-
class_name: "workspaces panel-button",
59
59
-
child: Widget.Box({
60
60
-
// its nested like this to keep it consistent with other PanelButton widgets
61
61
-
child: Widget.EventBox({
62
62
-
on_scroll_up: () => dispatch("m+1"),
63
63
-
on_scroll_down: () => dispatch("m-1"),
64
64
-
class_name: "eventbox",
65
65
-
binds: [["child", options.workspaces, "value", Workspaces]],
66
66
-
}),
67
67
-
}),
68
68
-
});
54
54
+
Widget.EventBox({
55
55
+
class_name: "workspaces panel-button",
56
56
+
child: Widget.Box({
57
57
+
// its nested like this to keep it consistent with other PanelButton widgets
58
58
+
child: Widget.EventBox({
59
59
+
on_scroll_up: () => dispatch("m+1"),
60
60
+
on_scroll_down: () => dispatch("m-1"),
61
61
+
class_name: "eventbox",
62
62
+
binds: [["child", options.workspaces, "value", Workspaces]],
63
63
+
}),
64
64
+
}),
65
65
+
});
+22
-22
home/isabel/programs/configs/gui/bars/ags/config/windows/dashboard/Dashboard.js
···
10
10
* @param {import('../../misc/PopupWindow.js').PopopWindowProps['layout']=} o.layout
11
11
*/
12
12
export default () =>
13
13
-
PopupWindow({
14
14
-
name: "dashboard",
15
15
-
connections: [
16
16
-
[
17
17
-
options.bar.position,
18
18
-
(self) => {
19
19
-
self.anchor = [options.bar.position.value];
20
20
-
if (options.bar.position.value === "top")
21
21
-
self.transition = "slide_down";
13
13
+
PopupWindow({
14
14
+
name: "dashboard",
15
15
+
connections: [
16
16
+
[
17
17
+
options.bar.position,
18
18
+
(self) => {
19
19
+
self.anchor = [options.bar.position.value];
20
20
+
if (options.bar.position.value === "top")
21
21
+
self.transition = "slide_down";
22
22
23
23
-
if (options.bar.position.value === "bottom")
24
24
-
self.transition = "slide_up";
25
25
-
},
26
26
-
],
27
27
-
],
28
28
-
child: Widget.Box({
29
29
-
children: [
30
30
-
NotificationColumn(),
31
31
-
Widget.Separator({ orientation: 1 }),
32
32
-
DateColumn(),
33
33
-
],
34
34
-
}),
35
35
-
});
23
23
+
if (options.bar.position.value === "bottom")
24
24
+
self.transition = "slide_up";
25
25
+
},
26
26
+
],
27
27
+
],
28
28
+
child: Widget.Box({
29
29
+
children: [
30
30
+
NotificationColumn(),
31
31
+
Widget.Separator({ orientation: 1 }),
32
32
+
DateColumn(),
33
33
+
],
34
34
+
}),
35
35
+
});
+51
-58
home/isabel/programs/configs/gui/bars/ags/config/windows/dashboard/DateColumn.js
···
10
10
* @param {string} unit
11
11
*/
12
12
const SysProgress = (type, title, unit) =>
13
13
-
Widget.Box({
14
14
-
class_name: `circular-progress-box ${type}`,
15
15
-
hexpand: true,
16
16
-
binds: [
17
17
-
[
18
18
-
"tooltipText",
19
19
-
vars[type],
20
20
-
"value",
21
21
-
(v) => `${title}: ${Math.floor(v * 100)}${unit}`,
22
22
-
],
23
23
-
],
24
24
-
child: Widget.CircularProgress({
25
25
-
hexpand: true,
26
26
-
class_name: `circular-progress ${type}`,
27
27
-
child: Widget.Icon(icons.system[type]),
28
28
-
start_at: 0.75,
29
29
-
binds: [
30
30
-
["value", vars[type]],
31
31
-
["rounded", options.radii, "value", (v) => v > 0],
32
32
-
],
33
33
-
}),
34
34
-
});
13
13
+
Widget.Box({
14
14
+
class_name: `circular-progress-box ${type}`,
15
15
+
hexpand: true,
16
16
+
binds: [
17
17
+
[
18
18
+
"tooltipText",
19
19
+
vars[type],
20
20
+
"value",
21
21
+
(v) => `${title}: ${Math.floor(v * 100)}${unit}`,
22
22
+
],
23
23
+
],
24
24
+
child: Widget.CircularProgress({
25
25
+
hexpand: true,
26
26
+
class_name: `circular-progress ${type}`,
27
27
+
child: Widget.Icon(icons.system[type]),
28
28
+
start_at: 0.75,
29
29
+
binds: [
30
30
+
["value", vars[type]],
31
31
+
["rounded", options.radii, "value", (v) => v > 0],
32
32
+
],
33
33
+
}),
34
34
+
});
35
35
36
36
export default () =>
37
37
-
Widget.Box({
37
37
+
Widget.Box({
38
38
+
vertical: true,
39
39
+
class_name: "datemenu vertical",
40
40
+
children: [
41
41
+
Widget.Box({
42
42
+
class_name: "clock-box",
38
43
vertical: true,
39
39
-
class_name: "datemenu vertical",
44
44
+
children: [
45
45
+
Clock({ format: "%I:%M" }),
46
46
+
Widget.Label({
47
47
+
class_name: "uptime",
48
48
+
binds: [["label", vars.uptime, "value", (t) => `uptime: ${t}`]],
49
49
+
}),
50
50
+
],
51
51
+
}),
52
52
+
Widget.Box({
53
53
+
class_name: "calendar",
54
54
+
child: Widget.Calendar({
55
55
+
hexpand: true,
56
56
+
hpack: "center",
57
57
+
}),
58
58
+
}),
59
59
+
Widget.Box({
60
60
+
class_name: "system-info horizontal",
40
61
children: [
41
41
-
Widget.Box({
42
42
-
class_name: "clock-box",
43
43
-
vertical: true,
44
44
-
children: [
45
45
-
Clock({ format: "%I:%M" }),
46
46
-
Widget.Label({
47
47
-
class_name: "uptime",
48
48
-
binds: [
49
49
-
[
50
50
-
"label",
51
51
-
vars.uptime,
52
52
-
"value",
53
53
-
(t) => `uptime: ${t}`,
54
54
-
],
55
55
-
],
56
56
-
}),
57
57
-
],
58
58
-
}),
59
59
-
Widget.Box({
60
60
-
class_name: "calendar",
61
61
-
child: Widget.Calendar({
62
62
-
hexpand: true,
63
63
-
hpack: "center",
64
64
-
}),
65
65
-
}),
66
66
-
Widget.Box({
67
67
-
class_name: "system-info horizontal",
68
68
-
children: [
69
69
-
SysProgress("cpu", "Cpu", "%"),
70
70
-
SysProgress("ram", "Ram", "%"),
71
71
-
SysProgress("temp", "Temperature", "°"),
72
72
-
],
73
73
-
}),
62
62
+
SysProgress("cpu", "Cpu", "%"),
63
63
+
SysProgress("ram", "Ram", "%"),
64
64
+
SysProgress("temp", "Temperature", "°"),
74
65
],
75
75
-
});
66
66
+
}),
67
67
+
],
68
68
+
});
+72
-79
home/isabel/programs/configs/gui/bars/ags/config/windows/dashboard/NotificationColumn.js
···
5
5
import { timeout } from "resource:///com/github/Aylur/ags/utils.js";
6
6
7
7
const ClearButton = () =>
8
8
-
Widget.Button({
9
9
-
on_clicked: () => {
10
10
-
const list = Array.from(Notifications.notifications);
11
11
-
for (let i = 0; i < list.length; i++)
12
12
-
timeout(50 * i, () => list[i]?.close());
13
13
-
},
14
14
-
binds: [
15
15
-
["sensitive", Notifications, "notifications", (n) => n.length > 0],
16
16
-
],
17
17
-
child: Widget.Box({
18
18
-
children: [
19
19
-
Widget.Label("Clear "),
20
20
-
Widget.Icon({
21
21
-
binds: [
22
22
-
[
23
23
-
"icon",
24
24
-
Notifications,
25
25
-
"notifications",
26
26
-
(n) =>
27
27
-
n.length > 0
28
28
-
? icons.trash.full
29
29
-
: icons.trash.empty,
30
30
-
],
31
31
-
],
32
32
-
}),
8
8
+
Widget.Button({
9
9
+
on_clicked: () => {
10
10
+
const list = Array.from(Notifications.notifications);
11
11
+
for (let i = 0; i < list.length; i++)
12
12
+
timeout(50 * i, () => list[i]?.close());
13
13
+
},
14
14
+
binds: [["sensitive", Notifications, "notifications", (n) => n.length > 0]],
15
15
+
child: Widget.Box({
16
16
+
children: [
17
17
+
Widget.Label("Clear "),
18
18
+
Widget.Icon({
19
19
+
binds: [
20
20
+
[
21
21
+
"icon",
22
22
+
Notifications,
23
23
+
"notifications",
24
24
+
(n) => (n.length > 0 ? icons.trash.full : icons.trash.empty),
33
25
],
26
26
+
],
34
27
}),
35
35
-
});
28
28
+
],
29
29
+
}),
30
30
+
});
36
31
37
32
const Header = () =>
38
38
-
Widget.Box({
39
39
-
class_name: "header",
40
40
-
children: [
41
41
-
Widget.Label({ label: "Notifications", hexpand: true, xalign: 0 }),
42
42
-
ClearButton(),
43
43
-
],
44
44
-
});
33
33
+
Widget.Box({
34
34
+
class_name: "header",
35
35
+
children: [
36
36
+
Widget.Label({ label: "Notifications", hexpand: true, xalign: 0 }),
37
37
+
ClearButton(),
38
38
+
],
39
39
+
});
45
40
46
41
const NotificationList = () =>
47
47
-
Widget.Box({
48
48
-
vertical: true,
49
49
-
vexpand: true,
50
50
-
connections: [
51
51
-
[
52
52
-
Notifications,
53
53
-
(box) => {
54
54
-
box.children = Notifications.notifications
55
55
-
.reverse()
56
56
-
.map(Notification);
42
42
+
Widget.Box({
43
43
+
vertical: true,
44
44
+
vexpand: true,
45
45
+
connections: [
46
46
+
[
47
47
+
Notifications,
48
48
+
(box) => {
49
49
+
box.children = Notifications.notifications
50
50
+
.reverse()
51
51
+
.map(Notification);
57
52
58
58
-
box.visible = Notifications.notifications.length > 0;
59
59
-
},
60
60
-
],
61
61
-
],
62
62
-
});
53
53
+
box.visible = Notifications.notifications.length > 0;
54
54
+
},
55
55
+
],
56
56
+
],
57
57
+
});
63
58
64
59
const Placeholder = () =>
65
65
-
Widget.Box({
66
66
-
class_name: "placeholder",
67
67
-
vertical: true,
68
68
-
vpack: "center",
69
69
-
hpack: "center",
70
70
-
vexpand: true,
71
71
-
hexpand: true,
72
72
-
children: [
73
73
-
Widget.Icon(icons.notifications.silent),
74
74
-
Widget.Label("Your inbox is empty"),
75
75
-
],
76
76
-
binds: [
77
77
-
["visible", Notifications, "notifications", (n) => n.length === 0],
78
78
-
],
79
79
-
});
60
60
+
Widget.Box({
61
61
+
class_name: "placeholder",
62
62
+
vertical: true,
63
63
+
vpack: "center",
64
64
+
hpack: "center",
65
65
+
vexpand: true,
66
66
+
hexpand: true,
67
67
+
children: [
68
68
+
Widget.Icon(icons.notifications.silent),
69
69
+
Widget.Label("Your inbox is empty"),
70
70
+
],
71
71
+
binds: [["visible", Notifications, "notifications", (n) => n.length === 0]],
72
72
+
});
80
73
81
74
export default () =>
82
82
-
Widget.Box({
83
83
-
class_name: "notifications",
84
84
-
vertical: true,
85
85
-
children: [
86
86
-
Header(),
87
87
-
Widget.Scrollable({
88
88
-
vexpand: true,
89
89
-
class_name: "notification-scrollable",
90
90
-
child: Widget.Box({
91
91
-
class_name: "notification-list",
92
92
-
vertical: true,
93
93
-
children: [NotificationList(), Placeholder()],
94
94
-
}),
95
95
-
}),
96
96
-
],
97
97
-
});
75
75
+
Widget.Box({
76
76
+
class_name: "notifications",
77
77
+
vertical: true,
78
78
+
children: [
79
79
+
Header(),
80
80
+
Widget.Scrollable({
81
81
+
vexpand: true,
82
82
+
class_name: "notification-scrollable",
83
83
+
child: Widget.Box({
84
84
+
class_name: "notification-list",
85
85
+
vertical: true,
86
86
+
children: [NotificationList(), Placeholder()],
87
87
+
}),
88
88
+
}),
89
89
+
],
90
90
+
});
+48
-48
home/isabel/programs/configs/gui/bars/ags/config/windows/notifications/Notifications.js
···
6
6
7
7
/** @param {import('types/widgets/revealer').default} parent */
8
8
const Popups = (parent) => {
9
9
-
const map = new Map();
10
10
-
11
11
-
const onDismissed = (_, id, force = false) => {
12
12
-
if (!id || !map.has(id)) return;
9
9
+
const map = new Map();
13
10
14
14
-
if (map.get(id).isHovered() && !force) return;
11
11
+
const onDismissed = (_, id, force = false) => {
12
12
+
if (!id || !map.has(id)) return;
15
13
16
16
-
if (map.size - 1 === 0) parent.reveal_child = false;
14
14
+
if (map.get(id).isHovered() && !force) return;
17
15
18
18
-
Utils.timeout(200, () => {
19
19
-
map.get(id)?.destroy();
20
20
-
map.delete(id);
21
21
-
});
22
22
-
};
16
16
+
if (map.size - 1 === 0) parent.reveal_child = false;
23
17
24
24
-
/** @param {import('types/widgets/box').default} box */
25
25
-
const onNotified = (box, id) => {
26
26
-
if (!id || Notifications.dnd) return;
18
18
+
Utils.timeout(200, () => {
19
19
+
map.get(id)?.destroy();
20
20
+
map.delete(id);
21
21
+
});
22
22
+
};
27
23
28
28
-
const n = Notifications.getNotification(id);
29
29
-
if (!n) return;
24
24
+
/** @param {import('types/widgets/box').default} box */
25
25
+
const onNotified = (box, id) => {
26
26
+
if (!id || Notifications.dnd) return;
30
27
31
31
-
if (options.notifications.black_list.value.includes(n.app_name || ""))
32
32
-
return;
28
28
+
const n = Notifications.getNotification(id);
29
29
+
if (!n) return;
33
30
34
34
-
map.delete(id);
35
35
-
map.set(id, Notification(Notifications.getNotification(id)));
36
36
-
box.children = Array.from(map.values()).reverse();
37
37
-
Utils.timeout(10, () => {
38
38
-
parent.reveal_child = true;
39
39
-
});
40
40
-
};
31
31
+
if (options.notifications.black_list.value.includes(n.app_name || ""))
32
32
+
return;
41
33
42
42
-
return Widget.Box({
43
43
-
vertical: true,
44
44
-
connections: [
45
45
-
[Notifications, onNotified, "notified"],
46
46
-
[Notifications, onDismissed, "dismissed"],
47
47
-
[Notifications, (box, id) => onDismissed(box, id, true), "closed"],
48
48
-
],
34
34
+
map.delete(id);
35
35
+
map.set(id, Notification(Notifications.getNotification(id)));
36
36
+
box.children = Array.from(map.values()).reverse();
37
37
+
Utils.timeout(10, () => {
38
38
+
parent.reveal_child = true;
49
39
});
40
40
+
};
41
41
+
42
42
+
return Widget.Box({
43
43
+
vertical: true,
44
44
+
connections: [
45
45
+
[Notifications, onNotified, "notified"],
46
46
+
[Notifications, onDismissed, "dismissed"],
47
47
+
[Notifications, (box, id) => onDismissed(box, id, true), "closed"],
48
48
+
],
49
49
+
});
50
50
};
51
51
52
52
/** @param {import('types/widgets/revealer').RevealerProps['transition']} transition */
53
53
const PopupList = (transition = "slide_down") =>
54
54
-
Widget.Box({
55
55
-
css: "padding: 1px",
56
56
-
children: [
57
57
-
Widget.Revealer({
58
58
-
transition,
59
59
-
setup: (self) => (self.child = Popups(self)),
60
60
-
}),
61
61
-
],
62
62
-
});
54
54
+
Widget.Box({
55
55
+
css: "padding: 1px",
56
56
+
children: [
57
57
+
Widget.Revealer({
58
58
+
transition,
59
59
+
setup: (self) => (self.child = Popups(self)),
60
60
+
}),
61
61
+
],
62
62
+
});
63
63
64
64
/** @param {number} monitor */
65
65
export default (monitor) =>
66
66
-
Widget.Window({
67
67
-
monitor,
68
68
-
class_name: "notifications",
69
69
-
name: `notifications${monitor}`,
70
70
-
binds: [["anchor", options.notifications.position]],
71
71
-
child: PopupList(),
72
72
-
});
66
66
+
Widget.Window({
67
67
+
monitor,
68
68
+
class_name: "notifications",
69
69
+
name: `notifications${monitor}`,
70
70
+
binds: [["anchor", options.notifications.position]],
71
71
+
child: PopupList(),
72
72
+
});
+19
-22
home/isabel/programs/configs/gui/bars/ags/config/windows/powermenu/PowerMenu.js
···
9
9
* @param {string} label
10
10
*/
11
11
const SysButton = (action, label) =>
12
12
-
Widget.Button({
13
13
-
on_clicked: () => PowerMenu.action(action) + Utils.exec(PowerMenu.cmd),
14
14
-
child: Widget.Box({
15
15
-
vertical: true,
16
16
-
children: [
17
17
-
Widget.Icon(icons.powermenu[action]),
18
18
-
Widget.Label(label),
19
19
-
],
20
20
-
}),
21
21
-
});
12
12
+
Widget.Button({
13
13
+
on_clicked: () => PowerMenu.action(action) + Utils.exec(PowerMenu.cmd),
14
14
+
child: Widget.Box({
15
15
+
vertical: true,
16
16
+
children: [Widget.Icon(icons.powermenu[action]), Widget.Label(label)],
17
17
+
}),
18
18
+
});
22
19
23
20
export default () =>
24
24
-
ShadedPopup({
25
25
-
name: "powermenu",
26
26
-
expand: true,
27
27
-
child: Widget.Box({
28
28
-
children: [
29
29
-
SysButton("sleep", "Sleep"),
30
30
-
SysButton("reboot", "Reboot"),
31
31
-
SysButton("logout", "Log Out"),
32
32
-
SysButton("shutdown", "Shutdown"),
33
33
-
],
34
34
-
}),
35
35
-
});
21
21
+
ShadedPopup({
22
22
+
name: "powermenu",
23
23
+
expand: true,
24
24
+
child: Widget.Box({
25
25
+
children: [
26
26
+
SysButton("sleep", "Sleep"),
27
27
+
SysButton("reboot", "Reboot"),
28
28
+
SysButton("logout", "Log Out"),
29
29
+
SysButton("shutdown", "Shutdown"),
30
30
+
],
31
31
+
}),
32
32
+
});
+28
-30
home/isabel/programs/configs/gui/bars/ags/config/windows/powermenu/ShadedPopup.js
···
3
3
4
4
/** @param {string} windowName */
5
5
const Padding = (windowName) =>
6
6
-
Widget.EventBox({
7
7
-
class_name: "padding",
8
8
-
hexpand: true,
9
9
-
vexpand: true,
10
10
-
connections: [
11
11
-
["button-press-event", () => App.toggleWindow(windowName)],
12
12
-
],
13
13
-
});
6
6
+
Widget.EventBox({
7
7
+
class_name: "padding",
8
8
+
hexpand: true,
9
9
+
vexpand: true,
10
10
+
connections: [["button-press-event", () => App.toggleWindow(windowName)]],
11
11
+
});
14
12
15
13
/**
16
14
* @param {import('types/widgets/window').WindowProps & {
···
19
17
* }} o
20
18
*/
21
19
export default ({ name, child, ...rest }) =>
22
22
-
Widget.Window({
23
23
-
...rest,
24
24
-
class_names: ["popup-window", name],
25
25
-
name,
26
26
-
visible: false,
27
27
-
popup: true,
28
28
-
focusable: true,
29
29
-
setup() {
30
30
-
child.toggleClassName("window-content");
31
31
-
},
32
32
-
child: Widget.CenterBox({
33
33
-
class_name: "shader",
34
34
-
css: "min-width: 5000px; min-height: 3000px;",
35
35
-
children: [
36
36
-
Padding(name),
37
37
-
Widget.CenterBox({
38
38
-
vertical: true,
39
39
-
children: [Padding(name), child, Padding(name)],
40
40
-
}),
41
41
-
Padding(name),
42
42
-
],
20
20
+
Widget.Window({
21
21
+
...rest,
22
22
+
class_names: ["popup-window", name],
23
23
+
name,
24
24
+
visible: false,
25
25
+
popup: true,
26
26
+
focusable: true,
27
27
+
setup() {
28
28
+
child.toggleClassName("window-content");
29
29
+
},
30
30
+
child: Widget.CenterBox({
31
31
+
class_name: "shader",
32
32
+
css: "min-width: 5000px; min-height: 3000px;",
33
33
+
children: [
34
34
+
Padding(name),
35
35
+
Widget.CenterBox({
36
36
+
vertical: true,
37
37
+
children: [Padding(name), child, Padding(name)],
43
38
}),
44
44
-
});
39
39
+
Padding(name),
40
40
+
],
41
41
+
}),
42
42
+
});
+50
-53
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/QuickSettings.js
···
12
12
import PopupWindow from "../../misc/PopupWindow.js";
13
13
14
14
const Row = (toggles = [], menus = []) =>
15
15
-
Widget.Box({
16
16
-
vertical: true,
17
17
-
children: [
18
18
-
Widget.Box({
19
19
-
class_name: "row horizontal",
20
20
-
children: toggles,
21
21
-
}),
22
22
-
...menus,
23
23
-
],
24
24
-
});
15
15
+
Widget.Box({
16
16
+
vertical: true,
17
17
+
children: [
18
18
+
Widget.Box({
19
19
+
class_name: "row horizontal",
20
20
+
children: toggles,
21
21
+
}),
22
22
+
...menus,
23
23
+
],
24
24
+
});
25
25
26
26
const Homogeneous = (toggles) =>
27
27
-
Widget.Box({
28
28
-
homogeneous: true,
29
29
-
children: toggles,
30
30
-
});
27
27
+
Widget.Box({
28
28
+
homogeneous: true,
29
29
+
children: toggles,
30
30
+
});
31
31
32
32
export default () =>
33
33
-
PopupWindow({
34
34
-
name: "quicksettings",
35
35
-
connections: [
36
36
-
[
37
37
-
options.bar.position,
38
38
-
(self) => {
39
39
-
self.anchor = ["right", options.bar.position.value];
40
40
-
if (options.bar.position.value === "top")
41
41
-
self.transition = "slide_down";
33
33
+
PopupWindow({
34
34
+
name: "quicksettings",
35
35
+
connections: [
36
36
+
[
37
37
+
options.bar.position,
38
38
+
(self) => {
39
39
+
self.anchor = ["right", options.bar.position.value];
40
40
+
if (options.bar.position.value === "top")
41
41
+
self.transition = "slide_down";
42
42
43
43
-
if (options.bar.position.value === "bottom")
44
44
-
self.transition = "slide_up";
45
45
-
},
46
46
-
],
47
47
-
],
48
48
-
child: Widget.Box({
49
49
-
vertical: true,
50
50
-
children: [
51
51
-
Header(),
52
52
-
Widget.Box({
53
53
-
class_name: "sliders-box vertical",
54
54
-
class_name: "slider-box",
55
55
-
vertical: true,
56
56
-
children: [
57
57
-
Row([Volume()], [SinkSelector(), AppMixer()]),
58
58
-
Microhone(),
59
59
-
Brightness(),
60
60
-
],
61
61
-
}),
62
62
-
Row(
63
63
-
[Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()],
64
64
-
[WifiSelection(), BluetoothDevices()],
65
65
-
),
66
66
-
Row(
67
67
-
[Homogeneous([ThemeToggle()]), MicMute()],
68
68
-
[ThemeSelector()],
69
69
-
),
70
70
-
Media(),
71
71
-
],
43
43
+
if (options.bar.position.value === "bottom")
44
44
+
self.transition = "slide_up";
45
45
+
},
46
46
+
],
47
47
+
],
48
48
+
child: Widget.Box({
49
49
+
vertical: true,
50
50
+
children: [
51
51
+
Header(),
52
52
+
Widget.Box({
53
53
+
class_name: "sliders-box vertical",
54
54
+
class_name: "slider-box",
55
55
+
vertical: true,
56
56
+
children: [
57
57
+
Row([Volume()], [SinkSelector(), AppMixer()]),
58
58
+
Microhone(),
59
59
+
Brightness(),
60
60
+
],
72
61
}),
73
73
-
});
62
62
+
Row(
63
63
+
[Homogeneous([NetworkToggle(), BluetoothToggle()]), DND()],
64
64
+
[WifiSelection(), BluetoothDevices()],
65
65
+
),
66
66
+
Row([Homogeneous([ThemeToggle()]), MicMute()], [ThemeSelector()]),
67
67
+
Media(),
68
68
+
],
69
69
+
}),
70
70
+
});
+99
-101
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/ToggleButton.js
···
7
7
/** name of the currently opened menu */
8
8
export const opened = Variable("");
9
9
App.connect("window-toggled", (_, name, visible) => {
10
10
-
if (name === "quicksettings" && !visible)
11
11
-
Utils.timeout(500, () => (opened.value = ""));
10
10
+
if (name === "quicksettings" && !visible)
11
11
+
Utils.timeout(500, () => (opened.value = ""));
12
12
});
13
13
14
14
/**
···
16
16
* @param {(() => void) | false=} activate
17
17
*/
18
18
export const Arrow = (name, activate) => {
19
19
-
let deg = 0;
20
20
-
let iconOpened = false;
21
21
-
return Widget.Button({
22
22
-
child: Widget.Icon({
23
23
-
icon: icons.ui.arrow.right,
24
24
-
connections: [
25
25
-
[
26
26
-
opened,
27
27
-
(icon) => {
28
28
-
if (
29
29
-
(opened.value === name && !iconOpened) ||
30
30
-
(opened.value !== name && iconOpened)
31
31
-
) {
32
32
-
const step = opened.value === name ? 10 : -10;
33
33
-
iconOpened = !iconOpened;
34
34
-
for (let i = 0; i < 9; ++i) {
35
35
-
Utils.timeout(15 * i, () => {
36
36
-
deg += step;
37
37
-
icon.setCss(
38
38
-
`-gtk-icon-transform: rotate(${deg}deg);`,
39
39
-
);
40
40
-
});
41
41
-
}
42
42
-
}
43
43
-
},
44
44
-
],
45
45
-
],
46
46
-
}),
47
47
-
on_clicked: () => {
48
48
-
opened.value = opened.value === name ? "" : name;
49
49
-
if (typeof activate === "function") activate();
50
50
-
},
51
51
-
});
19
19
+
let deg = 0;
20
20
+
let iconOpened = false;
21
21
+
return Widget.Button({
22
22
+
child: Widget.Icon({
23
23
+
icon: icons.ui.arrow.right,
24
24
+
connections: [
25
25
+
[
26
26
+
opened,
27
27
+
(icon) => {
28
28
+
if (
29
29
+
(opened.value === name && !iconOpened) ||
30
30
+
(opened.value !== name && iconOpened)
31
31
+
) {
32
32
+
const step = opened.value === name ? 10 : -10;
33
33
+
iconOpened = !iconOpened;
34
34
+
for (let i = 0; i < 9; ++i) {
35
35
+
Utils.timeout(15 * i, () => {
36
36
+
deg += step;
37
37
+
icon.setCss(`-gtk-icon-transform: rotate(${deg}deg);`);
38
38
+
});
39
39
+
}
40
40
+
}
41
41
+
},
42
42
+
],
43
43
+
],
44
44
+
}),
45
45
+
on_clicked: () => {
46
46
+
opened.value = opened.value === name ? "" : name;
47
47
+
if (typeof activate === "function") activate();
48
48
+
},
49
49
+
});
52
50
};
53
51
54
52
/**
···
62
60
* @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection
63
61
*/
64
62
export const ArrowToggleButton = ({
65
65
-
name,
66
66
-
icon,
67
67
-
label,
68
68
-
activate,
69
69
-
deactivate,
70
70
-
activateOnArrow = true,
71
71
-
connection: [service, condition],
63
63
+
name,
64
64
+
icon,
65
65
+
label,
66
66
+
activate,
67
67
+
deactivate,
68
68
+
activateOnArrow = true,
69
69
+
connection: [service, condition],
72
70
}) =>
73
73
-
Widget.Box({
74
74
-
class_name: "toggle-button",
75
75
-
connections: [
76
76
-
[
77
77
-
service,
78
78
-
(box) => {
79
79
-
box.toggleClassName("active", condition());
80
80
-
},
81
81
-
],
82
82
-
],
83
83
-
children: [
84
84
-
Widget.Button({
85
85
-
child: Widget.Box({
86
86
-
hexpand: true,
87
87
-
children: [icon, label],
88
88
-
}),
89
89
-
on_clicked: () => {
90
90
-
if (condition()) {
91
91
-
deactivate();
92
92
-
if (opened.value === name) opened.value = "";
93
93
-
} else {
94
94
-
activate();
95
95
-
}
96
96
-
},
97
97
-
}),
98
98
-
Arrow(name, activateOnArrow && activate),
99
99
-
],
100
100
-
});
71
71
+
Widget.Box({
72
72
+
class_name: "toggle-button",
73
73
+
connections: [
74
74
+
[
75
75
+
service,
76
76
+
(box) => {
77
77
+
box.toggleClassName("active", condition());
78
78
+
},
79
79
+
],
80
80
+
],
81
81
+
children: [
82
82
+
Widget.Button({
83
83
+
child: Widget.Box({
84
84
+
hexpand: true,
85
85
+
children: [icon, label],
86
86
+
}),
87
87
+
on_clicked: () => {
88
88
+
if (condition()) {
89
89
+
deactivate();
90
90
+
if (opened.value === name) opened.value = "";
91
91
+
} else {
92
92
+
activate();
93
93
+
}
94
94
+
},
95
95
+
}),
96
96
+
Arrow(name, activateOnArrow && activate),
97
97
+
],
98
98
+
});
101
99
102
100
/**
103
101
* @param {Object} o
···
107
105
* @param {import('gi://Gtk').Gtk.Widget[]} o.content
108
106
*/
109
107
export const Menu = ({ name, icon, title, content }) =>
110
110
-
Widget.Revealer({
111
111
-
transition: "slide_down",
112
112
-
binds: [["reveal-child", opened, "value", (v) => v === name]],
113
113
-
child: Widget.Box({
114
114
-
class_names: ["menu", name],
115
115
-
vertical: true,
116
116
-
children: [
117
117
-
Widget.Box({
118
118
-
class_name: "title horizontal",
119
119
-
children: [icon, title],
120
120
-
}),
121
121
-
Widget.Separator(),
122
122
-
...content,
123
123
-
],
108
108
+
Widget.Revealer({
109
109
+
transition: "slide_down",
110
110
+
binds: [["reveal-child", opened, "value", (v) => v === name]],
111
111
+
child: Widget.Box({
112
112
+
class_names: ["menu", name],
113
113
+
vertical: true,
114
114
+
children: [
115
115
+
Widget.Box({
116
116
+
class_name: "title horizontal",
117
117
+
children: [icon, title],
124
118
}),
125
125
-
});
119
119
+
Widget.Separator(),
120
120
+
...content,
121
121
+
],
122
122
+
}),
123
123
+
});
126
124
127
125
/**
128
126
* @param {Object} o
···
131
129
* @param {[import('gi://GObject').GObject.Object, () => boolean]} o.connection
132
130
*/
133
131
export const SimpleToggleButton = ({
134
134
-
icon,
135
135
-
toggle,
136
136
-
connection: [service, condition],
132
132
+
icon,
133
133
+
toggle,
134
134
+
connection: [service, condition],
137
135
}) =>
138
138
-
Widget.Button({
139
139
-
class_name: "simple-toggle",
140
140
-
connections: [
141
141
-
[
142
142
-
service,
143
143
-
(box) => {
144
144
-
box.toggleClassName("active", condition());
145
145
-
},
146
146
-
],
147
147
-
],
148
148
-
child: icon,
149
149
-
on_clicked: toggle,
150
150
-
});
136
136
+
Widget.Button({
137
137
+
class_name: "simple-toggle",
138
138
+
connections: [
139
139
+
[
140
140
+
service,
141
141
+
(box) => {
142
142
+
box.toggleClassName("active", condition());
143
143
+
},
144
144
+
],
145
145
+
],
146
146
+
child: icon,
147
147
+
on_clicked: toggle,
148
148
+
});
+80
-84
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Bluetooth.js
···
4
4
import { Menu, ArrowToggleButton } from "../ToggleButton.js";
5
5
6
6
export const BluetoothToggle = () =>
7
7
-
ArrowToggleButton({
8
8
-
name: "bluetooth",
9
9
-
icon: Widget.Icon({
10
10
-
connections: [
11
11
-
[
12
12
-
Bluetooth,
13
13
-
(icon) => {
14
14
-
icon.icon = Bluetooth.enabled
15
15
-
? icons.bluetooth.enabled
16
16
-
: icons.bluetooth.disabled;
17
17
-
},
18
18
-
],
19
19
-
],
20
20
-
}),
21
21
-
label: Widget.Label({
22
22
-
truncate: "end",
23
23
-
connections: [
24
24
-
[
25
25
-
Bluetooth,
26
26
-
(label) => {
27
27
-
if (!Bluetooth.enabled)
28
28
-
return (label.label = "Disabled");
7
7
+
ArrowToggleButton({
8
8
+
name: "bluetooth",
9
9
+
icon: Widget.Icon({
10
10
+
connections: [
11
11
+
[
12
12
+
Bluetooth,
13
13
+
(icon) => {
14
14
+
icon.icon = Bluetooth.enabled
15
15
+
? icons.bluetooth.enabled
16
16
+
: icons.bluetooth.disabled;
17
17
+
},
18
18
+
],
19
19
+
],
20
20
+
}),
21
21
+
label: Widget.Label({
22
22
+
truncate: "end",
23
23
+
connections: [
24
24
+
[
25
25
+
Bluetooth,
26
26
+
(label) => {
27
27
+
if (!Bluetooth.enabled) return (label.label = "Disabled");
29
28
30
30
-
if (Bluetooth.connectedDevices.length === 0)
31
31
-
return (label.label = "Not Connected");
29
29
+
if (Bluetooth.connectedDevices.length === 0)
30
30
+
return (label.label = "Not Connected");
32
31
33
33
-
if (Bluetooth.connectedDevices.length === 1)
34
34
-
return (label.label =
35
35
-
Bluetooth.connectedDevices[0].alias);
32
32
+
if (Bluetooth.connectedDevices.length === 1)
33
33
+
return (label.label = Bluetooth.connectedDevices[0].alias);
36
34
37
37
-
label.label = `${Bluetooth.connectedDevices.length} Connected`;
38
38
-
},
39
39
-
],
40
40
-
],
41
41
-
}),
42
42
-
connection: [Bluetooth, () => Bluetooth.enabled],
43
43
-
deactivate: () => (Bluetooth.enabled = false),
44
44
-
activate: () => (Bluetooth.enabled = true),
45
45
-
});
35
35
+
label.label = `${Bluetooth.connectedDevices.length} Connected`;
36
36
+
},
37
37
+
],
38
38
+
],
39
39
+
}),
40
40
+
connection: [Bluetooth, () => Bluetooth.enabled],
41
41
+
deactivate: () => (Bluetooth.enabled = false),
42
42
+
activate: () => (Bluetooth.enabled = true),
43
43
+
});
46
44
47
45
const DeviceItem = (device) =>
48
48
-
Widget.Box({
49
49
-
children: [
50
50
-
Widget.Icon(device.icon_name + "-symbolic"),
51
51
-
Widget.Label(device.name),
52
52
-
Widget.Label({
53
53
-
label: `${device.battery_percentage}%`,
54
54
-
binds: [
55
55
-
["visible", device, "battery-percentage", (p) => p > 0],
56
56
-
],
57
57
-
}),
58
58
-
Widget.Box({ hexpand: true }),
59
59
-
Widget.Spinner({
60
60
-
binds: [
61
61
-
["active", device, "connecting"],
62
62
-
["visible", device, "connecting"],
63
63
-
],
64
64
-
}),
65
65
-
Widget.Switch({
66
66
-
active: device.connected,
67
67
-
binds: [["visible", device, "connecting", (c) => !c]],
68
68
-
connections: [
69
69
-
[
70
70
-
"notify::active",
71
71
-
({ active }) => {
72
72
-
device.setConnection(active);
73
73
-
},
74
74
-
],
75
75
-
],
76
76
-
}),
46
46
+
Widget.Box({
47
47
+
children: [
48
48
+
Widget.Icon(device.icon_name + "-symbolic"),
49
49
+
Widget.Label(device.name),
50
50
+
Widget.Label({
51
51
+
label: `${device.battery_percentage}%`,
52
52
+
binds: [["visible", device, "battery-percentage", (p) => p > 0]],
53
53
+
}),
54
54
+
Widget.Box({ hexpand: true }),
55
55
+
Widget.Spinner({
56
56
+
binds: [
57
57
+
["active", device, "connecting"],
58
58
+
["visible", device, "connecting"],
77
59
],
78
78
-
});
60
60
+
}),
61
61
+
Widget.Switch({
62
62
+
active: device.connected,
63
63
+
binds: [["visible", device, "connecting", (c) => !c]],
64
64
+
connections: [
65
65
+
[
66
66
+
"notify::active",
67
67
+
({ active }) => {
68
68
+
device.setConnection(active);
69
69
+
},
70
70
+
],
71
71
+
],
72
72
+
}),
73
73
+
],
74
74
+
});
79
75
80
76
export const BluetoothDevices = () =>
81
81
-
Menu({
82
82
-
name: "bluetooth",
83
83
-
icon: Widget.Icon(icons.bluetooth.disabled),
84
84
-
title: Widget.Label("Bluetooth"),
85
85
-
content: [
86
86
-
Widget.Box({
87
87
-
hexpand: true,
88
88
-
vertical: true,
89
89
-
binds: [
90
90
-
[
91
91
-
"children",
92
92
-
Bluetooth,
93
93
-
"devices",
94
94
-
(ds) => ds.filter((d) => d.name).map(DeviceItem),
95
95
-
],
96
96
-
],
97
97
-
}),
77
77
+
Menu({
78
78
+
name: "bluetooth",
79
79
+
icon: Widget.Icon(icons.bluetooth.disabled),
80
80
+
title: Widget.Label("Bluetooth"),
81
81
+
content: [
82
82
+
Widget.Box({
83
83
+
hexpand: true,
84
84
+
vertical: true,
85
85
+
binds: [
86
86
+
[
87
87
+
"children",
88
88
+
Bluetooth,
89
89
+
"devices",
90
90
+
(ds) => ds.filter((d) => d.name).map(DeviceItem),
91
91
+
],
98
92
],
99
99
-
});
93
93
+
}),
94
94
+
],
95
95
+
});
+21
-21
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Brightness.js
···
3
3
import Brightness from "../../../services/brightness.js";
4
4
5
5
const BrightnessSlider = () =>
6
6
-
Widget.Slider({
7
7
-
draw_value: false,
8
8
-
hexpand: true,
9
9
-
binds: [["value", Brightness, "screen"]],
10
10
-
on_change: ({ value }) => (Brightness.screen = value),
11
11
-
});
6
6
+
Widget.Slider({
7
7
+
draw_value: false,
8
8
+
hexpand: true,
9
9
+
binds: [["value", Brightness, "screen"]],
10
10
+
on_change: ({ value }) => (Brightness.screen = value),
11
11
+
});
12
12
13
13
export default () =>
14
14
-
Widget.Box({
15
15
-
children: [
16
16
-
Widget.Button({
17
17
-
child: Widget.Icon(icons.brightness.indicator),
18
18
-
binds: [
19
19
-
[
20
20
-
"tooltip-text",
21
21
-
Brightness,
22
22
-
"screen",
23
23
-
(v) => `Screen Brightness: ${Math.floor(v * 100)}%`,
24
24
-
],
25
25
-
],
26
26
-
}),
27
27
-
BrightnessSlider(),
14
14
+
Widget.Box({
15
15
+
children: [
16
16
+
Widget.Button({
17
17
+
child: Widget.Icon(icons.brightness.indicator),
18
18
+
binds: [
19
19
+
[
20
20
+
"tooltip-text",
21
21
+
Brightness,
22
22
+
"screen",
23
23
+
(v) => `Screen Brightness: ${Math.floor(v * 100)}%`,
24
24
+
],
28
25
],
29
29
-
});
26
26
+
}),
27
27
+
BrightnessSlider(),
28
28
+
],
29
29
+
});
+17
-17
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/DND.js
···
4
4
import { SimpleToggleButton } from "../ToggleButton.js";
5
5
6
6
export default () =>
7
7
-
SimpleToggleButton({
8
8
-
icon: Widget.Icon({
9
9
-
connections: [
10
10
-
[
11
11
-
Notifications,
12
12
-
(icon) => {
13
13
-
icon.icon = Notifications.dnd
14
14
-
? icons.notifications.silent
15
15
-
: icons.notifications.noisy;
16
16
-
},
17
17
-
"notify::dnd",
18
18
-
],
19
19
-
],
20
20
-
}),
21
21
-
toggle: () => (Notifications.dnd = !Notifications.dnd),
22
22
-
connection: [Notifications, () => Notifications.dnd],
23
23
-
});
7
7
+
SimpleToggleButton({
8
8
+
icon: Widget.Icon({
9
9
+
connections: [
10
10
+
[
11
11
+
Notifications,
12
12
+
(icon) => {
13
13
+
icon.icon = Notifications.dnd
14
14
+
? icons.notifications.silent
15
15
+
: icons.notifications.noisy;
16
16
+
},
17
17
+
"notify::dnd",
18
18
+
],
19
19
+
],
20
20
+
}),
21
21
+
toggle: () => (Notifications.dnd = !Notifications.dnd),
22
22
+
connection: [Notifications, () => Notifications.dnd],
23
23
+
});
+81
-87
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Header.js
···
8
8
import { openSettings } from "../../../settings/theme.js";
9
9
10
10
export const BatteryProgress = () =>
11
11
-
Widget.Box({
12
12
-
class_name: "battery-progress",
11
11
+
Widget.Box({
12
12
+
class_name: "battery-progress",
13
13
+
vexpand: true,
14
14
+
binds: [["visible", Battery, "available"]],
15
15
+
connections: [
16
16
+
[
17
17
+
Battery,
18
18
+
(w) => {
19
19
+
w.toggleClassName("charging", Battery.charging || Battery.charged);
20
20
+
w.toggleClassName(
21
21
+
"medium",
22
22
+
Battery.percent < options.battery.medium.value,
23
23
+
);
24
24
+
w.toggleClassName("low", Battery.percent < options.battery.low.value);
25
25
+
w.toggleClassName("half", Battery.percent < 48);
26
26
+
},
27
27
+
],
28
28
+
],
29
29
+
child: Widget.Overlay({
30
30
+
vexpand: true,
31
31
+
child: Widget.ProgressBar({
32
32
+
hexpand: true,
13
33
vexpand: true,
14
14
-
binds: [["visible", Battery, "available"]],
15
34
connections: [
16
16
-
[
17
17
-
Battery,
18
18
-
(w) => {
19
19
-
w.toggleClassName(
20
20
-
"charging",
21
21
-
Battery.charging || Battery.charged,
22
22
-
);
23
23
-
w.toggleClassName(
24
24
-
"medium",
25
25
-
Battery.percent < options.battery.medium.value,
26
26
-
);
27
27
-
w.toggleClassName(
28
28
-
"low",
29
29
-
Battery.percent < options.battery.low.value,
30
30
-
);
31
31
-
w.toggleClassName("half", Battery.percent < 48);
32
32
-
},
33
33
-
],
35
35
+
[
36
36
+
Battery,
37
37
+
(progress) => {
38
38
+
progress.fraction = Battery.percent / 100;
39
39
+
},
40
40
+
],
34
41
],
35
35
-
child: Widget.Overlay({
36
36
-
vexpand: true,
37
37
-
child: Widget.ProgressBar({
38
38
-
hexpand: true,
39
39
-
vexpand: true,
40
40
-
connections: [
41
41
-
[
42
42
-
Battery,
43
43
-
(progress) => {
44
44
-
progress.fraction = Battery.percent / 100;
45
45
-
},
46
46
-
],
47
47
-
],
48
48
-
}),
49
49
-
overlays: [
50
50
-
Widget.Label({
51
51
-
connections: [
52
52
-
[
53
53
-
Battery,
54
54
-
(l) => {
55
55
-
l.label =
56
56
-
Battery.charging || Battery.charged
57
57
-
? icons.battery.charging
58
58
-
: `${Battery.percent}%`;
59
59
-
},
60
60
-
],
61
61
-
],
62
62
-
}),
42
42
+
}),
43
43
+
overlays: [
44
44
+
Widget.Label({
45
45
+
connections: [
46
46
+
[
47
47
+
Battery,
48
48
+
(l) => {
49
49
+
l.label =
50
50
+
Battery.charging || Battery.charged
51
51
+
? icons.battery.charging
52
52
+
: `${Battery.percent}%`;
53
53
+
},
63
54
],
55
55
+
],
64
56
}),
65
65
-
});
57
57
+
],
58
58
+
}),
59
59
+
});
66
60
67
61
export default () =>
68
68
-
Widget.Box({
69
69
-
class_name: "header horizontal",
62
62
+
Widget.Box({
63
63
+
class_name: "header horizontal",
64
64
+
children: [
65
65
+
Avatar(),
66
66
+
Widget.Box({
67
67
+
class_name: "system-box",
68
68
+
vertical: true,
69
69
+
hexpand: true,
70
70
children: [
71
71
-
Avatar(),
72
72
-
Widget.Box({
73
73
-
class_name: "system-box",
74
74
-
vertical: true,
71
71
+
Widget.Box({
72
72
+
children: [
73
73
+
Widget.Button({
74
74
+
vpack: "center",
75
75
+
on_clicked: openSettings,
76
76
+
child: Widget.Icon(icons.ui.settings),
77
77
+
}),
78
78
+
Widget.Label({
79
79
+
class_name: "uptime",
75
80
hexpand: true,
76
76
-
children: [
77
77
-
Widget.Box({
78
78
-
children: [
79
79
-
Widget.Button({
80
80
-
vpack: "center",
81
81
-
on_clicked: openSettings,
82
82
-
child: Widget.Icon(icons.ui.settings),
83
83
-
}),
84
84
-
Widget.Label({
85
85
-
class_name: "uptime",
86
86
-
hexpand: true,
87
87
-
vpack: "center",
88
88
-
connections: [
89
89
-
[
90
90
-
uptime,
91
91
-
(label) => {
92
92
-
label.label = `uptime: ${uptime.value}`;
93
93
-
},
94
94
-
],
95
95
-
],
96
96
-
}),
97
97
-
Widget.Button({
98
98
-
vpack: "center",
99
99
-
on_clicked: () => PowerMenu.action("shutdown"),
100
100
-
child: Widget.Icon(icons.powermenu.shutdown),
101
101
-
}),
102
102
-
],
103
103
-
}),
104
104
-
BatteryProgress(),
81
81
+
vpack: "center",
82
82
+
connections: [
83
83
+
[
84
84
+
uptime,
85
85
+
(label) => {
86
86
+
label.label = `uptime: ${uptime.value}`;
87
87
+
},
88
88
+
],
105
89
],
106
106
-
}),
90
90
+
}),
91
91
+
Widget.Button({
92
92
+
vpack: "center",
93
93
+
on_clicked: () => PowerMenu.action("shutdown"),
94
94
+
child: Widget.Icon(icons.powermenu.shutdown),
95
95
+
}),
96
96
+
],
97
97
+
}),
98
98
+
BatteryProgress(),
107
99
],
108
108
-
});
100
100
+
}),
101
101
+
],
102
102
+
});
+87
-92
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Media.js
···
5
5
6
6
/** @param {import('types/service/mpris').MprisPlayer} player */
7
7
const Footer = (player) =>
8
8
-
Widget.CenterBox({
9
9
-
class_name: "footer-box",
8
8
+
Widget.CenterBox({
9
9
+
class_name: "footer-box",
10
10
+
children: [
11
11
+
Widget.Box({
12
12
+
class_name: "position",
13
13
+
children: [
14
14
+
mpris.PositionLabel(player),
15
15
+
mpris.Slash(player),
16
16
+
mpris.LengthLabel(player),
17
17
+
],
18
18
+
}),
19
19
+
Widget.Box({
20
20
+
class_name: "controls",
10
21
children: [
11
11
-
Widget.Box({
12
12
-
class_name: "position",
13
13
-
children: [
14
14
-
mpris.PositionLabel(player),
15
15
-
mpris.Slash(player),
16
16
-
mpris.LengthLabel(player),
17
17
-
],
18
18
-
}),
19
19
-
Widget.Box({
20
20
-
class_name: "controls",
21
21
-
children: [
22
22
-
mpris.ShuffleButton(player),
23
23
-
mpris.PreviousButton(player),
24
24
-
mpris.PlayPauseButton(player),
25
25
-
mpris.NextButton(player),
26
26
-
mpris.LoopButton(player),
27
27
-
],
28
28
-
}),
29
29
-
mpris.PlayerIcon(player, {
30
30
-
symbolic: false,
31
31
-
hexpand: true,
32
32
-
hpack: "end",
33
33
-
}),
22
22
+
mpris.ShuffleButton(player),
23
23
+
mpris.PreviousButton(player),
24
24
+
mpris.PlayPauseButton(player),
25
25
+
mpris.NextButton(player),
26
26
+
mpris.LoopButton(player),
34
27
],
35
35
-
});
28
28
+
}),
29
29
+
mpris.PlayerIcon(player, {
30
30
+
symbolic: false,
31
31
+
hexpand: true,
32
32
+
hpack: "end",
33
33
+
}),
34
34
+
],
35
35
+
});
36
36
37
37
/** @param {import('types/service/mpris').MprisPlayer} player */
38
38
const TextBox = (player) =>
39
39
-
Widget.Box({
39
39
+
Widget.Box({
40
40
+
children: [
41
41
+
mpris.CoverArt(player, {
42
42
+
hpack: "end",
43
43
+
hexpand: false,
44
44
+
}),
45
45
+
Widget.Box({
46
46
+
hexpand: true,
47
47
+
vertical: true,
48
48
+
class_name: "labels",
40
49
children: [
41
41
-
mpris.CoverArt(player, {
42
42
-
hpack: "end",
43
43
-
hexpand: false,
44
44
-
}),
45
45
-
Widget.Box({
46
46
-
hexpand: true,
47
47
-
vertical: true,
48
48
-
class_name: "labels",
49
49
-
children: [
50
50
-
mpris.TitleLabel(player, {
51
51
-
xalign: 0,
52
52
-
justification: "left",
53
53
-
wrap: true,
54
54
-
}),
55
55
-
mpris.ArtistLabel(player, {
56
56
-
xalign: 0,
57
57
-
justification: "left",
58
58
-
wrap: true,
59
59
-
}),
60
60
-
],
61
61
-
}),
50
50
+
mpris.TitleLabel(player, {
51
51
+
xalign: 0,
52
52
+
justification: "left",
53
53
+
wrap: true,
54
54
+
}),
55
55
+
mpris.ArtistLabel(player, {
56
56
+
xalign: 0,
57
57
+
justification: "left",
58
58
+
wrap: true,
59
59
+
}),
62
60
],
63
63
-
});
61
61
+
}),
62
62
+
],
63
63
+
});
64
64
65
65
/** @param {import('types/service/mpris').MprisPlayer} player */
66
66
const PlayerBox = (player) =>
67
67
-
Widget.Box({
68
68
-
class_name: `player ${player.name}`,
69
69
-
child: mpris.BlurredCoverArt(player, {
70
70
-
hexpand: true,
71
71
-
child: Widget.Box({
72
72
-
hexpand: true,
73
73
-
vertical: true,
74
74
-
children: [
75
75
-
TextBox(player),
76
76
-
mpris.PositionSlider(player),
77
77
-
Footer(player),
78
78
-
],
79
79
-
}),
80
80
-
}),
81
81
-
});
67
67
+
Widget.Box({
68
68
+
class_name: `player ${player.name}`,
69
69
+
child: mpris.BlurredCoverArt(player, {
70
70
+
hexpand: true,
71
71
+
child: Widget.Box({
72
72
+
hexpand: true,
73
73
+
vertical: true,
74
74
+
children: [
75
75
+
TextBox(player),
76
76
+
mpris.PositionSlider(player),
77
77
+
Footer(player),
78
78
+
],
79
79
+
}),
80
80
+
}),
81
81
+
});
82
82
83
83
export default () =>
84
84
-
Widget.Box({
85
85
-
vertical: true,
86
86
-
class_name: "media vertical",
87
87
-
connections: [
88
88
-
[
89
89
-
"draw",
90
90
-
(self) => {
91
91
-
self.visible = Mpris.players.length > 0;
92
92
-
},
93
93
-
],
94
94
-
],
95
95
-
binds: [
96
96
-
[
97
97
-
"children",
98
98
-
Mpris,
99
99
-
"players",
100
100
-
(ps) =>
101
101
-
ps
102
102
-
.filter(
103
103
-
(p) =>
104
104
-
!options.mpris.black_list.value.includes(
105
105
-
p.identity,
106
106
-
),
107
107
-
)
108
108
-
.map(PlayerBox),
109
109
-
],
110
110
-
],
111
111
-
});
84
84
+
Widget.Box({
85
85
+
vertical: true,
86
86
+
class_name: "media vertical",
87
87
+
connections: [
88
88
+
[
89
89
+
"draw",
90
90
+
(self) => {
91
91
+
self.visible = Mpris.players.length > 0;
92
92
+
},
93
93
+
],
94
94
+
],
95
95
+
binds: [
96
96
+
[
97
97
+
"children",
98
98
+
Mpris,
99
99
+
"players",
100
100
+
(ps) =>
101
101
+
ps
102
102
+
.filter((p) => !options.mpris.black_list.value.includes(p.identity))
103
103
+
.map(PlayerBox),
104
104
+
],
105
105
+
],
106
106
+
});
+17
-17
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/MicMute.js
···
4
4
import { SimpleToggleButton } from "../ToggleButton.js";
5
5
6
6
export default () =>
7
7
-
SimpleToggleButton({
8
8
-
icon: Widget.Icon({
9
9
-
connections: [
10
10
-
[
11
11
-
Audio,
12
12
-
(icon) => {
13
13
-
icon.icon = Audio.microphone?.is_muted
14
14
-
? icons.audio.mic.muted
15
15
-
: icons.audio.mic.high;
16
16
-
},
17
17
-
"microphone-changed",
18
18
-
],
19
19
-
],
20
20
-
}),
21
21
-
toggle: () => (Audio.microphone.is_muted = !Audio.microphone.is_muted),
22
22
-
connection: [Audio, () => Audio.microphone?.is_muted],
23
23
-
});
7
7
+
SimpleToggleButton({
8
8
+
icon: Widget.Icon({
9
9
+
connections: [
10
10
+
[
11
11
+
Audio,
12
12
+
(icon) => {
13
13
+
icon.icon = Audio.microphone?.is_muted
14
14
+
? icons.audio.mic.muted
15
15
+
: icons.audio.mic.high;
16
16
+
},
17
17
+
"microphone-changed",
18
18
+
],
19
19
+
],
20
20
+
}),
21
21
+
toggle: () => (Audio.microphone.is_muted = !Audio.microphone.is_muted),
22
22
+
connection: [Audio, () => Audio.microphone?.is_muted],
23
23
+
});
+77
-83
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Network.js
···
6
6
import icons from "../../../icons.js";
7
7
8
8
export const NetworkToggle = () =>
9
9
-
ArrowToggleButton({
10
10
-
name: "network",
11
11
-
icon: Widget.Icon({
12
12
-
connections: [
13
13
-
[
14
14
-
Network,
15
15
-
(icon) => {
16
16
-
icon.icon = Network.wifi.icon_name || "";
17
17
-
},
18
18
-
],
19
19
-
],
20
20
-
}),
21
21
-
label: Widget.Label({
22
22
-
truncate: "end",
23
23
-
connections: [
24
24
-
[
25
25
-
Network,
26
26
-
(label) => {
27
27
-
label.label = Network.wifi.ssid || "Not Connected";
28
28
-
},
29
29
-
],
30
30
-
],
31
31
-
}),
32
32
-
connection: [Network, () => Network.wifi.enabled],
33
33
-
deactivate: () => (Network.wifi.enabled = false),
34
34
-
activate: () => {
35
35
-
Network.wifi.enabled = true;
36
36
-
Network.wifi.scan();
37
37
-
},
38
38
-
});
9
9
+
ArrowToggleButton({
10
10
+
name: "network",
11
11
+
icon: Widget.Icon({
12
12
+
connections: [
13
13
+
[
14
14
+
Network,
15
15
+
(icon) => {
16
16
+
icon.icon = Network.wifi.icon_name || "";
17
17
+
},
18
18
+
],
19
19
+
],
20
20
+
}),
21
21
+
label: Widget.Label({
22
22
+
truncate: "end",
23
23
+
connections: [
24
24
+
[
25
25
+
Network,
26
26
+
(label) => {
27
27
+
label.label = Network.wifi.ssid || "Not Connected";
28
28
+
},
29
29
+
],
30
30
+
],
31
31
+
}),
32
32
+
connection: [Network, () => Network.wifi.enabled],
33
33
+
deactivate: () => (Network.wifi.enabled = false),
34
34
+
activate: () => {
35
35
+
Network.wifi.enabled = true;
36
36
+
Network.wifi.scan();
37
37
+
},
38
38
+
});
39
39
40
40
export const WifiSelection = () =>
41
41
-
Menu({
42
42
-
name: "network",
43
43
-
icon: Widget.Icon({
44
44
-
connections: [
45
45
-
[
46
46
-
Network,
47
47
-
(icon) => {
48
48
-
icon.icon = Network.wifi.icon_name;
49
49
-
},
50
50
-
],
51
51
-
],
52
52
-
}),
53
53
-
title: Widget.Label("Wifi Selection"),
54
54
-
content: [
55
55
-
Widget.Box({
56
56
-
vertical: true,
57
57
-
connections: [
58
58
-
[
59
59
-
Network,
60
60
-
(box) =>
61
61
-
(box.children = Network.wifi?.access_points.map(
62
62
-
(ap) =>
63
63
-
Widget.Button({
64
64
-
on_clicked: () =>
65
65
-
Utils.execAsync(
66
66
-
`nmcli device wifi connect ${ap.bssid}`,
67
67
-
),
68
68
-
child: Widget.Box({
69
69
-
children: [
70
70
-
Widget.Icon(ap.iconName),
71
71
-
Widget.Label(ap.ssid || ""),
72
72
-
ap.active &&
73
73
-
Widget.Icon({
74
74
-
icon: icons.tick,
75
75
-
hexpand: true,
76
76
-
hpack: "end",
77
77
-
}),
78
78
-
],
79
79
-
}),
80
80
-
}),
81
81
-
)),
82
82
-
],
83
83
-
],
84
84
-
}),
85
85
-
Widget.Separator(),
86
86
-
Widget.Button({
87
87
-
on_clicked: () =>
88
88
-
Applications.query("nm-connection-editor")?.[0].launch(),
89
89
-
child: Widget.Box({
41
41
+
Menu({
42
42
+
name: "network",
43
43
+
icon: Widget.Icon({
44
44
+
connections: [
45
45
+
[
46
46
+
Network,
47
47
+
(icon) => {
48
48
+
icon.icon = Network.wifi.icon_name;
49
49
+
},
50
50
+
],
51
51
+
],
52
52
+
}),
53
53
+
title: Widget.Label("Wifi Selection"),
54
54
+
content: [
55
55
+
Widget.Box({
56
56
+
vertical: true,
57
57
+
connections: [
58
58
+
[
59
59
+
Network,
60
60
+
(box) =>
61
61
+
(box.children = Network.wifi?.access_points.map((ap) =>
62
62
+
Widget.Button({
63
63
+
on_clicked: () =>
64
64
+
Utils.execAsync(`nmcli device wifi connect ${ap.bssid}`),
65
65
+
child: Widget.Box({
90
66
children: [
91
91
-
Widget.Icon(icons.ui.settings),
92
92
-
Widget.Label("Network"),
67
67
+
Widget.Icon(ap.iconName),
68
68
+
Widget.Label(ap.ssid || ""),
69
69
+
ap.active &&
70
70
+
Widget.Icon({
71
71
+
icon: icons.tick,
72
72
+
hexpand: true,
73
73
+
hpack: "end",
74
74
+
}),
93
75
],
76
76
+
}),
94
77
}),
95
95
-
}),
78
78
+
)),
79
79
+
],
96
80
],
97
97
-
});
81
81
+
}),
82
82
+
Widget.Separator(),
83
83
+
Widget.Button({
84
84
+
on_clicked: () =>
85
85
+
Applications.query("nm-connection-editor")?.[0].launch(),
86
86
+
child: Widget.Box({
87
87
+
children: [Widget.Icon(icons.ui.settings), Widget.Label("Network")],
88
88
+
}),
89
89
+
}),
90
90
+
],
91
91
+
});
+45
-50
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Theme.js
···
6
6
import { setTheme, openSettings } from "../../../settings/theme.js";
7
7
8
8
export const ThemeToggle = () =>
9
9
-
ArrowToggleButton({
10
10
-
name: "theme",
11
11
-
icon: Widget.Label({ binds: [["label", options.theme.icon]] }),
12
12
-
label: Widget.Label({ binds: [["label", options.theme.name]] }),
13
13
-
connection: [opened, () => opened.value === "theme"],
14
14
-
activate: () => opened.setValue("theme"),
15
15
-
activateOnArrow: false,
16
16
-
deactivate: () => {},
17
17
-
});
9
9
+
ArrowToggleButton({
10
10
+
name: "theme",
11
11
+
icon: Widget.Label({ binds: [["label", options.theme.icon]] }),
12
12
+
label: Widget.Label({ binds: [["label", options.theme.name]] }),
13
13
+
connection: [opened, () => opened.value === "theme"],
14
14
+
activate: () => opened.setValue("theme"),
15
15
+
activateOnArrow: false,
16
16
+
deactivate: () => {},
17
17
+
});
18
18
19
19
export const ThemeSelector = () =>
20
20
-
Menu({
21
21
-
name: "theme",
22
22
-
icon: Widget.Label({
23
23
-
binds: [["label", options.theme.icon]],
20
20
+
Menu({
21
21
+
name: "theme",
22
22
+
icon: Widget.Label({
23
23
+
binds: [["label", options.theme.icon]],
24
24
+
}),
25
25
+
content: [
26
26
+
...themes.map(({ name, icon }) =>
27
27
+
Widget.Button({
28
28
+
on_clicked: () => setTheme(name),
29
29
+
child: Widget.Box({
30
30
+
children: [
31
31
+
Widget.Label(icon),
32
32
+
Widget.Label(name),
33
33
+
Widget.Icon({
34
34
+
icon: icons.tick,
35
35
+
hexpand: true,
36
36
+
hpack: "end",
37
37
+
binds: [
38
38
+
["visible", options.theme.name, "value", (v) => v === name],
39
39
+
],
40
40
+
}),
41
41
+
],
42
42
+
}),
43
43
+
}),
44
44
+
),
45
45
+
Widget.Separator(),
46
46
+
Widget.Button({
47
47
+
on_clicked: openSettings,
48
48
+
child: Widget.Box({
49
49
+
children: [
50
50
+
Widget.Icon(icons.ui.settings),
51
51
+
Widget.Label("Theme Settings"),
52
52
+
],
24
53
}),
25
25
-
content: [
26
26
-
...themes.map(({ name, icon }) =>
27
27
-
Widget.Button({
28
28
-
on_clicked: () => setTheme(name),
29
29
-
child: Widget.Box({
30
30
-
children: [
31
31
-
Widget.Label(icon),
32
32
-
Widget.Label(name),
33
33
-
Widget.Icon({
34
34
-
icon: icons.tick,
35
35
-
hexpand: true,
36
36
-
hpack: "end",
37
37
-
binds: [
38
38
-
[
39
39
-
"visible",
40
40
-
options.theme.name,
41
41
-
"value",
42
42
-
(v) => v === name,
43
43
-
],
44
44
-
],
45
45
-
}),
46
46
-
],
47
47
-
}),
48
48
-
}),
49
49
-
),
50
50
-
Widget.Separator(),
51
51
-
Widget.Button({
52
52
-
on_clicked: openSettings,
53
53
-
child: Widget.Box({
54
54
-
children: [
55
55
-
Widget.Icon(icons.ui.settings),
56
56
-
Widget.Label("Theme Settings"),
57
57
-
],
58
58
-
}),
59
59
-
}),
60
60
-
],
61
61
-
});
54
54
+
}),
55
55
+
],
56
56
+
});
+164
-169
home/isabel/programs/configs/gui/bars/ags/config/windows/quicksettings/widgets/Volume.js
···
8
8
9
9
/** @param {'speaker' | 'microphone'=} type */
10
10
const VolumeIndicator = (type = "speaker") =>
11
11
-
Widget.Button({
12
12
-
on_clicked: () => (Audio[type].is_muted = !Audio[type].is_muted),
13
13
-
child: Widget.Icon({
14
14
-
connections: [
15
15
-
[
16
16
-
Audio,
17
17
-
(icon) => {
18
18
-
if (!Audio[type]) return;
11
11
+
Widget.Button({
12
12
+
on_clicked: () => (Audio[type].is_muted = !Audio[type].is_muted),
13
13
+
child: Widget.Icon({
14
14
+
connections: [
15
15
+
[
16
16
+
Audio,
17
17
+
(icon) => {
18
18
+
if (!Audio[type]) return;
19
19
20
20
-
icon.icon =
21
21
-
type === "speaker"
22
22
-
? getAudioTypeIcon(Audio[type].icon_name || "")
23
23
-
: icons.audio.mic.high;
20
20
+
icon.icon =
21
21
+
type === "speaker"
22
22
+
? getAudioTypeIcon(Audio[type].icon_name || "")
23
23
+
: icons.audio.mic.high;
24
24
25
25
-
icon.tooltip_text = `Volume ${Math.floor(
26
26
-
Audio[type].volume * 100,
27
27
-
)}%`;
28
28
-
},
29
29
-
`${type}-changed`,
30
30
-
],
31
31
-
],
32
32
-
}),
33
33
-
});
25
25
+
icon.tooltip_text = `Volume ${Math.floor(
26
26
+
Audio[type].volume * 100,
27
27
+
)}%`;
28
28
+
},
29
29
+
`${type}-changed`,
30
30
+
],
31
31
+
],
32
32
+
}),
33
33
+
});
34
34
35
35
/** @param {'speaker' | 'microphone'=} type */
36
36
const VolumeSlider = (type = "speaker") =>
37
37
-
Widget.Slider({
38
38
-
hexpand: true,
39
39
-
draw_value: false,
40
40
-
on_change: ({ value }) => (Audio[type].volume = value),
41
41
-
connections: [
42
42
-
[
43
43
-
Audio,
44
44
-
(slider) => {
45
45
-
slider.value = Audio[type]?.volume;
46
46
-
},
47
47
-
`${type}-changed`,
48
48
-
],
49
49
-
],
50
50
-
});
37
37
+
Widget.Slider({
38
38
+
hexpand: true,
39
39
+
draw_value: false,
40
40
+
on_change: ({ value }) => (Audio[type].volume = value),
41
41
+
connections: [
42
42
+
[
43
43
+
Audio,
44
44
+
(slider) => {
45
45
+
slider.value = Audio[type]?.volume;
46
46
+
},
47
47
+
`${type}-changed`,
48
48
+
],
49
49
+
],
50
50
+
});
51
51
52
52
export const Volume = () =>
53
53
-
Widget.Box({
54
54
-
children: [
55
55
-
VolumeIndicator("speaker"),
56
56
-
VolumeSlider("speaker"),
57
57
-
Widget.Box({
58
58
-
vpack: "center",
59
59
-
child: Arrow("sink-selector"),
60
60
-
}),
61
61
-
Widget.Box({
62
62
-
vpack: "center",
63
63
-
child: Arrow("app-mixer"),
64
64
-
connections: [
65
65
-
[
66
66
-
Audio,
67
67
-
(box) => {
68
68
-
box.visible = Audio.apps.length > 0;
69
69
-
},
70
70
-
],
71
71
-
],
72
72
-
}),
53
53
+
Widget.Box({
54
54
+
children: [
55
55
+
VolumeIndicator("speaker"),
56
56
+
VolumeSlider("speaker"),
57
57
+
Widget.Box({
58
58
+
vpack: "center",
59
59
+
child: Arrow("sink-selector"),
60
60
+
}),
61
61
+
Widget.Box({
62
62
+
vpack: "center",
63
63
+
child: Arrow("app-mixer"),
64
64
+
connections: [
65
65
+
[
66
66
+
Audio,
67
67
+
(box) => {
68
68
+
box.visible = Audio.apps.length > 0;
69
69
+
},
70
70
+
],
73
71
],
74
74
-
});
72
72
+
}),
73
73
+
],
74
74
+
});
75
75
76
76
export const Microhone = () =>
77
77
-
Widget.Box({
78
78
-
class_name: "slider horizontal",
79
79
-
binds: [["visible", Audio, "recorders", (r) => r.length > 0]],
80
80
-
children: [VolumeIndicator("microphone"), VolumeSlider("microphone")],
81
81
-
});
77
77
+
Widget.Box({
78
78
+
class_name: "slider horizontal",
79
79
+
binds: [["visible", Audio, "recorders", (r) => r.length > 0]],
80
80
+
children: [VolumeIndicator("microphone"), VolumeSlider("microphone")],
81
81
+
});
82
82
83
83
/** @param {import('types/service/audio').Stream} stream */
84
84
const MixerItem = (stream) =>
85
85
-
Widget.Box({
86
86
-
hexpand: true,
87
87
-
class_name: "mixer-item horizontal",
85
85
+
Widget.Box({
86
86
+
hexpand: true,
87
87
+
class_name: "mixer-item horizontal",
88
88
+
children: [
89
89
+
Widget.Icon({
90
90
+
binds: [["tooltipText", stream, "name"]],
91
91
+
connections: [
92
92
+
[
93
93
+
stream,
94
94
+
(icon) => {
95
95
+
icon.icon = Utils.lookUpIcon(stream.name || "")
96
96
+
? stream.name || ""
97
97
+
: icons.mpris.fallback;
98
98
+
},
99
99
+
],
100
100
+
],
101
101
+
}),
102
102
+
Widget.Box({
103
103
+
vertical: true,
88
104
children: [
89
89
-
Widget.Icon({
90
90
-
binds: [["tooltipText", stream, "name"]],
91
91
-
connections: [
92
92
-
[
93
93
-
stream,
94
94
-
(icon) => {
95
95
-
icon.icon = Utils.lookUpIcon(stream.name || "")
96
96
-
? stream.name || ""
97
97
-
: icons.mpris.fallback;
98
98
-
},
99
99
-
],
100
100
-
],
101
101
-
}),
102
102
-
Widget.Box({
103
103
-
vertical: true,
104
104
-
children: [
105
105
-
Widget.Label({
106
106
-
xalign: 0,
107
107
-
truncate: "end",
108
108
-
binds: [["label", stream, "description"]],
109
109
-
}),
110
110
-
Widget.Slider({
111
111
-
hexpand: true,
112
112
-
draw_value: false,
113
113
-
binds: [["value", stream, "volume"]],
114
114
-
on_change: ({ value }) => (stream.volume = value),
115
115
-
}),
116
116
-
],
117
117
-
}),
118
118
-
Widget.Label({
119
119
-
xalign: 1,
120
120
-
connections: [
121
121
-
[
122
122
-
stream,
123
123
-
(l) => {
124
124
-
l.label = `${Math.floor(stream.volume * 100)}%`;
125
125
-
},
126
126
-
],
127
127
-
],
128
128
-
}),
105
105
+
Widget.Label({
106
106
+
xalign: 0,
107
107
+
truncate: "end",
108
108
+
binds: [["label", stream, "description"]],
109
109
+
}),
110
110
+
Widget.Slider({
111
111
+
hexpand: true,
112
112
+
draw_value: false,
113
113
+
binds: [["value", stream, "volume"]],
114
114
+
on_change: ({ value }) => (stream.volume = value),
115
115
+
}),
116
116
+
],
117
117
+
}),
118
118
+
Widget.Label({
119
119
+
xalign: 1,
120
120
+
connections: [
121
121
+
[
122
122
+
stream,
123
123
+
(l) => {
124
124
+
l.label = `${Math.floor(stream.volume * 100)}%`;
125
125
+
},
126
126
+
],
129
127
],
130
130
-
});
128
128
+
}),
129
129
+
],
130
130
+
});
131
131
132
132
/** @param {import('types/service/audio').Stream} stream */
133
133
const SinkItem = (stream) =>
134
134
-
Widget.Button({
135
135
-
hexpand: true,
136
136
-
on_clicked: () => (Audio.speaker = stream),
137
137
-
child: Widget.Box({
138
138
-
children: [
139
139
-
Widget.Icon({
140
140
-
icon: getAudioTypeIcon(stream.icon_name || ""),
141
141
-
tooltip_text: stream.icon_name,
142
142
-
}),
143
143
-
Widget.Label(
144
144
-
(stream.description || "").split(" ").slice(0, 4).join(" "),
145
145
-
),
146
146
-
Widget.Icon({
147
147
-
icon: icons.tick,
148
148
-
hexpand: true,
149
149
-
hpack: "end",
150
150
-
connections: [
151
151
-
[
152
152
-
"draw",
153
153
-
(icon) => {
154
154
-
icon.visible = Audio.speaker === stream;
155
155
-
},
156
156
-
],
157
157
-
],
158
158
-
}),
134
134
+
Widget.Button({
135
135
+
hexpand: true,
136
136
+
on_clicked: () => (Audio.speaker = stream),
137
137
+
child: Widget.Box({
138
138
+
children: [
139
139
+
Widget.Icon({
140
140
+
icon: getAudioTypeIcon(stream.icon_name || ""),
141
141
+
tooltip_text: stream.icon_name,
142
142
+
}),
143
143
+
Widget.Label(
144
144
+
(stream.description || "").split(" ").slice(0, 4).join(" "),
145
145
+
),
146
146
+
Widget.Icon({
147
147
+
icon: icons.tick,
148
148
+
hexpand: true,
149
149
+
hpack: "end",
150
150
+
connections: [
151
151
+
[
152
152
+
"draw",
153
153
+
(icon) => {
154
154
+
icon.visible = Audio.speaker === stream;
155
155
+
},
159
156
],
157
157
+
],
160
158
}),
161
161
-
});
159
159
+
],
160
160
+
}),
161
161
+
});
162
162
163
163
const SettingsButton = () =>
164
164
-
Widget.Button({
165
165
-
on_clicked: () => Utils.execAsync("pavucontrol"),
166
166
-
hexpand: true,
167
167
-
child: Widget.Box({
168
168
-
children: [
169
169
-
Widget.Icon(icons.ui.settings),
170
170
-
Widget.Label("Settings"),
171
171
-
],
172
172
-
}),
173
173
-
});
164
164
+
Widget.Button({
165
165
+
on_clicked: () => Utils.execAsync("pavucontrol"),
166
166
+
hexpand: true,
167
167
+
child: Widget.Box({
168
168
+
children: [Widget.Icon(icons.ui.settings), Widget.Label("Settings")],
169
169
+
}),
170
170
+
});
174
171
175
172
export const AppMixer = () =>
176
176
-
Menu({
177
177
-
name: "app-mixer",
178
178
-
icon: FontIcon(icons.audio.mixer),
179
179
-
title: Widget.Label("App Mixer"),
180
180
-
content: [
181
181
-
Widget.Box({
182
182
-
vertical: true,
183
183
-
binds: [["children", Audio, "apps", (a) => a.map(MixerItem)]],
184
184
-
}),
185
185
-
Widget.Separator(),
186
186
-
SettingsButton(),
187
187
-
],
188
188
-
});
173
173
+
Menu({
174
174
+
name: "app-mixer",
175
175
+
icon: FontIcon(icons.audio.mixer),
176
176
+
title: Widget.Label("App Mixer"),
177
177
+
content: [
178
178
+
Widget.Box({
179
179
+
vertical: true,
180
180
+
binds: [["children", Audio, "apps", (a) => a.map(MixerItem)]],
181
181
+
}),
182
182
+
Widget.Separator(),
183
183
+
SettingsButton(),
184
184
+
],
185
185
+
});
189
186
190
187
export const SinkSelector = () =>
191
191
-
Menu({
192
192
-
name: "sink-selector",
193
193
-
icon: Widget.Icon(icons.audio.type.headset),
194
194
-
title: Widget.Label("Sink Selector"),
195
195
-
content: [
196
196
-
Widget.Box({
197
197
-
vertical: true,
198
198
-
binds: [
199
199
-
["children", Audio, "speakers", (s) => s.map(SinkItem)],
200
200
-
],
201
201
-
}),
202
202
-
Widget.Separator(),
203
203
-
SettingsButton(),
204
204
-
],
205
205
-
});
188
188
+
Menu({
189
189
+
name: "sink-selector",
190
190
+
icon: Widget.Icon(icons.audio.type.headset),
191
191
+
title: Widget.Label("Sink Selector"),
192
192
+
content: [
193
193
+
Widget.Box({
194
194
+
vertical: true,
195
195
+
binds: [["children", Audio, "speakers", (s) => s.map(SinkItem)]],
196
196
+
}),
197
197
+
Widget.Separator(),
198
198
+
SettingsButton(),
199
199
+
],
200
200
+
});
+1
-1
home/isabel/programs/configs/gui/bars/eww/config/eww.scss
···
26
26
@import "./scss/windows/screenshot.scss";
27
27
28
28
tooltip {
29
29
-
@include tooltip;
29
29
+
@include tooltip;
30
30
}
+96
-97
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/apps.js
···
3
3
import { Gio, GObject, Gtk } from "./lib.js";
4
4
5
5
export const Apps = GObject.registerClass(
6
6
-
{
7
7
-
Signals: { sync: {} },
8
8
-
},
9
9
-
class Apps extends GObject.Object {
10
10
-
constructor() {
11
11
-
super();
6
6
+
{
7
7
+
Signals: { sync: {} },
8
8
+
},
9
9
+
class Apps extends GObject.Object {
10
10
+
constructor() {
11
11
+
super();
12
12
13
13
-
this._register();
14
14
-
}
13
13
+
this._register();
14
14
+
}
15
15
16
16
-
get json() {
17
17
-
return this._list;
18
18
-
}
16
16
+
get json() {
17
17
+
return this._list;
18
18
+
}
19
19
20
20
-
_iconPath(icon) {
21
21
-
return APPICON_CACHE_PATH + icon + ".png";
22
22
-
}
20
20
+
_iconPath(icon) {
21
21
+
return APPICON_CACHE_PATH + icon + ".png";
22
22
+
}
23
23
24
24
-
init() {
25
25
-
this._initIcons();
26
26
-
this.Query("");
27
27
-
}
24
24
+
init() {
25
25
+
this._initIcons();
26
26
+
this.Query("");
27
27
+
}
28
28
29
29
-
_initIcons() {
30
30
-
MkDirectory();
31
31
-
let icons = [];
32
32
-
Gio.AppInfo.get_all().forEach((app) => {
33
33
-
if (!app.should_show() || !app.get_icon()) return;
34
34
-
if (typeof app.get_icon().get_names !== "function") return;
35
35
-
app?.get_icon()
36
36
-
?.get_names()
37
37
-
.forEach((icon) => icons.push(icon));
38
38
-
});
29
29
+
_initIcons() {
30
30
+
MkDirectory();
31
31
+
let icons = [];
32
32
+
Gio.AppInfo.get_all().forEach((app) => {
33
33
+
if (!app.should_show() || !app.get_icon()) return;
34
34
+
if (typeof app.get_icon().get_names !== "function") return;
35
35
+
app
36
36
+
?.get_icon()
37
37
+
?.get_names()
38
38
+
.forEach((icon) => icons.push(icon));
39
39
+
});
39
40
40
40
-
icons.forEach((icon) => {
41
41
-
if (icon.includes("-symbolic")) return;
42
42
-
let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon(
43
43
-
Gio.Icon.new_for_string(icon),
44
44
-
128,
45
45
-
null,
46
46
-
);
41
41
+
icons.forEach((icon) => {
42
42
+
if (icon.includes("-symbolic")) return;
43
43
+
let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon(
44
44
+
Gio.Icon.new_for_string(icon),
45
45
+
128,
46
46
+
null,
47
47
+
);
47
48
48
48
-
if (!iconInfo) return;
49
49
+
if (!iconInfo) return;
49
50
50
50
-
let output_stream = Gio.File.new_for_path(
51
51
-
this._iconPath(icon),
52
52
-
).replace(null, false, Gio.FileCreateFlags.NONE, null);
51
51
+
let output_stream = Gio.File.new_for_path(this._iconPath(icon)).replace(
52
52
+
null,
53
53
+
false,
54
54
+
Gio.FileCreateFlags.NONE,
55
55
+
null,
56
56
+
);
53
57
54
54
-
iconInfo
55
55
-
.load_icon()
56
56
-
.save_to_streamv(output_stream, "png", null, null, null);
58
58
+
iconInfo
59
59
+
.load_icon()
60
60
+
.save_to_streamv(output_stream, "png", null, null, null);
57
61
58
58
-
output_stream.close(null);
59
59
-
});
60
60
-
}
62
62
+
output_stream.close(null);
63
63
+
});
64
64
+
}
61
65
62
62
-
_appIconName(app) {
63
63
-
if (!app.get_icon()) return "";
66
66
+
_appIconName(app) {
67
67
+
if (!app.get_icon()) return "";
64
68
65
65
-
if (typeof app.get_icon().get_names !== "function") return "";
69
69
+
if (typeof app.get_icon().get_names !== "function") return "";
66
70
67
67
-
let name = app.get_icon().get_names()[0];
68
68
-
return name ? this._iconPath(name) : "";
69
69
-
}
71
71
+
let name = app.get_icon().get_names()[0];
72
72
+
return name ? this._iconPath(name) : "";
73
73
+
}
70
74
71
71
-
Query(search) {
72
72
-
let apps = Gio.AppInfo.get_all();
73
73
-
let list = [];
74
74
-
apps.forEach((app) => {
75
75
-
if (!app.should_show()) return;
76
76
-
if (app.get_name()?.toLowerCase().includes(search))
77
77
-
list.push(app);
78
78
-
else if (app.get_id()?.toLowerCase().includes(search))
79
79
-
list.push(app);
80
80
-
else if (app.get_executable()?.toLowerCase().includes(search))
81
81
-
list.push(app);
82
82
-
else if (app.get_description()?.toLowerCase().includes(search))
83
83
-
list.push(app);
84
84
-
});
75
75
+
Query(search) {
76
76
+
let apps = Gio.AppInfo.get_all();
77
77
+
let list = [];
78
78
+
apps.forEach((app) => {
79
79
+
if (!app.should_show()) return;
80
80
+
if (app.get_name()?.toLowerCase().includes(search)) list.push(app);
81
81
+
else if (app.get_id()?.toLowerCase().includes(search)) list.push(app);
82
82
+
else if (app.get_executable()?.toLowerCase().includes(search))
83
83
+
list.push(app);
84
84
+
else if (app.get_description()?.toLowerCase().includes(search))
85
85
+
list.push(app);
86
86
+
});
85
87
86
86
-
let outList = [];
87
87
-
list.forEach((app) => {
88
88
-
outList.push({
89
89
-
name: app.get_name(),
90
90
-
desktop: app.get_id(),
91
91
-
description: app.get_description(),
92
92
-
icon: this._appIconName(app),
93
93
-
});
94
94
-
});
95
95
-
this._list = outList;
96
96
-
this.emit("sync");
97
97
-
}
88
88
+
let outList = [];
89
89
+
list.forEach((app) => {
90
90
+
outList.push({
91
91
+
name: app.get_name(),
92
92
+
desktop: app.get_id(),
93
93
+
description: app.get_description(),
94
94
+
icon: this._appIconName(app),
95
95
+
});
96
96
+
});
97
97
+
this._list = outList;
98
98
+
this.emit("sync");
99
99
+
}
98
100
99
99
-
_register() {
100
100
-
Gio.bus_own_name(
101
101
-
Gio.BusType.SESSION,
102
102
-
"com.github.isabel.host",
103
103
-
Gio.BusNameOwnerFlags.NONE,
104
104
-
(connection, _) => {
105
105
-
this._dbus = Gio.DBusExportedObject.wrapJSObject(
106
106
-
ApplicationsIFace,
107
107
-
this,
108
108
-
);
109
109
-
this._dbus.export(
110
110
-
connection,
111
111
-
"/com/github/isabel/applications",
112
112
-
);
113
113
-
},
114
114
-
null,
115
115
-
null,
116
116
-
);
117
117
-
}
118
118
-
},
101
101
+
_register() {
102
102
+
Gio.bus_own_name(
103
103
+
Gio.BusType.SESSION,
104
104
+
"com.github.isabel.host",
105
105
+
Gio.BusNameOwnerFlags.NONE,
106
106
+
(connection, _) => {
107
107
+
this._dbus = Gio.DBusExportedObject.wrapJSObject(
108
108
+
ApplicationsIFace,
109
109
+
this,
110
110
+
);
111
111
+
this._dbus.export(connection, "/com/github/isabel/applications");
112
112
+
},
113
113
+
null,
114
114
+
null,
115
115
+
);
116
116
+
}
117
117
+
},
119
118
);
+50
-64
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/battery.js
···
2
2
import { PowerManagerProxy } from "./dbus.js";
3
3
4
4
export const Battery = GObject.registerClass(
5
5
-
{
6
6
-
Signals: { sync: {} },
7
7
-
},
8
8
-
class Battery extends GObject.Object {
9
9
-
constructor() {
10
10
-
super();
5
5
+
{
6
6
+
Signals: { sync: {} },
7
7
+
},
8
8
+
class Battery extends GObject.Object {
9
9
+
constructor() {
10
10
+
super();
11
11
12
12
-
this._json = {};
13
13
-
this._proxy = new PowerManagerProxy(
14
14
-
Gio.DBus.system,
15
15
-
"org.freedesktop.UPower",
16
16
-
"/org/freedesktop/UPower/devices/DisplayDevice",
17
17
-
() => {
18
18
-
this._proxy.connect("g-properties-changed", () =>
19
19
-
this._sync(),
20
20
-
);
21
21
-
this._sync();
22
22
-
},
23
23
-
);
24
24
-
}
12
12
+
this._json = {};
13
13
+
this._proxy = new PowerManagerProxy(
14
14
+
Gio.DBus.system,
15
15
+
"org.freedesktop.UPower",
16
16
+
"/org/freedesktop/UPower/devices/DisplayDevice",
17
17
+
() => {
18
18
+
this._proxy.connect("g-properties-changed", () => this._sync());
19
19
+
this._sync();
20
20
+
},
21
21
+
);
22
22
+
}
25
23
26
26
-
get json() {
27
27
-
return this._json;
28
28
-
}
24
24
+
get json() {
25
25
+
return this._json;
26
26
+
}
29
27
30
30
-
_sync() {
31
31
-
if (!this._proxy.IsPresent) return { available: false };
28
28
+
_sync() {
29
29
+
if (!this._proxy.IsPresent) return { available: false };
32
30
33
33
-
let percent = this._proxy.Percentage;
34
34
-
let charging =
35
35
-
this._proxy.State === UPowerGlib.DeviceState.CHARGING;
36
36
-
let charged =
37
37
-
this._proxy.State === UPowerGlib.DeviceState.FULLY_CHARGED ||
38
38
-
(this._proxy.State === UPowerGlib.DeviceState.CHARGING &&
39
39
-
percent === 100);
31
31
+
let percent = this._proxy.Percentage;
32
32
+
let charging = this._proxy.State === UPowerGlib.DeviceState.CHARGING;
33
33
+
let charged =
34
34
+
this._proxy.State === UPowerGlib.DeviceState.FULLY_CHARGED ||
35
35
+
(this._proxy.State === UPowerGlib.DeviceState.CHARGING &&
36
36
+
percent === 100);
40
37
41
41
-
let icons = ["", "", "", "", "", "", "", "", "", ""];
42
42
-
let charging_icons = [
43
43
-
"",
44
44
-
"",
45
45
-
"",
46
46
-
"",
47
47
-
"",
48
48
-
"",
49
49
-
"",
50
50
-
"",
51
51
-
"",
52
52
-
"",
53
53
-
];
54
54
-
let i = Math.round(percent / 10) - 1;
55
55
-
if (i < 0) i = 0;
38
38
+
let icons = ["", "", "", "", "", "", "", "", "", ""];
39
39
+
let charging_icons = ["", "", "", "", "", "", "", "", "", ""];
40
40
+
let i = Math.round(percent / 10) - 1;
41
41
+
if (i < 0) i = 0;
56
42
57
57
-
let icon;
58
58
-
if (charged) icon = "";
59
59
-
else if (charging) icon = charging_icons[i];
60
60
-
else if (percent < 10) icon = "";
61
61
-
else icon = icons[i];
43
43
+
let icon;
44
44
+
if (charged) icon = "";
45
45
+
else if (charging) icon = charging_icons[i];
46
46
+
else if (percent < 10) icon = "";
47
47
+
else icon = icons[i];
62
48
63
63
-
let state = "";
64
64
-
if (charged) state = "charged";
65
65
-
else if (charging) state = "charging";
66
66
-
else if (percent < 30) state = "low";
49
49
+
let state = "";
50
50
+
if (charged) state = "charged";
51
51
+
else if (charging) state = "charging";
52
52
+
else if (percent < 30) state = "low";
67
53
68
68
-
this._json = {
69
69
-
available: true,
70
70
-
icon,
71
71
-
percent,
72
72
-
state,
73
73
-
};
74
74
-
this.emit("sync");
75
75
-
}
76
76
-
},
54
54
+
this._json = {
55
55
+
available: true,
56
56
+
icon,
57
57
+
percent,
58
58
+
state,
59
59
+
};
60
60
+
this.emit("sync");
61
61
+
}
62
62
+
},
77
63
);
+94
-99
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/bluetooth.js
···
1
1
import { GObject, GnomeBluetooth } from "./lib.js";
2
2
3
3
const STATES = {
4
4
-
[GnomeBluetooth.AdapterState.ABSENT]: "absent",
5
5
-
[GnomeBluetooth.AdapterState.ON]: "on",
6
6
-
[GnomeBluetooth.AdapterState.TURNING_ON]: "on",
7
7
-
[GnomeBluetooth.AdapterState.OFF]: "off",
8
8
-
[GnomeBluetooth.AdapterState.TURNING_OFF]: "off",
4
4
+
[GnomeBluetooth.AdapterState.ABSENT]: "absent",
5
5
+
[GnomeBluetooth.AdapterState.ON]: "on",
6
6
+
[GnomeBluetooth.AdapterState.TURNING_ON]: "on",
7
7
+
[GnomeBluetooth.AdapterState.OFF]: "off",
8
8
+
[GnomeBluetooth.AdapterState.TURNING_OFF]: "off",
9
9
};
10
10
11
11
const ICONS = {
12
12
-
absent: "",
13
13
-
off: "",
14
14
-
on: "",
15
15
-
"audio-headset": "",
12
12
+
absent: "",
13
13
+
off: "",
14
14
+
on: "",
15
15
+
"audio-headset": "",
16
16
};
17
17
18
18
export const Bluetooth = GObject.registerClass(
19
19
-
{
20
20
-
Signals: { sync: {} },
21
21
-
},
22
22
-
class Bluetooth extends GObject.Object {
23
23
-
constructor() {
24
24
-
super();
19
19
+
{
20
20
+
Signals: { sync: {} },
21
21
+
},
22
22
+
class Bluetooth extends GObject.Object {
23
23
+
constructor() {
24
24
+
super();
25
25
26
26
-
this._json = {};
27
27
-
this._devices = new Map();
28
28
-
this._connections = new Map();
29
29
-
this._client = new GnomeBluetooth.Client();
30
30
-
this._client.connect(
31
31
-
"notify::default-adapter-state",
32
32
-
this._sync.bind(this),
33
33
-
);
34
34
-
this._client.connect("device-added", this._deviceAdded.bind(this));
35
35
-
this._client.connect(
36
36
-
"device-removed",
37
37
-
this._deviceRemoved.bind(this),
38
38
-
);
39
39
-
this._getDevices().forEach((device) =>
40
40
-
this._deviceAdded(_, device),
41
41
-
);
42
42
-
this._sync();
43
43
-
}
26
26
+
this._json = {};
27
27
+
this._devices = new Map();
28
28
+
this._connections = new Map();
29
29
+
this._client = new GnomeBluetooth.Client();
30
30
+
this._client.connect(
31
31
+
"notify::default-adapter-state",
32
32
+
this._sync.bind(this),
33
33
+
);
34
34
+
this._client.connect("device-added", this._deviceAdded.bind(this));
35
35
+
this._client.connect("device-removed", this._deviceRemoved.bind(this));
36
36
+
this._getDevices().forEach((device) => this._deviceAdded(_, device));
37
37
+
this._sync();
38
38
+
}
44
39
45
45
-
get json() {
46
46
-
return this._json;
47
47
-
}
40
40
+
get json() {
41
41
+
return this._json;
42
42
+
}
48
43
49
49
-
_deviceAdded(_, device) {
50
50
-
if (this._devices.has(device.address)) return;
44
44
+
_deviceAdded(_, device) {
45
45
+
if (this._devices.has(device.address)) return;
51
46
52
52
-
let connections = [];
53
53
-
[
54
54
-
"address",
55
55
-
"alias",
56
56
-
"battery-level",
57
57
-
"battery-percentage",
58
58
-
"connected",
59
59
-
"icon",
60
60
-
"name",
61
61
-
"paired",
62
62
-
"truested",
63
63
-
].forEach((prop) =>
64
64
-
connections.push(
65
65
-
device.connect(`notify::${prop}`, this._sync.bind(this)),
66
66
-
),
67
67
-
);
68
68
-
this._connections.set(device.address, connections);
47
47
+
let connections = [];
48
48
+
[
49
49
+
"address",
50
50
+
"alias",
51
51
+
"battery-level",
52
52
+
"battery-percentage",
53
53
+
"connected",
54
54
+
"icon",
55
55
+
"name",
56
56
+
"paired",
57
57
+
"truested",
58
58
+
].forEach((prop) =>
59
59
+
connections.push(
60
60
+
device.connect(`notify::${prop}`, this._sync.bind(this)),
61
61
+
),
62
62
+
);
63
63
+
this._connections.set(device.address, connections);
69
64
70
70
-
this._devices.set(device.address, device);
71
71
-
this._sync();
72
72
-
}
65
65
+
this._devices.set(device.address, device);
66
66
+
this._sync();
67
67
+
}
73
68
74
74
-
_deviceRemoved(_, device) {
75
75
-
if (!this._devices.has(device.address)) return;
69
69
+
_deviceRemoved(_, device) {
70
70
+
if (!this._devices.has(device.address)) return;
76
71
77
77
-
this._connections
78
78
-
.get(device.address)
79
79
-
.forEach((id) => device.disconnect(id));
80
80
-
this._connections.delete(device.address);
81
81
-
this._devices.delete(device.address);
82
82
-
this._sync();
83
83
-
}
72
72
+
this._connections
73
73
+
.get(device.address)
74
74
+
.forEach((id) => device.disconnect(id));
75
75
+
this._connections.delete(device.address);
76
76
+
this._devices.delete(device.address);
77
77
+
this._sync();
78
78
+
}
84
79
85
85
-
_getDevices() {
86
86
-
let devices = [];
87
87
-
const deviceStore = this._client.get_devices();
80
80
+
_getDevices() {
81
81
+
let devices = [];
82
82
+
const deviceStore = this._client.get_devices();
88
83
89
89
-
for (let i = 0; i < deviceStore.get_n_items(); ++i) {
90
90
-
const device = deviceStore.get_item(i);
84
84
+
for (let i = 0; i < deviceStore.get_n_items(); ++i) {
85
85
+
const device = deviceStore.get_item(i);
91
86
92
92
-
if (device.paired || device.trusted) devices.push(device);
93
93
-
}
87
87
+
if (device.paired || device.trusted) devices.push(device);
88
88
+
}
94
89
95
95
-
return devices;
96
96
-
}
90
90
+
return devices;
91
91
+
}
97
92
98
98
-
_sync() {
99
99
-
this._json.state = STATES[this._client.default_adapter_state];
100
100
-
this._json.icon = ICONS[this._json.state];
101
101
-
this._json.connected_devices = [];
102
102
-
this._json.devices = [];
103
103
-
for (const [_, device] of this._devices) {
104
104
-
let item = {
105
105
-
address: device.address,
106
106
-
alias: device.alias,
107
107
-
battery_level: device.battery_level,
108
108
-
battery_percentage: device.battery_percentage,
109
109
-
connected: device.connected,
110
110
-
icon: ICONS[device.icon],
111
111
-
name: device.name,
112
112
-
paired: device.paired,
113
113
-
trusted: device.trusted,
114
114
-
};
115
115
-
this._json.devices.push(item);
116
116
-
if (device.connected) this._json.connected_devices.push(item);
117
117
-
}
93
93
+
_sync() {
94
94
+
this._json.state = STATES[this._client.default_adapter_state];
95
95
+
this._json.icon = ICONS[this._json.state];
96
96
+
this._json.connected_devices = [];
97
97
+
this._json.devices = [];
98
98
+
for (const [_, device] of this._devices) {
99
99
+
let item = {
100
100
+
address: device.address,
101
101
+
alias: device.alias,
102
102
+
battery_level: device.battery_level,
103
103
+
battery_percentage: device.battery_percentage,
104
104
+
connected: device.connected,
105
105
+
icon: ICONS[device.icon],
106
106
+
name: device.name,
107
107
+
paired: device.paired,
108
108
+
trusted: device.trusted,
109
109
+
};
110
110
+
this._json.devices.push(item);
111
111
+
if (device.connected) this._json.connected_devices.push(item);
112
112
+
}
118
113
119
119
-
this.emit("sync");
120
120
-
}
121
121
-
},
114
114
+
this.emit("sync");
115
115
+
}
116
116
+
},
122
117
);
+3
-3
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/dbus.js
···
1
1
import { Gio } from "./lib.js";
2
2
3
3
export const MprisPlayerProxy = Gio.DBusProxy.makeProxyWrapper(
4
4
-
`<node>
4
4
+
`<node>
5
5
<interface name="org.mpris.MediaPlayer2.Player">
6
6
<property name='CanControl' type='b' access='read' />
7
7
<property name='CanGoNext' type='b' access='read' />
···
19
19
);
20
20
21
21
export const DBusProxy = Gio.DBusProxy.makeProxyWrapper(
22
22
-
`<node>
22
22
+
`<node>
23
23
<interface name="org.freedesktop.DBus">
24
24
<method name="ListNames">
25
25
<arg type="as" direction="out" name="names"/>
···
34
34
);
35
35
36
36
export const PowerManagerProxy = Gio.DBusProxy.makeProxyWrapper(
37
37
-
`<node>
37
37
+
`<node>
38
38
<interface name="org.freedesktop.UPower.Device">
39
39
<property name="State" type="u" access="read"/>
40
40
<property name="Percentage" type="d" access="read"/>
+8
-8
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/lib.js
···
8
8
imports.gi.versions.GdkPixbuf = "2.0";
9
9
10
10
export const {
11
11
-
Gtk,
12
12
-
Gio,
13
13
-
GLib,
14
14
-
GObject,
15
15
-
UPowerGlib,
16
16
-
GnomeBluetooth,
17
17
-
NM,
18
18
-
GdkPixbuf,
11
11
+
Gtk,
12
12
+
Gio,
13
13
+
GLib,
14
14
+
GObject,
15
15
+
UPowerGlib,
16
16
+
GnomeBluetooth,
17
17
+
NM,
18
18
+
GdkPixbuf,
19
19
} = imports.gi;
+112
-120
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/main.js
···
15
15
export const APPICON_CACHE_PATH = CACHE_PATH + "apps/";
16
16
17
17
export const PlayerIcons = {
18
18
-
deafult: "", //icon broken
19
19
-
spotify: "",
20
20
-
chromium: "",
21
21
-
mpv: "",
18
18
+
deafult: "", //icon broken
19
19
+
spotify: "",
20
20
+
chromium: "",
21
21
+
mpv: "",
22
22
};
23
23
24
24
export function MkDirectory() {
25
25
-
[
26
26
-
CACHE_PATH,
27
27
-
MEDIA_CACHE_PATH,
28
28
-
NOTIFICATIONS_CACHE_PATH,
29
29
-
APPICON_CACHE_PATH,
30
30
-
].forEach((path) => {
31
31
-
if (!GLib.file_test(path, GLib.FileTest.EXISTS))
32
32
-
Gio.File.new_for_path(path).make_directory(null);
33
33
-
});
25
25
+
[
26
26
+
CACHE_PATH,
27
27
+
MEDIA_CACHE_PATH,
28
28
+
NOTIFICATIONS_CACHE_PATH,
29
29
+
APPICON_CACHE_PATH,
30
30
+
].forEach((path) => {
31
31
+
if (!GLib.file_test(path, GLib.FileTest.EXISTS))
32
32
+
Gio.File.new_for_path(path).make_directory(null);
33
33
+
});
34
34
}
35
35
36
36
const App = GObject.registerClass(
37
37
-
class App extends Gtk.Application {
38
38
-
constructor({ eww, file, stdout, fg_color }) {
39
39
-
super({
40
40
-
application_id: "com.github.isabel.host",
41
41
-
flags: Gio.ApplicationFlags.DEFAULT_FLAGS,
42
42
-
});
37
37
+
class App extends Gtk.Application {
38
38
+
constructor({ eww, file, stdout, fg_color }) {
39
39
+
super({
40
40
+
application_id: "com.github.isabel.host",
41
41
+
flags: Gio.ApplicationFlags.DEFAULT_FLAGS,
42
42
+
});
43
43
44
44
-
MkDirectory();
44
44
+
MkDirectory();
45
45
46
46
-
this._eww = eww;
47
47
-
this._file = file;
48
48
-
this._stdout = stdout;
49
49
-
this._json = {};
46
46
+
this._eww = eww;
47
47
+
this._file = file;
48
48
+
this._stdout = stdout;
49
49
+
this._json = {};
50
50
51
51
-
this._notifications = new Notifications(fg_color);
52
52
-
this._battery = new Battery();
53
53
-
this._network = new Network();
54
54
-
this._bluetooth = new Bluetooth();
55
55
-
this._media = new Media();
56
56
-
this._apps = new Apps();
51
51
+
this._notifications = new Notifications(fg_color);
52
52
+
this._battery = new Battery();
53
53
+
this._network = new Network();
54
54
+
this._bluetooth = new Bluetooth();
55
55
+
this._media = new Media();
56
56
+
this._apps = new Apps();
57
57
58
58
-
this.run(null);
59
59
-
}
58
58
+
this.run(null);
59
59
+
}
60
60
61
61
-
vfunc_activate() {
62
62
-
this.hold();
61
61
+
vfunc_activate() {
62
62
+
this.hold();
63
63
64
64
-
[
65
65
-
"notifications",
66
66
-
"battery",
67
67
-
"network",
68
68
-
"bluetooth",
69
69
-
"apps",
70
70
-
"media",
71
71
-
].forEach((m) => this._output(this[`_${m}`].json, m));
64
64
+
[
65
65
+
"notifications",
66
66
+
"battery",
67
67
+
"network",
68
68
+
"bluetooth",
69
69
+
"apps",
70
70
+
"media",
71
71
+
].forEach((m) => this._output(this[`_${m}`].json, m));
72
72
73
73
-
this._notifications.connect("sync", (o) =>
74
74
-
this._output(o.json, "notifications"),
75
75
-
);
76
76
-
this._battery.connect("sync", (o) =>
77
77
-
this._output(o.json, "battery"),
78
78
-
);
79
79
-
this._network.connect("sync", (o) =>
80
80
-
this._output(o.json, "network"),
81
81
-
);
82
82
-
this._bluetooth.connect("sync", (o) =>
83
83
-
this._output(o.json, "bluetooth"),
84
84
-
);
85
85
-
this._apps.connect("sync", (o) => this._output(o.json, "apps"));
86
86
-
this._apps.init();
73
73
+
this._notifications.connect("sync", (o) =>
74
74
+
this._output(o.json, "notifications"),
75
75
+
);
76
76
+
this._battery.connect("sync", (o) => this._output(o.json, "battery"));
77
77
+
this._network.connect("sync", (o) => this._output(o.json, "network"));
78
78
+
this._bluetooth.connect("sync", (o) => this._output(o.json, "bluetooth"));
79
79
+
this._apps.connect("sync", (o) => this._output(o.json, "apps"));
80
80
+
this._apps.init();
87
81
88
88
-
this._media.connect("sync", (o) => this._output(o.json, "media"));
89
89
-
this._media.connect("positions", (o) =>
90
90
-
this._output(o.positions, "media_positions"),
91
91
-
);
92
92
-
GLib.timeout_add(GLib.PRIORITY_DEFAULT, TICK_INTERVAL, () =>
93
93
-
this._media.getPositions(),
94
94
-
);
95
95
-
}
82
82
+
this._media.connect("sync", (o) => this._output(o.json, "media"));
83
83
+
this._media.connect("positions", (o) =>
84
84
+
this._output(o.positions, "media_positions"),
85
85
+
);
86
86
+
GLib.timeout_add(GLib.PRIORITY_DEFAULT, TICK_INTERVAL, () =>
87
87
+
this._media.getPositions(),
88
88
+
);
89
89
+
}
96
90
97
97
-
_output(json, name) {
98
98
-
if (!json) return;
99
99
-
if (this._file) {
100
100
-
const file = Gio.File.new_for_path(CACHE_PATH + name + ".json");
91
91
+
_output(json, name) {
92
92
+
if (!json) return;
93
93
+
if (this._file) {
94
94
+
const file = Gio.File.new_for_path(CACHE_PATH + name + ".json");
101
95
102
102
-
if (!GLib.file_test(file.get_path(), GLib.FileTest.EXISTS))
103
103
-
file.create(Gio.FileCreateFlags.NONE, null);
96
96
+
if (!GLib.file_test(file.get_path(), GLib.FileTest.EXISTS))
97
97
+
file.create(Gio.FileCreateFlags.NONE, null);
104
98
105
105
-
file.replace_contents(
106
106
-
JSON.stringify(json, null, 2),
107
107
-
null,
108
108
-
false,
109
109
-
Gio.FileCreateFlags.REPLACE_DESTINATION,
110
110
-
null,
111
111
-
);
112
112
-
}
99
99
+
file.replace_contents(
100
100
+
JSON.stringify(json, null, 2),
101
101
+
null,
102
102
+
false,
103
103
+
Gio.FileCreateFlags.REPLACE_DESTINATION,
104
104
+
null,
105
105
+
);
106
106
+
}
113
107
114
114
-
if (this._eww) {
115
115
-
GLib.spawn_command_line_async(
116
116
-
`eww update ${name}=${JSON.stringify(
117
117
-
JSON.stringify(json),
118
118
-
)}`,
119
119
-
);
120
120
-
}
108
108
+
if (this._eww) {
109
109
+
GLib.spawn_command_line_async(
110
110
+
`eww update ${name}=${JSON.stringify(JSON.stringify(json))}`,
111
111
+
);
112
112
+
}
121
113
122
122
-
if (this._stdout) {
123
123
-
this._json[name] = json;
124
124
-
print(JSON.stringify(this._json, null, 2));
125
125
-
}
126
126
-
}
127
127
-
},
114
114
+
if (this._stdout) {
115
115
+
this._json[name] = json;
116
116
+
print(JSON.stringify(this._json, null, 2));
117
117
+
}
118
118
+
}
119
119
+
},
128
120
);
129
121
130
122
function parseArgs(argv) {
131
131
-
let args = {};
132
132
-
for (let i = 0; i < argv.length; ++i) {
133
133
-
switch (argv[i]) {
134
134
-
case "--help":
135
135
-
args.help = true;
136
136
-
break;
137
137
-
case "--eww":
138
138
-
args.eww = true;
139
139
-
break;
140
140
-
case "--file":
141
141
-
args.file = true;
142
142
-
break;
143
143
-
case "--stdout":
144
144
-
args.stdout = true;
145
145
-
break;
146
146
-
case "--fg-color":
147
147
-
args.fg_color = argv[i++];
148
148
-
break;
149
149
-
default:
150
150
-
break;
151
151
-
}
123
123
+
let args = {};
124
124
+
for (let i = 0; i < argv.length; ++i) {
125
125
+
switch (argv[i]) {
126
126
+
case "--help":
127
127
+
args.help = true;
128
128
+
break;
129
129
+
case "--eww":
130
130
+
args.eww = true;
131
131
+
break;
132
132
+
case "--file":
133
133
+
args.file = true;
134
134
+
break;
135
135
+
case "--stdout":
136
136
+
args.stdout = true;
137
137
+
break;
138
138
+
case "--fg-color":
139
139
+
args.fg_color = argv[i++];
140
140
+
break;
141
141
+
default:
142
142
+
break;
152
143
}
153
153
-
return args;
144
144
+
}
145
145
+
return args;
154
146
}
155
147
156
148
export function main(argv) {
157
157
-
let { help, eww, file, stdout, fg_color } = parseArgs(argv);
158
158
-
if ((!eww && !file && !stdout) || help) {
159
159
-
print("Usage:", argv[0], "[--eww] [--file] [--stdout]");
160
160
-
return;
161
161
-
}
162
162
-
print("Cache directory:", CACHE_PATH);
163
163
-
new App({ eww, file, stdout, fg_color });
149
149
+
let { help, eww, file, stdout, fg_color } = parseArgs(argv);
150
150
+
if ((!eww && !file && !stdout) || help) {
151
151
+
print("Usage:", argv[0], "[--eww] [--file] [--stdout]");
152
152
+
return;
153
153
+
}
154
154
+
print("Cache directory:", CACHE_PATH);
155
155
+
new App({ eww, file, stdout, fg_color });
164
156
}
+237
-251
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/media.js
···
1
1
import { MprisPlayerProxy, DBusProxy } from "./dbus.js";
2
2
import {
3
3
-
PlayerIcons,
4
4
-
PREFERRED_PLAYER,
5
5
-
MEDIA_CACHE_PATH,
6
6
-
MkDirectory,
3
3
+
PlayerIcons,
4
4
+
PREFERRED_PLAYER,
5
5
+
MEDIA_CACHE_PATH,
6
6
+
MkDirectory,
7
7
} from "./main.js";
8
8
import { GObject, Gio, GLib } from "./lib.js";
9
9
10
10
function _lengthStr(length) {
11
11
-
let min = Math.floor(length / 60);
12
12
-
let sec0 = Math.floor(length % 60) < 10 ? "0" : "";
13
13
-
let sec = Math.floor(length % 60);
14
14
-
return `${min}:${sec0}${sec}`;
11
11
+
let min = Math.floor(length / 60);
12
12
+
let sec0 = Math.floor(length % 60) < 10 ? "0" : "";
13
13
+
let sec = Math.floor(length % 60);
14
14
+
return `${min}:${sec0}${sec}`;
15
15
}
16
16
17
17
function _getName(busName) {
18
18
-
return busName.substring(23).split(".")[0];
18
18
+
return busName.substring(23).split(".")[0];
19
19
}
20
20
21
21
const MprisPlayer = GObject.registerClass(
22
22
-
{
23
23
-
Signals: { changed: {}, closed: {}, ready: {} },
24
24
-
},
25
25
-
class MprisPlayer extends GObject.Object {
26
26
-
constructor(busName) {
27
27
-
super();
22
22
+
{
23
23
+
Signals: { changed: {}, closed: {}, ready: {} },
24
24
+
},
25
25
+
class MprisPlayer extends GObject.Object {
26
26
+
constructor(busName) {
27
27
+
super();
28
28
29
29
-
this._proxy = new MprisPlayerProxy(
30
30
-
Gio.DBus.session,
31
31
-
busName,
32
32
-
"/org/mpris/MediaPlayer2",
33
33
-
this._onPlayerProxyReady.bind(this),
34
34
-
);
29
29
+
this._proxy = new MprisPlayerProxy(
30
30
+
Gio.DBus.session,
31
31
+
busName,
32
32
+
"/org/mpris/MediaPlayer2",
33
33
+
this._onPlayerProxyReady.bind(this),
34
34
+
);
35
35
36
36
-
this._busName = busName;
37
37
-
this._name = _getName(busName);
38
38
-
this._playerIcon =
39
39
-
PlayerIcons?.[this._name] || PlayerIcons.deafult || "";
40
40
-
this._trackArtists = [];
41
41
-
this._trackTitle = "";
42
42
-
this._trackCoverUrl = "";
43
43
-
this._coverPath = "";
44
44
-
this._playBackStatus = "";
45
45
-
this._canGoNext = false;
46
46
-
this._canGoPrev = false;
47
47
-
this._canPlay = false;
48
48
-
this._shuffle = false;
49
49
-
this._loopStatus = "";
50
50
-
this._volume = -1;
51
51
-
this._length = -1;
52
52
-
this._position = -1;
53
53
-
}
36
36
+
this._busName = busName;
37
37
+
this._name = _getName(busName);
38
38
+
this._playerIcon = PlayerIcons?.[this._name] || PlayerIcons.deafult || "";
39
39
+
this._trackArtists = [];
40
40
+
this._trackTitle = "";
41
41
+
this._trackCoverUrl = "";
42
42
+
this._coverPath = "";
43
43
+
this._playBackStatus = "";
44
44
+
this._canGoNext = false;
45
45
+
this._canGoPrev = false;
46
46
+
this._canPlay = false;
47
47
+
this._shuffle = false;
48
48
+
this._loopStatus = "";
49
49
+
this._volume = -1;
50
50
+
this._length = -1;
51
51
+
this._position = -1;
52
52
+
}
54
53
55
55
-
close() {
56
56
-
this._proxy.disconnect(this._playerBinding1);
57
57
-
this._proxy.disconnect(this._playerBinding2);
58
58
-
this._proxy = null;
54
54
+
close() {
55
55
+
this._proxy.disconnect(this._playerBinding1);
56
56
+
this._proxy.disconnect(this._playerBinding2);
57
57
+
this._proxy = null;
59
58
60
60
-
this.emit("closed");
61
61
-
}
59
59
+
this.emit("closed");
60
60
+
}
62
61
63
63
-
_onPlayerProxyReady() {
64
64
-
this._playerBinding1 = this._proxy.connect(
65
65
-
"notify::g-name-owner",
66
66
-
() => {
67
67
-
if (!this._proxy.g_name_owner) this.close();
68
68
-
},
69
69
-
);
70
70
-
this._playerBinding2 = this._proxy.connect(
71
71
-
"g-properties-changed",
72
72
-
() => {
73
73
-
this._updateState();
74
74
-
this._cacheCoverArt();
75
75
-
this.emit("changed");
76
76
-
},
77
77
-
);
78
78
-
if (!this._proxy.g_name_owner) this.close();
62
62
+
_onPlayerProxyReady() {
63
63
+
this._playerBinding1 = this._proxy.connect("notify::g-name-owner", () => {
64
64
+
if (!this._proxy.g_name_owner) this.close();
65
65
+
});
66
66
+
this._playerBinding2 = this._proxy.connect("g-properties-changed", () => {
67
67
+
this._updateState();
68
68
+
this._cacheCoverArt();
69
69
+
this.emit("changed");
70
70
+
});
71
71
+
if (!this._proxy.g_name_owner) this.close();
79
72
80
80
-
this._updateState();
81
81
-
this._cacheCoverArt();
82
82
-
this.emit("ready");
83
83
-
}
73
73
+
this._updateState();
74
74
+
this._cacheCoverArt();
75
75
+
this.emit("ready");
76
76
+
}
84
77
85
85
-
_updateState() {
86
86
-
let metadata = {};
87
87
-
for (let prop in this._proxy.Metadata)
88
88
-
metadata[prop] = this._proxy.Metadata[prop].deep_unpack();
78
78
+
_updateState() {
79
79
+
let metadata = {};
80
80
+
for (let prop in this._proxy.Metadata)
81
81
+
metadata[prop] = this._proxy.Metadata[prop].deep_unpack();
89
82
90
90
-
this._trackArtists = metadata["xesam:artist"];
91
91
-
if (
92
92
-
!Array.isArray(this._trackArtists) ||
93
93
-
!this._trackArtists.every(
94
94
-
(artist) => typeof artist === "string",
95
95
-
)
96
96
-
)
97
97
-
this._trackArtists = ["Unknown artist"];
83
83
+
this._trackArtists = metadata["xesam:artist"];
84
84
+
if (
85
85
+
!Array.isArray(this._trackArtists) ||
86
86
+
!this._trackArtists.every((artist) => typeof artist === "string")
87
87
+
)
88
88
+
this._trackArtists = ["Unknown artist"];
98
89
99
99
-
this._trackTitle = metadata["xesam:title"];
100
100
-
if (typeof this._trackTitle !== "string")
101
101
-
this._trackTitle = "Unknown title";
90
90
+
this._trackTitle = metadata["xesam:title"];
91
91
+
if (typeof this._trackTitle !== "string")
92
92
+
this._trackTitle = "Unknown title";
102
93
103
103
-
this._trackCoverUrl = metadata["mpris:artUrl"];
104
104
-
if (typeof this._trackCoverUrl !== "string")
105
105
-
this._trackCoverUrl = "";
94
94
+
this._trackCoverUrl = metadata["mpris:artUrl"];
95
95
+
if (typeof this._trackCoverUrl !== "string") this._trackCoverUrl = "";
106
96
107
107
-
this._length = metadata["mpris:length"];
108
108
-
if (typeof this._length !== "number") this._length = -1;
109
109
-
else
110
110
-
this._length = Number.parseInt(
111
111
-
`${this._length}`.substring(0, 3),
112
112
-
);
97
97
+
this._length = metadata["mpris:length"];
98
98
+
if (typeof this._length !== "number") this._length = -1;
99
99
+
else this._length = Number.parseInt(`${this._length}`.substring(0, 3));
113
100
114
114
-
this._position = this._proxy.Position;
115
115
-
if (typeof this._position !== "number") this._position = -1;
116
116
-
else this._position = this._position / 1000000;
101
101
+
this._position = this._proxy.Position;
102
102
+
if (typeof this._position !== "number") this._position = -1;
103
103
+
else this._position = this._position / 1000000;
117
104
118
118
-
this._playBackStatus = this._proxy.PlaybackStatus;
119
119
-
this._canGoNext = this._proxy.CanGoNext;
120
120
-
this._canGoPrev = this._proxy.CanGoPrevious;
121
121
-
this._canPlay = this._proxy.CanPlay;
105
105
+
this._playBackStatus = this._proxy.PlaybackStatus;
106
106
+
this._canGoNext = this._proxy.CanGoNext;
107
107
+
this._canGoPrev = this._proxy.CanGoPrevious;
108
108
+
this._canPlay = this._proxy.CanPlay;
122
109
123
123
-
this._shuffle = this._proxy.Shuffle;
124
124
-
if (typeof this._shuffle !== "boolean") {
125
125
-
this._shuffle = null;
126
126
-
}
127
127
-
this._loopStatus = this._proxy.LoopStatus;
128
128
-
if (typeof this._loopStatus !== "string") {
129
129
-
this._loopStatus = null;
130
130
-
}
131
131
-
this._volume = this._proxy.Volume;
132
132
-
if (typeof this._volume !== "number") {
133
133
-
this._volume = -1;
134
134
-
}
135
135
-
}
110
110
+
this._shuffle = this._proxy.Shuffle;
111
111
+
if (typeof this._shuffle !== "boolean") {
112
112
+
this._shuffle = null;
113
113
+
}
114
114
+
this._loopStatus = this._proxy.LoopStatus;
115
115
+
if (typeof this._loopStatus !== "string") {
116
116
+
this._loopStatus = null;
117
117
+
}
118
118
+
this._volume = this._proxy.Volume;
119
119
+
if (typeof this._volume !== "number") {
120
120
+
this._volume = -1;
121
121
+
}
122
122
+
}
136
123
137
137
-
_cacheCoverArt() {
138
138
-
this._coverPath =
139
139
-
MEDIA_CACHE_PATH +
140
140
-
`${this._trackArtists.join(", ")}_${this._trackTitle}`.replace(
141
141
-
/[\,\*\?\"\<\>\|\#\:\?\/\']/g,
142
142
-
"",
143
143
-
);
124
124
+
_cacheCoverArt() {
125
125
+
this._coverPath =
126
126
+
MEDIA_CACHE_PATH +
127
127
+
`${this._trackArtists.join(", ")}_${this._trackTitle}`.replace(
128
128
+
/[\,\*\?\"\<\>\|\#\:\?\/\']/g,
129
129
+
"",
130
130
+
);
144
131
145
145
-
if (this._trackCoverUrl === "") return;
146
146
-
if (this._coverPath === "_") return;
147
147
-
if (GLib.file_test(this._coverPath, GLib.FileTest.EXISTS)) return;
132
132
+
if (this._trackCoverUrl === "") return;
133
133
+
if (this._coverPath === "_") return;
134
134
+
if (GLib.file_test(this._coverPath, GLib.FileTest.EXISTS)) return;
148
135
149
149
-
MkDirectory();
136
136
+
MkDirectory();
150
137
151
151
-
// Gio.File.new_for_uri(this._trackCoverUrl).copy_async(
152
152
-
// Gio.File.new_for_path(this._coverPath),
153
153
-
// Gio.FileCopyFlags.OVERWRITE,
154
154
-
// GLib.PRIORITY_DEFAULT,
155
155
-
// null,
156
156
-
// null,
157
157
-
// (source, result) => {
158
158
-
// try { source.copy_finish(result) }
159
159
-
// catch (e) { log(`failed to cache ${this._coverPath}`, e) }
160
160
-
// }
161
161
-
// );
138
138
+
// Gio.File.new_for_uri(this._trackCoverUrl).copy_async(
139
139
+
// Gio.File.new_for_path(this._coverPath),
140
140
+
// Gio.FileCopyFlags.OVERWRITE,
141
141
+
// GLib.PRIORITY_DEFAULT,
142
142
+
// null,
143
143
+
// null,
144
144
+
// (source, result) => {
145
145
+
// try { source.copy_finish(result) }
146
146
+
// catch (e) { log(`failed to cache ${this._coverPath}`, e) }
147
147
+
// }
148
148
+
// );
162
149
163
163
-
try {
164
164
-
Gio.File.new_for_uri(this._trackCoverUrl).copy(
165
165
-
Gio.File.new_for_path(this._coverPath),
166
166
-
Gio.FileCopyFlags.OVERWRITE,
167
167
-
null,
168
168
-
null,
169
169
-
);
170
170
-
} catch (e) {
171
171
-
log(`failed to cache ${this._coverPath}`, e);
172
172
-
}
173
173
-
}
150
150
+
try {
151
151
+
Gio.File.new_for_uri(this._trackCoverUrl).copy(
152
152
+
Gio.File.new_for_path(this._coverPath),
153
153
+
Gio.FileCopyFlags.OVERWRITE,
154
154
+
null,
155
155
+
null,
156
156
+
);
157
157
+
} catch (e) {
158
158
+
log(`failed to cache ${this._coverPath}`, e);
159
159
+
}
160
160
+
}
174
161
175
175
-
get json() {
176
176
-
return {
177
177
-
busName: this._busName, //busName
178
178
-
name: _getName(this._busName),
179
179
-
icon: this._playerIcon,
180
180
-
artist: this._trackArtists.join(", "),
181
181
-
title: this._trackTitle,
182
182
-
cover: this._coverPath,
183
183
-
status: this._playBackStatus,
184
184
-
canNext: this._canGoNext,
185
185
-
canPrev: this._canGoPrev,
186
186
-
canPlay: this._canPlay,
187
187
-
shuffle: this._shuffle,
188
188
-
loop: this._loopStatus,
189
189
-
volume: this._volume * 100,
190
190
-
length: this._length,
191
191
-
lengthStr: _lengthStr(this._length),
192
192
-
position: this._position,
193
193
-
};
194
194
-
}
195
195
-
},
162
162
+
get json() {
163
163
+
return {
164
164
+
busName: this._busName, //busName
165
165
+
name: _getName(this._busName),
166
166
+
icon: this._playerIcon,
167
167
+
artist: this._trackArtists.join(", "),
168
168
+
title: this._trackTitle,
169
169
+
cover: this._coverPath,
170
170
+
status: this._playBackStatus,
171
171
+
canNext: this._canGoNext,
172
172
+
canPrev: this._canGoPrev,
173
173
+
canPlay: this._canPlay,
174
174
+
shuffle: this._shuffle,
175
175
+
loop: this._loopStatus,
176
176
+
volume: this._volume * 100,
177
177
+
length: this._length,
178
178
+
lengthStr: _lengthStr(this._length),
179
179
+
position: this._position,
180
180
+
};
181
181
+
}
182
182
+
},
196
183
);
197
184
198
185
export const Media = GObject.registerClass(
199
199
-
{
200
200
-
Signals: { sync: {}, positions: {} },
201
201
-
},
202
202
-
class Media extends GObject.Object {
203
203
-
_init() {
204
204
-
super._init();
186
186
+
{
187
187
+
Signals: { sync: {}, positions: {} },
188
188
+
},
189
189
+
class Media extends GObject.Object {
190
190
+
_init() {
191
191
+
super._init();
205
192
206
206
-
this._json = {};
207
207
-
this._positions = {};
208
208
-
this._players = new Map();
209
209
-
this._proxy = new DBusProxy(
210
210
-
Gio.DBus.session,
211
211
-
"org.freedesktop.DBus",
212
212
-
"/org/freedesktop/DBus",
213
213
-
this._onProxyReady.bind(this),
214
214
-
);
215
215
-
}
193
193
+
this._json = {};
194
194
+
this._positions = {};
195
195
+
this._players = new Map();
196
196
+
this._proxy = new DBusProxy(
197
197
+
Gio.DBus.session,
198
198
+
"org.freedesktop.DBus",
199
199
+
"/org/freedesktop/DBus",
200
200
+
this._onProxyReady.bind(this),
201
201
+
);
202
202
+
}
216
203
217
217
-
get json() {
218
218
-
return this._json;
219
219
-
}
220
220
-
get positions() {
221
221
-
return this._positions;
222
222
-
}
204
204
+
get json() {
205
205
+
return this._json;
206
206
+
}
207
207
+
get positions() {
208
208
+
return this._positions;
209
209
+
}
223
210
224
224
-
_addPlayer(busName) {
225
225
-
if (this._players.get(busName)) return;
211
211
+
_addPlayer(busName) {
212
212
+
if (this._players.get(busName)) return;
226
213
227
227
-
let player = new MprisPlayer(busName);
228
228
-
player.connect("closed", () => {
229
229
-
this._players.delete(busName);
230
230
-
this._sync();
231
231
-
});
232
232
-
player.connect("changed", this._sync.bind(this));
233
233
-
player.connect("ready", this._sync.bind(this));
234
234
-
this._players.set(busName, player);
235
235
-
}
214
214
+
let player = new MprisPlayer(busName);
215
215
+
player.connect("closed", () => {
216
216
+
this._players.delete(busName);
217
217
+
this._sync();
218
218
+
});
219
219
+
player.connect("changed", this._sync.bind(this));
220
220
+
player.connect("ready", this._sync.bind(this));
221
221
+
this._players.set(busName, player);
222
222
+
}
236
223
237
237
-
_onProxyReady() {
238
238
-
this._proxy.ListNamesRemote(([names]) => {
239
239
-
names.forEach((name) => {
240
240
-
if (name.startsWith("org.mpris.MediaPlayer2."))
241
241
-
this._addPlayer(name);
242
242
-
});
243
243
-
});
244
244
-
this._proxy.connectSignal(
245
245
-
"NameOwnerChanged",
246
246
-
this._onNameOwnerChanged.bind(this),
247
247
-
);
248
248
-
this._sync();
249
249
-
}
224
224
+
_onProxyReady() {
225
225
+
this._proxy.ListNamesRemote(([names]) => {
226
226
+
names.forEach((name) => {
227
227
+
if (name.startsWith("org.mpris.MediaPlayer2.")) this._addPlayer(name);
228
228
+
});
229
229
+
});
230
230
+
this._proxy.connectSignal(
231
231
+
"NameOwnerChanged",
232
232
+
this._onNameOwnerChanged.bind(this),
233
233
+
);
234
234
+
this._sync();
235
235
+
}
250
236
251
251
-
_onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) {
252
252
-
if (!name.startsWith("org.mpris.MediaPlayer2.")) return;
237
237
+
_onNameOwnerChanged(proxy, sender, [name, oldOwner, newOwner]) {
238
238
+
if (!name.startsWith("org.mpris.MediaPlayer2.")) return;
253
239
254
254
-
if (newOwner && !oldOwner) this._addPlayer(name);
255
255
-
}
240
240
+
if (newOwner && !oldOwner) this._addPlayer(name);
241
241
+
}
256
242
257
257
-
_sync() {
258
258
-
let preferred = null;
259
259
-
let players = [];
260
260
-
for (const [_, player] of this._players) {
261
261
-
if (player.json.busName.includes(PREFERRED_PLAYER))
262
262
-
preferred = player.json;
243
243
+
_sync() {
244
244
+
let preferred = null;
245
245
+
let players = [];
246
246
+
for (const [_, player] of this._players) {
247
247
+
if (player.json.busName.includes(PREFERRED_PLAYER))
248
248
+
preferred = player.json;
263
249
264
264
-
players.push(player.json);
265
265
-
}
250
250
+
players.push(player.json);
251
251
+
}
266
252
267
267
-
if (this._players.size === 1) preferred = players[0];
253
253
+
if (this._players.size === 1) preferred = players[0];
268
254
269
269
-
this._json = {
270
270
-
preferred,
271
271
-
players,
272
272
-
};
273
273
-
this.emit("sync");
274
274
-
}
255
255
+
this._json = {
256
256
+
preferred,
257
257
+
players,
258
258
+
};
259
259
+
this.emit("sync");
260
260
+
}
275
261
276
276
-
getPositions() {
277
277
-
if (this._players.size === 0) return;
278
278
-
let playersReady = 0;
279
279
-
let positions = {};
280
280
-
for (const [busName, _] of this._players) {
281
281
-
new MprisPlayer(busName).connect("ready", (mpris) => {
282
282
-
positions[mpris.json.name] = {
283
283
-
length: mpris.json.length,
284
284
-
lengthStr: _lengthStr(mpris.json.length),
285
285
-
position: mpris.json.position,
286
286
-
positionStr: _lengthStr(mpris.json.position),
287
287
-
};
288
288
-
playersReady++;
262
262
+
getPositions() {
263
263
+
if (this._players.size === 0) return;
264
264
+
let playersReady = 0;
265
265
+
let positions = {};
266
266
+
for (const [busName, _] of this._players) {
267
267
+
new MprisPlayer(busName).connect("ready", (mpris) => {
268
268
+
positions[mpris.json.name] = {
269
269
+
length: mpris.json.length,
270
270
+
lengthStr: _lengthStr(mpris.json.length),
271
271
+
position: mpris.json.position,
272
272
+
positionStr: _lengthStr(mpris.json.position),
273
273
+
};
274
274
+
playersReady++;
289
275
290
290
-
if (playersReady === this._players.size) {
291
291
-
this._positions = positions;
292
292
-
this.emit("positions");
293
293
-
}
276
276
+
if (playersReady === this._players.size) {
277
277
+
this._positions = positions;
278
278
+
this.emit("positions");
279
279
+
}
294
280
295
295
-
mpris.close();
296
296
-
});
297
297
-
}
298
298
-
return true;
299
299
-
}
300
300
-
},
281
281
+
mpris.close();
282
282
+
});
283
283
+
}
284
284
+
return true;
285
285
+
}
286
286
+
},
301
287
);
+117
-127
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/network.js
···
1
1
import { NM, Gio, GObject } from "./lib.js";
2
2
3
3
function showNotification(title, message) {
4
4
-
let notification = new Gio.Notification();
5
5
-
notification.set_title(title);
6
6
-
notification.set_body(message);
7
7
-
notification.set_priority(Gio.NotificationPriority.NORMAL);
8
8
-
application.register(null);
9
9
-
application.send_notification(null, notification);
10
10
-
GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 2, () => {
11
11
-
application.quit();
12
12
-
return GLib.SOURCE_REMOVE;
13
13
-
});
4
4
+
let notification = new Gio.Notification();
5
5
+
notification.set_title(title);
6
6
+
notification.set_body(message);
7
7
+
notification.set_priority(Gio.NotificationPriority.NORMAL);
8
8
+
application.register(null);
9
9
+
application.send_notification(null, notification);
10
10
+
GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 2, () => {
11
11
+
application.quit();
12
12
+
return GLib.SOURCE_REMOVE;
13
13
+
});
14
14
}
15
15
16
16
Gio._promisify(NM.Client, "new_async");
17
17
Gio._promisify(NM.DeviceWifi.prototype, "request_scan_async");
18
18
19
19
const WifiStyles = {
20
20
-
"": "none",
21
21
-
"": "low",
22
22
-
"": "low",
23
23
-
"": "low",
24
24
-
"": "medium",
25
25
-
"": "medium",
26
26
-
"": "high",
20
20
+
"": "none",
21
21
+
"": "low",
22
22
+
"": "low",
23
23
+
"": "low",
24
24
+
"": "medium",
25
25
+
"": "medium",
26
26
+
"": "high",
27
27
};
28
28
29
29
export const Network = GObject.registerClass(
30
30
-
{
31
31
-
Signals: { sync: {} },
32
32
-
},
33
33
-
class Network extends GObject.Object {
34
34
-
constructor() {
35
35
-
super();
30
30
+
{
31
31
+
Signals: { sync: {} },
32
32
+
},
33
33
+
class Network extends GObject.Object {
34
34
+
constructor() {
35
35
+
super();
36
36
37
37
-
this._json = {};
38
38
-
this._getClient();
39
39
-
}
37
37
+
this._json = {};
38
38
+
this._getClient();
39
39
+
}
40
40
41
41
-
get json() {
42
42
-
return this._json;
43
43
-
}
41
41
+
get json() {
42
42
+
return this._json;
43
43
+
}
44
44
45
45
-
_getDevice(devType) {
46
46
-
return this._client
47
47
-
.get_devices()
48
48
-
.find((device) => device.get_device_type() === devType);
49
49
-
}
45
45
+
_getDevice(devType) {
46
46
+
return this._client
47
47
+
.get_devices()
48
48
+
.find((device) => device.get_device_type() === devType);
49
49
+
}
50
50
51
51
-
async _getClient() {
52
52
-
this._client = await NM.Client.new_async(null);
53
53
-
this._client.connect(
54
54
-
"notify::wireless-enabled",
55
55
-
this._sync.bind(this),
56
56
-
);
57
57
-
this._client.connect("notify::connectivity", this._sync.bind(this));
58
58
-
this._client.connect(
59
59
-
"notify::primary-connection",
60
60
-
this._sync.bind(this),
61
61
-
);
62
62
-
this._client.connect(
63
63
-
"notify::activating-connection",
64
64
-
this._sync.bind(this),
65
65
-
);
51
51
+
async _getClient() {
52
52
+
this._client = await NM.Client.new_async(null);
53
53
+
this._client.connect("notify::wireless-enabled", this._sync.bind(this));
54
54
+
this._client.connect("notify::connectivity", this._sync.bind(this));
55
55
+
this._client.connect("notify::primary-connection", this._sync.bind(this));
56
56
+
this._client.connect(
57
57
+
"notify::activating-connection",
58
58
+
this._sync.bind(this),
59
59
+
);
66
60
67
67
-
this._wifi = this._getDevice(NM.DeviceType.WIFI);
68
68
-
if (this._wifi) {
69
69
-
this._wifi.connect(
70
70
-
"notify::active-access-point",
71
71
-
this._activeAp.bind(this),
72
72
-
);
73
73
-
//this._wifi.connect('access-point-added', (_, ap) => this._apAdded(ap));
74
74
-
//this._wifi.connect('access-point-removed', (_, ap) => this._apRemoved(ap));
75
75
-
}
61
61
+
this._wifi = this._getDevice(NM.DeviceType.WIFI);
62
62
+
if (this._wifi) {
63
63
+
this._wifi.connect(
64
64
+
"notify::active-access-point",
65
65
+
this._activeAp.bind(this),
66
66
+
);
67
67
+
//this._wifi.connect('access-point-added', (_, ap) => this._apAdded(ap));
68
68
+
//this._wifi.connect('access-point-removed', (_, ap) => this._apRemoved(ap));
69
69
+
}
76
70
77
77
-
this._activeAp();
78
78
-
this._sync();
79
79
-
}
71
71
+
this._activeAp();
72
72
+
this._sync();
73
73
+
}
80
74
81
81
-
//_apAdded(ap) {
82
82
-
// let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data());
83
83
-
// showNotification('Access Point Added', `The access point "${ssid}" has been added.`);
84
84
-
// this._sync();
85
85
-
//}
75
75
+
//_apAdded(ap) {
76
76
+
// let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data());
77
77
+
// showNotification('Access Point Added', `The access point "${ssid}" has been added.`);
78
78
+
// this._sync();
79
79
+
//}
86
80
87
87
-
//_apRemoved(ap) {
88
88
-
// let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data());
89
89
-
// showNotification('Access Point Removed', `The access point "${ssid}" has been removed.`);
90
90
-
// this._sync();
91
91
-
//}
81
81
+
//_apRemoved(ap) {
82
82
+
// let ssid = NM.utils_ssid_to_utf8(ap.get_ssid().get_data());
83
83
+
// showNotification('Access Point Removed', `The access point "${ssid}" has been removed.`);
84
84
+
// this._sync();
85
85
+
//}
92
86
93
93
-
_activeAp() {
94
94
-
if (this._ap) this._ap.disconnect(this._apBind);
95
95
-
this._ap = this._wifi?.get_active_access_point();
96
96
-
if (!this._ap) return;
97
97
-
this._apBind = this._ap.connect(
98
98
-
"notify::strength",
99
99
-
this._sync.bind(this),
100
100
-
);
101
101
-
this._sync();
102
102
-
}
87
87
+
_activeAp() {
88
88
+
if (this._ap) this._ap.disconnect(this._apBind);
89
89
+
this._ap = this._wifi?.get_active_access_point();
90
90
+
if (!this._ap) return;
91
91
+
this._apBind = this._ap.connect(
92
92
+
"notify::strength",
93
93
+
this._sync.bind(this),
94
94
+
);
95
95
+
this._sync();
96
96
+
}
103
97
104
104
-
_sync() {
105
105
-
const mainConnection =
106
106
-
this._client.get_primary_connection() ||
107
107
-
this._client.get_activating_connection();
98
98
+
_sync() {
99
99
+
const mainConnection =
100
100
+
this._client.get_primary_connection() ||
101
101
+
this._client.get_activating_connection();
108
102
109
109
-
const primary_type = mainConnection?.type || null; // 802-11-wireless ; 802-3-ethernet
110
110
-
const internet =
111
111
-
this._client.connectivity === NM.ConnectivityState.FULL;
103
103
+
const primary_type = mainConnection?.type || null; // 802-11-wireless ; 802-3-ethernet
104
104
+
const internet = this._client.connectivity === NM.ConnectivityState.FULL;
112
105
113
113
-
let wifi = {
114
114
-
primary: primary_type === "802-11-wireless",
115
115
-
enabled: this._client.wireless_enabled,
116
116
-
state: this._client.wireless_enabled ? "on" : "off",
117
117
-
ssid:
118
118
-
(this._ap &&
119
119
-
NM.utils_ssid_to_utf8(
120
120
-
this._ap.get_ssid().get_data(),
121
121
-
)) ||
122
122
-
"Unknown",
123
123
-
strength:
124
124
-
this._client.wireless_enabled && mainConnection
125
125
-
? `${this._ap?.strength}%`
126
126
-
: "",
127
127
-
icon: ["", "", "", "", "", ""][
128
128
-
Math.ceil(this._ap?.strength / 20)
129
129
-
],
130
130
-
};
131
131
-
if (!internet) {
132
132
-
wifi.strength = "";
133
133
-
wifi.icon = "";
134
134
-
}
135
135
-
wifi.style = WifiStyles[wifi.icon];
106
106
+
let wifi = {
107
107
+
primary: primary_type === "802-11-wireless",
108
108
+
enabled: this._client.wireless_enabled,
109
109
+
state: this._client.wireless_enabled ? "on" : "off",
110
110
+
ssid:
111
111
+
(this._ap && NM.utils_ssid_to_utf8(this._ap.get_ssid().get_data())) ||
112
112
+
"Unknown",
113
113
+
strength:
114
114
+
this._client.wireless_enabled && mainConnection
115
115
+
? `${this._ap?.strength}%`
116
116
+
: "",
117
117
+
icon: ["", "", "", "", "", ""][
118
118
+
Math.ceil(this._ap?.strength / 20)
119
119
+
],
120
120
+
};
121
121
+
if (!internet) {
122
122
+
wifi.strength = "";
123
123
+
wifi.icon = "";
124
124
+
}
125
125
+
wifi.style = WifiStyles[wifi.icon];
136
126
137
137
-
let wired = {
138
138
-
primary: primary_type === "802-3-ethernet",
139
139
-
icon: internet ? "" : "",
140
140
-
};
127
127
+
let wired = {
128
128
+
primary: primary_type === "802-3-ethernet",
129
129
+
icon: internet ? "" : "",
130
130
+
};
141
131
142
142
-
this._json = {
143
143
-
primary:
144
144
-
{ "802-3-ethernet": "wired", "802-11-wireless": "wifi" }[
145
145
-
primary_type
146
146
-
] || "none",
147
147
-
none: { icon: "" },
148
148
-
wifi,
149
149
-
wired,
150
150
-
};
151
151
-
this.emit("sync");
152
152
-
}
153
153
-
},
132
132
+
this._json = {
133
133
+
primary:
134
134
+
{ "802-3-ethernet": "wired", "802-11-wireless": "wifi" }[
135
135
+
primary_type
136
136
+
] || "none",
137
137
+
none: { icon: "" },
138
138
+
wifi,
139
139
+
wired,
140
140
+
};
141
141
+
this.emit("sync");
142
142
+
}
143
143
+
},
154
144
);
+236
-246
home/isabel/programs/configs/gui/bars/eww/config/scripts/host/notifications.js
···
1
1
import { NotificationIFace } from "./dbus.js";
2
2
import {
3
3
-
NOTIFICATIONS_CACHE_PATH,
4
4
-
NOTIFICATIONS_BANNER_TIME_OUT,
5
5
-
MkDirectory,
6
6
-
CACHE_PATH,
3
3
+
NOTIFICATIONS_CACHE_PATH,
4
4
+
NOTIFICATIONS_BANNER_TIME_OUT,
5
5
+
MkDirectory,
6
6
+
CACHE_PATH,
7
7
} from "./main.js";
8
8
import { GObject, Gio, Gtk, GdkPixbuf, GLib } from "./lib.js";
9
9
10
10
export const Notifications = GObject.registerClass(
11
11
-
{
12
12
-
Signals: { sync: {} },
13
13
-
},
14
14
-
class Notifications extends GObject.Object {
15
15
-
constructor(fg_color = "white") {
16
16
-
super();
11
11
+
{
12
12
+
Signals: { sync: {} },
13
13
+
},
14
14
+
class Notifications extends GObject.Object {
15
15
+
constructor(fg_color = "white") {
16
16
+
super();
17
17
18
18
-
this._fgColor = fg_color;
19
19
-
this._json = {};
20
20
-
this._dnd = false;
21
21
-
this._idCound = 1;
22
22
-
this._notifications = new Map();
23
23
-
this._popups = new Map();
24
24
-
this._readFromFile();
25
25
-
this._register();
26
26
-
this._sync();
27
27
-
}
18
18
+
this._fgColor = fg_color;
19
19
+
this._json = {};
20
20
+
this._dnd = false;
21
21
+
this._idCound = 1;
22
22
+
this._notifications = new Map();
23
23
+
this._popups = new Map();
24
24
+
this._readFromFile();
25
25
+
this._register();
26
26
+
this._sync();
27
27
+
}
28
28
29
29
-
get json() {
30
30
-
return this._json;
31
31
-
}
29
29
+
get json() {
30
30
+
return this._json;
31
31
+
}
32
32
33
33
-
get DoNotDisturb() {
34
34
-
return this._dnd;
35
35
-
}
33
33
+
get DoNotDisturb() {
34
34
+
return this._dnd;
35
35
+
}
36
36
37
37
-
Clear() {
38
38
-
for (const [_, notification] of this._notifications) {
39
39
-
this.CloseNotification(notification.id);
40
40
-
}
41
41
-
}
37
37
+
Clear() {
38
38
+
for (const [_, notification] of this._notifications) {
39
39
+
this.CloseNotification(notification.id);
40
40
+
}
41
41
+
}
42
42
43
43
-
Notify(
44
44
-
app_name,
45
45
-
replaces_id,
46
46
-
app_icon,
47
47
-
summary,
48
48
-
body,
49
49
-
actions,
50
50
-
hints,
51
51
-
time_out,
52
52
-
) {
53
53
-
let acts = [];
54
54
-
for (let i = 0; i < actions.length; i += 2) {
55
55
-
if (actions[i + 1] !== "")
56
56
-
acts.push({
57
57
-
label: actions[i + 1],
58
58
-
id: actions[i],
59
59
-
});
60
60
-
}
61
61
-
let id = replaces_id || this._idCound++;
62
62
-
let date = new Date();
63
63
-
let notification = {
64
64
-
id,
65
65
-
app_name,
66
66
-
app_icon,
67
67
-
summary,
68
68
-
body,
69
69
-
actions: acts,
70
70
-
time: {
71
71
-
hour: date.getHours(),
72
72
-
minute:
73
73
-
date.getMinutes() > 9
74
74
-
? date.getMinutes()
75
75
-
: `0${date.getMinutes()}`,
76
76
-
},
77
77
-
image:
78
78
-
this._parseImage(hints["image-data"], `${summary}${id}`) ||
79
79
-
this._parseIcon(app_icon, `${summary}${id}`) ||
80
80
-
this._parseIcon(app_name, `${summary}${id}`),
81
81
-
};
82
82
-
this._notifications.set(notification.id, notification);
83
83
-
if (!this._dnd) {
84
84
-
this._popups.set(notification.id, notification);
85
85
-
GLib.timeout_add(
86
86
-
GLib.PRIORITY_DEFAULT,
87
87
-
time_out > 0 ? time_out : NOTIFICATIONS_BANNER_TIME_OUT,
88
88
-
() => {
89
89
-
if (!this._popups.has(id)) return;
90
90
-
this._popups.delete(notification.id);
91
91
-
this._sync();
92
92
-
},
93
93
-
);
94
94
-
}
43
43
+
Notify(
44
44
+
app_name,
45
45
+
replaces_id,
46
46
+
app_icon,
47
47
+
summary,
48
48
+
body,
49
49
+
actions,
50
50
+
hints,
51
51
+
time_out,
52
52
+
) {
53
53
+
let acts = [];
54
54
+
for (let i = 0; i < actions.length; i += 2) {
55
55
+
if (actions[i + 1] !== "")
56
56
+
acts.push({
57
57
+
label: actions[i + 1],
58
58
+
id: actions[i],
59
59
+
});
60
60
+
}
61
61
+
let id = replaces_id || this._idCound++;
62
62
+
let date = new Date();
63
63
+
let notification = {
64
64
+
id,
65
65
+
app_name,
66
66
+
app_icon,
67
67
+
summary,
68
68
+
body,
69
69
+
actions: acts,
70
70
+
time: {
71
71
+
hour: date.getHours(),
72
72
+
minute:
73
73
+
date.getMinutes() > 9 ? date.getMinutes() : `0${date.getMinutes()}`,
74
74
+
},
75
75
+
image:
76
76
+
this._parseImage(hints["image-data"], `${summary}${id}`) ||
77
77
+
this._parseIcon(app_icon, `${summary}${id}`) ||
78
78
+
this._parseIcon(app_name, `${summary}${id}`),
79
79
+
};
80
80
+
this._notifications.set(notification.id, notification);
81
81
+
if (!this._dnd) {
82
82
+
this._popups.set(notification.id, notification);
83
83
+
GLib.timeout_add(
84
84
+
GLib.PRIORITY_DEFAULT,
85
85
+
time_out > 0 ? time_out : NOTIFICATIONS_BANNER_TIME_OUT,
86
86
+
() => {
87
87
+
if (!this._popups.has(id)) return;
88
88
+
this._popups.delete(notification.id);
95
89
this._sync();
96
96
-
return notification.id;
97
97
-
}
90
90
+
},
91
91
+
);
92
92
+
}
93
93
+
this._sync();
94
94
+
return notification.id;
95
95
+
}
98
96
99
99
-
ToggleDND() {
100
100
-
this._dnd = !this._dnd;
101
101
-
this._sync();
102
102
-
}
97
97
+
ToggleDND() {
98
98
+
this._dnd = !this._dnd;
99
99
+
this._sync();
100
100
+
}
103
101
104
104
-
DismissNotification(id) {
105
105
-
this._popups.delete(id);
106
106
-
this._sync();
107
107
-
}
102
102
+
DismissNotification(id) {
103
103
+
this._popups.delete(id);
104
104
+
this._sync();
105
105
+
}
108
106
109
109
-
DismissLatestNotification() {
110
110
-
this._popups.delete([...this._popups.keys()].pop());
111
111
-
this._sync();
112
112
-
}
107
107
+
DismissLatestNotification() {
108
108
+
this._popups.delete([...this._popups.keys()].pop());
109
109
+
this._sync();
110
110
+
}
113
111
114
114
-
CloseNotification(id) {
115
115
-
if (!this._notifications.has(id)) return;
116
116
-
this._dbus.emit_signal(
117
117
-
"NotificationClosed",
118
118
-
GLib.Variant.new("(uu)", [id, 2]),
119
119
-
);
120
120
-
this._notifications.delete(id);
121
121
-
this._popups.delete(id);
122
122
-
this._sync();
123
123
-
}
112
112
+
CloseNotification(id) {
113
113
+
if (!this._notifications.has(id)) return;
114
114
+
this._dbus.emit_signal(
115
115
+
"NotificationClosed",
116
116
+
GLib.Variant.new("(uu)", [id, 2]),
117
117
+
);
118
118
+
this._notifications.delete(id);
119
119
+
this._popups.delete(id);
120
120
+
this._sync();
121
121
+
}
124
122
125
125
-
CloseLatestNotification() {
126
126
-
const latestNotificationId = [...this._notifications.keys()].pop();
127
127
-
if (latestNotificationId) {
128
128
-
this.CloseNotification(latestNotificationId);
129
129
-
}
130
130
-
}
123
123
+
CloseLatestNotification() {
124
124
+
const latestNotificationId = [...this._notifications.keys()].pop();
125
125
+
if (latestNotificationId) {
126
126
+
this.CloseNotification(latestNotificationId);
127
127
+
}
128
128
+
}
131
129
132
132
-
InvokeAction(id, action) {
133
133
-
if (!this._notifications.has(id)) return;
134
134
-
this._dbus.emit_signal(
135
135
-
"ActionInvoked",
136
136
-
GLib.Variant.new("(us)", [id, action]),
137
137
-
);
138
138
-
this._notifications.delete(id);
139
139
-
this._popups.delete(id);
140
140
-
this._sync();
141
141
-
}
130
130
+
InvokeAction(id, action) {
131
131
+
if (!this._notifications.has(id)) return;
132
132
+
this._dbus.emit_signal(
133
133
+
"ActionInvoked",
134
134
+
GLib.Variant.new("(us)", [id, action]),
135
135
+
);
136
136
+
this._notifications.delete(id);
137
137
+
this._popups.delete(id);
138
138
+
this._sync();
139
139
+
}
142
140
143
143
-
GetCapabilities() {
144
144
-
return ["actions", "body", "icon-static", "persistence"];
145
145
-
}
141
141
+
GetCapabilities() {
142
142
+
return ["actions", "body", "icon-static", "persistence"];
143
143
+
}
146
144
147
147
-
GetServerInformation() {
148
148
-
return new GLib.Variant("(ssss)", ["host", "isabel", "0.1", "1.2"]);
149
149
-
}
145
145
+
GetServerInformation() {
146
146
+
return new GLib.Variant("(ssss)", ["host", "isabel", "0.1", "1.2"]);
147
147
+
}
150
148
151
151
-
_register() {
152
152
-
Gio.bus_own_name(
153
153
-
Gio.BusType.SESSION,
154
154
-
"org.freedesktop.Notifications",
155
155
-
Gio.BusNameOwnerFlags.NONE,
156
156
-
(connection, _) => {
157
157
-
this._dbus = Gio.DBusExportedObject.wrapJSObject(
158
158
-
NotificationIFace,
159
159
-
this,
160
160
-
);
161
161
-
this._dbus.export(
162
162
-
connection,
163
163
-
"/org/freedesktop/Notifications",
164
164
-
);
165
165
-
},
166
166
-
null,
167
167
-
() => {
168
168
-
print("Another Notification Daemon is already running!");
169
169
-
},
170
170
-
);
171
171
-
}
149
149
+
_register() {
150
150
+
Gio.bus_own_name(
151
151
+
Gio.BusType.SESSION,
152
152
+
"org.freedesktop.Notifications",
153
153
+
Gio.BusNameOwnerFlags.NONE,
154
154
+
(connection, _) => {
155
155
+
this._dbus = Gio.DBusExportedObject.wrapJSObject(
156
156
+
NotificationIFace,
157
157
+
this,
158
158
+
);
159
159
+
this._dbus.export(connection, "/org/freedesktop/Notifications");
160
160
+
},
161
161
+
null,
162
162
+
() => {
163
163
+
print("Another Notification Daemon is already running!");
164
164
+
},
165
165
+
);
166
166
+
}
172
167
173
173
-
_filterName(name) {
174
174
-
return (
175
175
-
NOTIFICATIONS_CACHE_PATH +
176
176
-
name.replace(/[\ \,\*\?\"\<\>\|\#\:\?\/\!\']/g, "") +
177
177
-
".png"
178
178
-
);
179
179
-
}
168
168
+
_filterName(name) {
169
169
+
return (
170
170
+
NOTIFICATIONS_CACHE_PATH +
171
171
+
name.replace(/[\ \,\*\?\"\<\>\|\#\:\?\/\!\']/g, "") +
172
172
+
".png"
173
173
+
);
174
174
+
}
180
175
181
181
-
_parseIcon(icon_name, name) {
182
182
-
if (!icon_name) return;
176
176
+
_parseIcon(icon_name, name) {
177
177
+
if (!icon_name) return;
183
178
184
184
-
MkDirectory();
185
185
-
let fileName = this._filterName(name);
186
186
-
let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon(
187
187
-
Gio.Icon.new_for_string(icon_name),
188
188
-
128,
189
189
-
null,
190
190
-
);
179
179
+
MkDirectory();
180
180
+
let fileName = this._filterName(name);
181
181
+
let iconInfo = Gtk.IconTheme.get_default().lookup_by_gicon(
182
182
+
Gio.Icon.new_for_string(icon_name),
183
183
+
128,
184
184
+
null,
185
185
+
);
191
186
192
192
-
if (!iconInfo) return null;
187
187
+
if (!iconInfo) return null;
193
188
194
194
-
let output_stream = Gio.File.new_for_path(fileName).replace(
195
195
-
null,
196
196
-
false,
197
197
-
Gio.FileCreateFlags.NONE,
198
198
-
null,
199
199
-
);
189
189
+
let output_stream = Gio.File.new_for_path(fileName).replace(
190
190
+
null,
191
191
+
false,
192
192
+
Gio.FileCreateFlags.NONE,
193
193
+
null,
194
194
+
);
200
195
201
201
-
iconInfo
202
202
-
.load_icon()
203
203
-
.save_to_streamv(output_stream, "png", null, null, null);
196
196
+
iconInfo
197
197
+
.load_icon()
198
198
+
.save_to_streamv(output_stream, "png", null, null, null);
204
199
205
205
-
output_stream.close(null);
200
200
+
output_stream.close(null);
206
201
207
207
-
if (icon_name.includes("-symbolic"))
208
208
-
GLib.spawn_command_line_sync(`convert ${fileName} -alpha on
202
202
+
if (icon_name.includes("-symbolic"))
203
203
+
GLib.spawn_command_line_sync(`convert ${fileName} -alpha on
209
204
-fill ${this._fgColor} -colorize 100% -bordercolor transparent -border 16 ${fileName}`);
210
205
211
211
-
return fileName;
212
212
-
}
206
206
+
return fileName;
207
207
+
}
213
208
214
214
-
_readFromFile() {
215
215
-
try {
216
216
-
const file = Gio.File.new_for_path(
217
217
-
CACHE_PATH + "notifications.json",
218
218
-
);
219
219
-
const [, contents, etag] = file.load_contents(null);
220
220
-
const json = JSON.parse(
221
221
-
new TextDecoder("utf-8").decode(contents),
222
222
-
);
223
223
-
json.notifications.forEach((n) => {
224
224
-
if (n.id > this._idCound) this._idCound = n.id + 1;
225
225
-
this._notifications.set(n.id, n);
226
226
-
});
227
227
-
} catch (error) {
228
228
-
print("There were no cached notifications found!");
229
229
-
print(
230
230
-
"If you want your notifications to be cached run with --file flag",
231
231
-
);
232
232
-
}
233
233
-
}
209
209
+
_readFromFile() {
210
210
+
try {
211
211
+
const file = Gio.File.new_for_path(CACHE_PATH + "notifications.json");
212
212
+
const [, contents, etag] = file.load_contents(null);
213
213
+
const json = JSON.parse(new TextDecoder("utf-8").decode(contents));
214
214
+
json.notifications.forEach((n) => {
215
215
+
if (n.id > this._idCound) this._idCound = n.id + 1;
216
216
+
this._notifications.set(n.id, n);
217
217
+
});
218
218
+
} catch (error) {
219
219
+
print("There were no cached notifications found!");
220
220
+
print(
221
221
+
"If you want your notifications to be cached run with --file flag",
222
222
+
);
223
223
+
}
224
224
+
}
234
225
235
235
-
_parseImage(image_data, name) {
236
236
-
if (!image_data) return;
237
237
-
MkDirectory();
238
238
-
let fileName = this._filterName(name);
239
239
-
let image = image_data.recursiveUnpack();
240
240
-
let pixbuf = GdkPixbuf.Pixbuf.new_from_bytes(
241
241
-
image[6],
242
242
-
GdkPixbuf.Colorspace.RGB,
243
243
-
image[3],
244
244
-
image[4],
245
245
-
image[0],
246
246
-
image[1],
247
247
-
image[2],
248
248
-
);
226
226
+
_parseImage(image_data, name) {
227
227
+
if (!image_data) return;
228
228
+
MkDirectory();
229
229
+
let fileName = this._filterName(name);
230
230
+
let image = image_data.recursiveUnpack();
231
231
+
let pixbuf = GdkPixbuf.Pixbuf.new_from_bytes(
232
232
+
image[6],
233
233
+
GdkPixbuf.Colorspace.RGB,
234
234
+
image[3],
235
235
+
image[4],
236
236
+
image[0],
237
237
+
image[1],
238
238
+
image[2],
239
239
+
);
249
240
250
250
-
let output_stream = Gio.File.new_for_path(fileName).replace(
251
251
-
null,
252
252
-
false,
253
253
-
Gio.FileCreateFlags.NONE,
254
254
-
null,
255
255
-
);
241
241
+
let output_stream = Gio.File.new_for_path(fileName).replace(
242
242
+
null,
243
243
+
false,
244
244
+
Gio.FileCreateFlags.NONE,
245
245
+
null,
246
246
+
);
256
247
257
257
-
pixbuf.save_to_streamv(output_stream, "png", null, null, null);
258
258
-
output_stream.close(null);
248
248
+
pixbuf.save_to_streamv(output_stream, "png", null, null, null);
249
249
+
output_stream.close(null);
259
250
260
260
-
return fileName;
261
261
-
}
251
251
+
return fileName;
252
252
+
}
262
253
263
263
-
_sync() {
264
264
-
let notifications = [],
265
265
-
popups = [];
266
266
-
for (const [_, notification] of this._notifications)
267
267
-
notifications.push(notification);
254
254
+
_sync() {
255
255
+
let notifications = [],
256
256
+
popups = [];
257
257
+
for (const [_, notification] of this._notifications)
258
258
+
notifications.push(notification);
268
259
269
269
-
for (const [_, notification] of this._popups)
270
270
-
popups.push(notification);
260
260
+
for (const [_, notification] of this._popups) popups.push(notification);
271
261
272
272
-
this._json = {
273
273
-
dnd: {
274
274
-
enabled: this._dnd,
275
275
-
state: this._dnd ? "on" : "off",
276
276
-
icon: this._dnd ? "" : "",
277
277
-
},
278
278
-
count: notifications.length,
279
279
-
icon: this._dnd ? "" : notifications.length > 0 ? "" : "",
280
280
-
notifications,
281
281
-
popups,
282
282
-
};
283
283
-
this.emit("sync");
284
284
-
}
285
285
-
},
262
262
+
this._json = {
263
263
+
dnd: {
264
264
+
enabled: this._dnd,
265
265
+
state: this._dnd ? "on" : "off",
266
266
+
icon: this._dnd ? "" : "",
267
267
+
},
268
268
+
count: notifications.length,
269
269
+
icon: this._dnd ? "" : notifications.length > 0 ? "" : "",
270
270
+
notifications,
271
271
+
popups,
272
272
+
};
273
273
+
this.emit("sync");
274
274
+
}
275
275
+
},
286
276
);
+344
-351
home/isabel/programs/configs/gui/bars/eww/config/scripts/todo
···
3
3
4
4
const { Gio, GLib } = imports.gi;
5
5
const SUBSTITUTES_PATH =
6
6
-
GLib.get_home_dir() + "/.local/share/todo/substitutes.json";
6
6
+
GLib.get_home_dir() + "/.local/share/todo/substitutes.json";
7
7
const TASKS_PATH = GLib.get_home_dir() + "/Documents/tasks.json";
8
8
const TERMINAL_WIDTH = 50;
9
9
10
10
function getSubstitutes() {
11
11
-
try {
12
12
-
let file = Gio.File.new_for_path(SUBSTITUTES_PATH);
13
13
-
let [, contents] = file.load_contents(null);
14
14
-
return JSON.parse(new TextDecoder().decode(contents));
15
15
-
} catch {
16
16
-
return { days: [], months: [] };
17
17
-
}
11
11
+
try {
12
12
+
let file = Gio.File.new_for_path(SUBSTITUTES_PATH);
13
13
+
let [, contents] = file.load_contents(null);
14
14
+
return JSON.parse(new TextDecoder().decode(contents));
15
15
+
} catch {
16
16
+
return { days: [], months: [] };
17
17
+
}
18
18
}
19
19
20
20
function getTasks() {
21
21
-
try {
22
22
-
let file = Gio.File.new_for_path(TASKS_PATH);
23
23
-
let [, contents] = file.load_contents(null);
24
24
-
let list = JSON.parse(new TextDecoder().decode(contents));
25
25
-
let tasks = [];
26
26
-
list.forEach((t) => tasks.push(new Task(t)));
27
27
-
return tasks;
28
28
-
} catch {
29
29
-
return [];
30
30
-
}
21
21
+
try {
22
22
+
let file = Gio.File.new_for_path(TASKS_PATH);
23
23
+
let [, contents] = file.load_contents(null);
24
24
+
let list = JSON.parse(new TextDecoder().decode(contents));
25
25
+
let tasks = [];
26
26
+
list.forEach((t) => tasks.push(new Task(t)));
27
27
+
return tasks;
28
28
+
} catch {
29
29
+
return [];
30
30
+
}
31
31
}
32
32
33
33
function writeFile(tasks) {
34
34
-
let file = Gio.File.new_for_path(TASKS_PATH);
35
35
-
if (!GLib.file_test(TASKS_PATH, GLib.FileTest.EXISTS))
36
36
-
file.create(Gio.FileCreateFlags.NONE, null);
34
34
+
let file = Gio.File.new_for_path(TASKS_PATH);
35
35
+
if (!GLib.file_test(TASKS_PATH, GLib.FileTest.EXISTS))
36
36
+
file.create(Gio.FileCreateFlags.NONE, null);
37
37
38
38
-
file.replace_contents(
39
39
-
JSON.stringify(tasks, null, 4),
40
40
-
null,
41
41
-
false,
42
42
-
Gio.FileCreateFlags.REPLACE_DESTINATION,
43
43
-
null,
44
44
-
);
38
38
+
file.replace_contents(
39
39
+
JSON.stringify(tasks, null, 4),
40
40
+
null,
41
41
+
false,
42
42
+
Gio.FileCreateFlags.REPLACE_DESTINATION,
43
43
+
null,
44
44
+
);
45
45
}
46
46
47
47
class Date {
48
48
-
constructor(p) {
49
49
-
this.year = p?.year;
50
50
-
this.month = p?.month;
51
51
-
this.day = p?.day;
52
52
-
this.hour = p?.hour;
53
53
-
this.minutes = p?.minutes;
54
54
-
this.asap = p?.asap || false;
48
48
+
constructor(p) {
49
49
+
this.year = p?.year;
50
50
+
this.month = p?.month;
51
51
+
this.day = p?.day;
52
52
+
this.hour = p?.hour;
53
53
+
this.minutes = p?.minutes;
54
54
+
this.asap = p?.asap || false;
55
55
56
56
-
if (typeof p === "string") this.fromString(p);
57
57
-
}
56
56
+
if (typeof p === "string") this.fromString(p);
57
57
+
}
58
58
59
59
-
isEmpty() {
60
60
-
return (
61
61
-
!this.year &&
62
62
-
!this.month &&
63
63
-
!this.day &&
64
64
-
!this.hour &&
65
65
-
!this.minutes
66
66
-
);
67
67
-
}
59
59
+
isEmpty() {
60
60
+
return (
61
61
+
!this.year && !this.month && !this.day && !this.hour && !this.minutes
62
62
+
);
63
63
+
}
68
64
69
69
-
isLate() {
70
70
-
let d = GLib.DateTime.new_now_local();
71
71
-
if (
72
72
-
this.compare(
73
73
-
new Date({
74
74
-
year: d.get_year(),
75
75
-
month: d.get_month(),
76
76
-
day: d.get_day_of_month(),
77
77
-
hour: d.get_hour(),
78
78
-
minutes: d.get_minute(),
79
79
-
}),
80
80
-
) < 0
81
81
-
) {
82
82
-
return true;
83
83
-
}
84
84
-
return false;
85
85
-
}
65
65
+
isLate() {
66
66
+
let d = GLib.DateTime.new_now_local();
67
67
+
if (
68
68
+
this.compare(
69
69
+
new Date({
70
70
+
year: d.get_year(),
71
71
+
month: d.get_month(),
72
72
+
day: d.get_day_of_month(),
73
73
+
hour: d.get_hour(),
74
74
+
minutes: d.get_minute(),
75
75
+
}),
76
76
+
) < 0
77
77
+
) {
78
78
+
return true;
79
79
+
}
80
80
+
return false;
81
81
+
}
86
82
87
87
-
isToday() {
88
88
-
let now = GLib.DateTime.new_now_local();
89
89
-
return (
90
90
-
this.month === now.get_month() &&
91
91
-
this.day === now.get_day_of_month()
92
92
-
);
93
93
-
}
83
83
+
isToday() {
84
84
+
let now = GLib.DateTime.new_now_local();
85
85
+
return (
86
86
+
this.month === now.get_month() && this.day === now.get_day_of_month()
87
87
+
);
88
88
+
}
94
89
95
95
-
toString() {
96
96
-
if (this.asap) return " asap! ";
90
90
+
toString() {
91
91
+
if (this.asap) return " asap! ";
97
92
98
98
-
let m, d, h, min, md, hm;
99
99
-
if (this.month)
100
100
-
m = `${this.month < 10 ? `0${this.month}` : this.month}`;
101
101
-
else m = "--";
93
93
+
let m, d, h, min, md, hm;
94
94
+
if (this.month) m = `${this.month < 10 ? `0${this.month}` : this.month}`;
95
95
+
else m = "--";
102
96
103
103
-
if (this.day) d = `${this.day < 10 ? `0${this.day}` : this.day}`;
104
104
-
else d = "--";
97
97
+
if (this.day) d = `${this.day < 10 ? `0${this.day}` : this.day}`;
98
98
+
else d = "--";
105
99
106
106
-
if (this.hour) h = `${this.hour < 10 ? `0${this.hour}` : this.hour}`;
107
107
-
else h = "--";
100
100
+
if (this.hour) h = `${this.hour < 10 ? `0${this.hour}` : this.hour}`;
101
101
+
else h = "--";
108
102
109
109
-
if (this.minutes)
110
110
-
min = `${this.minutes < 10 ? `0${this.minutes}` : this.minutes}`;
111
111
-
else min = "00";
103
103
+
if (this.minutes)
104
104
+
min = `${this.minutes < 10 ? `0${this.minutes}` : this.minutes}`;
105
105
+
else min = "00";
112
106
113
113
-
md = `${m}/${d}`;
114
114
-
hm = `${h}:${min}`;
115
115
-
if (!this.month && !this.day) md = " ";
116
116
-
if (!this.hour && !this.minutes) hm = " ";
117
117
-
if (md === " " && (this.hour || this.minutes)) md = "today";
118
118
-
if (this.isToday()) md = "today";
107
107
+
md = `${m}/${d}`;
108
108
+
hm = `${h}:${min}`;
109
109
+
if (!this.month && !this.day) md = " ";
110
110
+
if (!this.hour && !this.minutes) hm = " ";
111
111
+
if (md === " " && (this.hour || this.minutes)) md = "today";
112
112
+
if (this.isToday()) md = "today";
119
113
120
120
-
return `${md} ${hm}`;
121
121
-
}
114
114
+
return `${md} ${hm}`;
115
115
+
}
122
116
123
123
-
valid() {
124
124
-
let now = GLib.DateTime.new_now_local();
125
125
-
let year = this?.year || now.get_year();
126
126
-
let month = this?.month || now.get_month();
127
127
-
let day = this?.day || now.get_day_of_month();
128
128
-
let hour = this?.hour || now.get_hour();
129
129
-
let minutes = this?.minutes || now.get_minute();
130
130
-
return GLib.DateTime.new_local(year, month, day, hour, minutes, 0);
131
131
-
}
117
117
+
valid() {
118
118
+
let now = GLib.DateTime.new_now_local();
119
119
+
let year = this?.year || now.get_year();
120
120
+
let month = this?.month || now.get_month();
121
121
+
let day = this?.day || now.get_day_of_month();
122
122
+
let hour = this?.hour || now.get_hour();
123
123
+
let minutes = this?.minutes || now.get_minute();
124
124
+
return GLib.DateTime.new_local(year, month, day, hour, minutes, 0);
125
125
+
}
132
126
133
133
-
compare(d2) {
134
134
-
if (this.asap) return -1;
135
135
-
if (d2.asap) return 1;
136
136
-
if (this.isEmpty() && d2.isEmpty()) return 0;
137
137
-
if (this.isEmpty()) return 1;
138
138
-
if (d2.isEmpty()) return -1;
127
127
+
compare(d2) {
128
128
+
if (this.asap) return -1;
129
129
+
if (d2.asap) return 1;
130
130
+
if (this.isEmpty() && d2.isEmpty()) return 0;
131
131
+
if (this.isEmpty()) return 1;
132
132
+
if (d2.isEmpty()) return -1;
139
133
140
140
-
if (this.year > d2.year) return 1;
141
141
-
else if (this.year < d2.year) return -1;
142
142
-
else if (this.month > d2.month) return 1;
143
143
-
else if (this.month < d2.month) return -1;
144
144
-
else if (this.day > d2.day) return 1;
145
145
-
else if (this.day < d2.day) return -1;
146
146
-
else if (this.hour > d2.hour) return 1;
147
147
-
else if (this.hour < d2.hour) return -1;
148
148
-
else if (this.minutes > d2.minutes) return 1;
149
149
-
else if (this.minutes < d2.minutes) return -1;
134
134
+
if (this.year > d2.year) return 1;
135
135
+
else if (this.year < d2.year) return -1;
136
136
+
else if (this.month > d2.month) return 1;
137
137
+
else if (this.month < d2.month) return -1;
138
138
+
else if (this.day > d2.day) return 1;
139
139
+
else if (this.day < d2.day) return -1;
140
140
+
else if (this.hour > d2.hour) return 1;
141
141
+
else if (this.hour < d2.hour) return -1;
142
142
+
else if (this.minutes > d2.minutes) return 1;
143
143
+
else if (this.minutes < d2.minutes) return -1;
150
144
151
151
-
return 0;
152
152
-
}
145
145
+
return 0;
146
146
+
}
153
147
154
154
-
fromString(str) {
155
155
-
let substitutes = getSubstitutes();
156
156
-
let days = substitutes.days;
157
157
-
let months = substitutes.months;
148
148
+
fromString(str) {
149
149
+
let substitutes = getSubstitutes();
150
150
+
let days = substitutes.days;
151
151
+
let months = substitutes.months;
158
152
159
159
-
str.split(" ").forEach((e) => {
160
160
-
if (e.toLowerCase() === "asap") this.asap = true;
161
161
-
if (days[e]) this.day = days[e];
162
162
-
if (months[e]) this.month = months[e];
163
163
-
let md = e.split("/");
164
164
-
if (md.length === 2) {
165
165
-
this.month = Number(md[0]);
166
166
-
this.day = Number(md[1]);
167
167
-
}
168
168
-
let hm = e.split(":");
169
169
-
if (hm.length === 2) {
170
170
-
this.hour = Number(hm[0]);
171
171
-
this.minutes = Number(hm[1]);
172
172
-
}
173
173
-
let ymd = e.split("/");
174
174
-
if (ymd.length === 3) {
175
175
-
this.year = Number(md[0]);
176
176
-
this.month = Number(md[1]);
177
177
-
this.day = Number(md[2]);
178
178
-
}
179
179
-
if (e.toLowerCase() === "today") {
180
180
-
let now = GLib.DateTime.new_now_local();
181
181
-
this.month = now.get_month();
182
182
-
this.day = now.get_day_of_month();
183
183
-
}
184
184
-
});
153
153
+
str.split(" ").forEach((e) => {
154
154
+
if (e.toLowerCase() === "asap") this.asap = true;
155
155
+
if (days[e]) this.day = days[e];
156
156
+
if (months[e]) this.month = months[e];
157
157
+
let md = e.split("/");
158
158
+
if (md.length === 2) {
159
159
+
this.month = Number(md[0]);
160
160
+
this.day = Number(md[1]);
161
161
+
}
162
162
+
let hm = e.split(":");
163
163
+
if (hm.length === 2) {
164
164
+
this.hour = Number(hm[0]);
165
165
+
this.minutes = Number(hm[1]);
166
166
+
}
167
167
+
let ymd = e.split("/");
168
168
+
if (ymd.length === 3) {
169
169
+
this.year = Number(md[0]);
170
170
+
this.month = Number(md[1]);
171
171
+
this.day = Number(md[2]);
172
172
+
}
173
173
+
if (e.toLowerCase() === "today") {
174
174
+
let now = GLib.DateTime.new_now_local();
175
175
+
this.month = now.get_month();
176
176
+
this.day = now.get_day_of_month();
177
177
+
}
178
178
+
});
185
179
186
186
-
if (this.year == NaN) this.year = undefined;
187
187
-
if (this.month == NaN) this.month = undefined;
188
188
-
if (this.day == NaN) this.day = undefined;
189
189
-
if (this.hour == NaN) this.hour = undefined;
190
190
-
if (this.minutes == NaN) this.minutes = undefined;
180
180
+
if (this.year == NaN) this.year = undefined;
181
181
+
if (this.month == NaN) this.month = undefined;
182
182
+
if (this.day == NaN) this.day = undefined;
183
183
+
if (this.hour == NaN) this.hour = undefined;
184
184
+
if (this.minutes == NaN) this.minutes = undefined;
191
185
192
192
-
if (!this.valid()) {
193
193
-
throw new Error("Wrong date");
194
194
-
}
186
186
+
if (!this.valid()) {
187
187
+
throw new Error("Wrong date");
188
188
+
}
195
189
196
196
-
return this;
197
197
-
}
190
190
+
return this;
191
191
+
}
198
192
}
199
193
200
194
class Task {
201
201
-
constructor(p) {
202
202
-
(this.title = p?.title),
203
203
-
(this.desc = p?.desc),
204
204
-
(this.date = new Date(p?.date));
205
205
-
}
195
195
+
constructor(p) {
196
196
+
(this.title = p?.title),
197
197
+
(this.desc = p?.desc),
198
198
+
(this.date = new Date(p?.date));
199
199
+
}
206
200
207
207
-
parseDate(date) {
208
208
-
this.date.fromString(date);
209
209
-
}
201
201
+
parseDate(date) {
202
202
+
this.date.fromString(date);
203
203
+
}
210
204
}
211
205
212
206
function add(input = {}) {
213
213
-
if (!input.title) throw new Error("Needs a title");
214
214
-
let tasks = getTasks();
215
215
-
tasks.push(new Task(input));
216
216
-
tasks.sort((a, b) => a.date.compare(b.date));
217
217
-
writeFile(tasks);
207
207
+
if (!input.title) throw new Error("Needs a title");
208
208
+
let tasks = getTasks();
209
209
+
tasks.push(new Task(input));
210
210
+
tasks.sort((a, b) => a.date.compare(b.date));
211
211
+
writeFile(tasks);
218
212
}
219
213
220
214
function remove(input = {}) {
221
221
-
let tasks = getTasks();
222
222
-
input.remove.split(" ").forEach((i) => {
223
223
-
if (!tasks[i - 1]) throw new Error("Index not found.");
224
224
-
tasks[i - 1] = null;
225
225
-
});
226
226
-
writeFile(tasks.filter((t) => t != null));
215
215
+
let tasks = getTasks();
216
216
+
input.remove.split(" ").forEach((i) => {
217
217
+
if (!tasks[i - 1]) throw new Error("Index not found.");
218
218
+
tasks[i - 1] = null;
219
219
+
});
220
220
+
writeFile(tasks.filter((t) => t != null));
227
221
}
228
222
229
223
function mod(input = {}) {
230
230
-
let tasks = getTasks();
224
224
+
let tasks = getTasks();
231
225
232
232
-
if (isNaN(Number(input.mod)) || !tasks[Number(input.mod) - 1])
233
233
-
throw new Error("Index not found.");
226
226
+
if (isNaN(Number(input.mod)) || !tasks[Number(input.mod) - 1])
227
227
+
throw new Error("Index not found.");
234
228
235
235
-
let task = tasks[Number(input.mod) - 1];
236
236
-
if (input.title) task.title = input.title;
237
237
-
if (input.date) task.date = new Date().fromString(input.date);
238
238
-
if (input.desc) task.desc = input.desc;
239
239
-
tasks.sort((a, b) => a.date.compare(b.date));
240
240
-
writeFile(tasks);
229
229
+
let task = tasks[Number(input.mod) - 1];
230
230
+
if (input.title) task.title = input.title;
231
231
+
if (input.date) task.date = new Date().fromString(input.date);
232
232
+
if (input.desc) task.desc = input.desc;
233
233
+
tasks.sort((a, b) => a.date.compare(b.date));
234
234
+
writeFile(tasks);
241
235
}
242
236
243
237
function printTasks(input = {}) {
244
244
-
let width = input.terminal_width || TERMINAL_WIDTH;
245
245
-
let sepLine = "",
246
246
-
sepSpace = "";
247
247
-
for (let i = 0; i < width; i++) {
248
248
-
sepLine += "─";
249
249
-
sepSpace += " ";
250
250
-
}
251
251
-
let tasks = getTasks();
238
238
+
let width = input.terminal_width || TERMINAL_WIDTH;
239
239
+
let sepLine = "",
240
240
+
sepSpace = "";
241
241
+
for (let i = 0; i < width; i++) {
242
242
+
sepLine += "─";
243
243
+
sepSpace += " ";
244
244
+
}
245
245
+
let tasks = getTasks();
252
246
253
253
-
print("");
254
254
-
print(` ╭${sepLine.substring(3)}╮`);
255
255
-
print(` │ Deadline Task${sepSpace.substring(27)}│`);
256
256
-
print(` ├${sepLine.substring(3)}┤`);
257
257
-
for (let i = 0; i < tasks.length; ++i) {
258
258
-
let title = tasks[i].title;
259
259
-
let date = tasks[i].date.toString();
260
260
-
let w = width - 24;
247
247
+
print("");
248
248
+
print(` ╭${sepLine.substring(3)}╮`);
249
249
+
print(` │ Deadline Task${sepSpace.substring(27)}│`);
250
250
+
print(` ├${sepLine.substring(3)}┤`);
251
251
+
for (let i = 0; i < tasks.length; ++i) {
252
252
+
let title = tasks[i].title;
253
253
+
let date = tasks[i].date.toString();
254
254
+
let w = width - 24;
261
255
262
262
-
print(
263
263
-
` │ ${date} ${i + 1}.${i < 9 ? " " : ""} ${title.substring(
264
264
-
0,
265
265
-
w,
266
266
-
)}${sepSpace.substring(title.length + 24)} │`,
267
267
-
);
256
256
+
print(
257
257
+
` │ ${date} ${i + 1}.${i < 9 ? " " : ""} ${title.substring(
258
258
+
0,
259
259
+
w,
260
260
+
)}${sepSpace.substring(title.length + 24)} │`,
261
261
+
);
268
262
269
269
-
// line break if title exceeds width
270
270
-
title = title.substring(w);
271
271
-
for (let i = 0; i < Math.floor(title.length / w) + 1; ++i) {
272
272
-
if (title[i * w] === " ")
273
273
-
//dont start line with space
274
274
-
title = title.substring(0, i * w - 1) + title.substring(i * w);
263
263
+
// line break if title exceeds width
264
264
+
title = title.substring(w);
265
265
+
for (let i = 0; i < Math.floor(title.length / w) + 1; ++i) {
266
266
+
if (title[i * w] === " ")
267
267
+
//dont start line with space
268
268
+
title = title.substring(0, i * w - 1) + title.substring(i * w);
275
269
276
276
-
let line = title.substring(i * w, (i + 1) * w);
277
277
-
let spaceBefore = sepSpace.substring(0, width - w - 6);
278
278
-
if (line !== "")
279
279
-
print(
280
280
-
` │ ${spaceBefore} ${line}${sepSpace.substring(
281
281
-
spaceBefore.length + line.length + 6,
282
282
-
)} │`,
283
283
-
);
284
284
-
}
285
285
-
}
286
286
-
print(` ╰${sepLine.substring(3)}╯`);
270
270
+
let line = title.substring(i * w, (i + 1) * w);
271
271
+
let spaceBefore = sepSpace.substring(0, width - w - 6);
272
272
+
if (line !== "")
273
273
+
print(
274
274
+
` │ ${spaceBefore} ${line}${sepSpace.substring(
275
275
+
spaceBefore.length + line.length + 6,
276
276
+
)} │`,
277
277
+
);
278
278
+
}
279
279
+
}
280
280
+
print(` ╰${sepLine.substring(3)}╯`);
287
281
}
288
282
289
283
function eww() {
290
290
-
let out = [],
291
291
-
id = 1;
292
292
-
let tasks = getTasks();
293
293
-
tasks.forEach((t) => (t.id = id++));
294
294
-
tasks
295
295
-
.filter((t) => t.date.month || t.date.day || t.date.hour || t.date.asap)
296
296
-
.forEach((t) =>
297
297
-
out.push({
298
298
-
asap: t.date.asap || t.date.isLate(),
299
299
-
date: t.date.toString(),
300
300
-
title: t.title,
301
301
-
id: t.id,
302
302
-
}),
303
303
-
);
284
284
+
let out = [],
285
285
+
id = 1;
286
286
+
let tasks = getTasks();
287
287
+
tasks.forEach((t) => (t.id = id++));
288
288
+
tasks
289
289
+
.filter((t) => t.date.month || t.date.day || t.date.hour || t.date.asap)
290
290
+
.forEach((t) =>
291
291
+
out.push({
292
292
+
asap: t.date.asap || t.date.isLate(),
293
293
+
date: t.date.toString(),
294
294
+
title: t.title,
295
295
+
id: t.id,
296
296
+
}),
297
297
+
);
304
298
305
305
-
print(JSON.stringify(out, null, 3));
299
299
+
print(JSON.stringify(out, null, 3));
306
300
}
307
301
308
302
function getDesc(input = {}) {
309
309
-
let tasks = getTasks();
310
310
-
if (!tasks[input.get_desc - 1]) throw new Error("Index not found.");
303
303
+
let tasks = getTasks();
304
304
+
if (!tasks[input.get_desc - 1]) throw new Error("Index not found.");
311
305
312
312
-
let width = input.terminal_width || TERMINAL_WIDTH;
313
313
-
let sepLine = "",
314
314
-
sepSpace = "";
315
315
-
for (let i = 0; i < width; i++) {
316
316
-
sepLine += "─";
317
317
-
sepSpace += " ";
318
318
-
}
306
306
+
let width = input.terminal_width || TERMINAL_WIDTH;
307
307
+
let sepLine = "",
308
308
+
sepSpace = "";
309
309
+
for (let i = 0; i < width; i++) {
310
310
+
sepLine += "─";
311
311
+
sepSpace += " ";
312
312
+
}
319
313
320
320
-
let title = tasks[input.get_desc - 1].title;
321
321
-
let desc =
322
322
-
tasks[input.get_desc - 1].desc || "No description for this task.";
323
323
-
print("");
324
324
-
print(` ╭${sepLine.substring(3)}╮`);
325
325
-
print(` │ ${title}${sepSpace.substring(title.length + 4)}│`);
326
326
-
print(` ├${sepLine.substring(3)}┤`);
314
314
+
let title = tasks[input.get_desc - 1].title;
315
315
+
let desc = tasks[input.get_desc - 1].desc || "No description for this task.";
316
316
+
print("");
317
317
+
print(` ╭${sepLine.substring(3)}╮`);
318
318
+
print(` │ ${title}${sepSpace.substring(title.length + 4)}│`);
319
319
+
print(` ├${sepLine.substring(3)}┤`);
327
320
328
328
-
let w = width - 5;
329
329
-
for (let i = 0; i < Math.floor(desc.length / w) + 1; ++i) {
330
330
-
if (desc[i * w] === " ")
331
331
-
//dont start line with space
332
332
-
desc = desc.substring(0, i * w - 1) + desc.substring(i * w);
321
321
+
let w = width - 5;
322
322
+
for (let i = 0; i < Math.floor(desc.length / w) + 1; ++i) {
323
323
+
if (desc[i * w] === " ")
324
324
+
//dont start line with space
325
325
+
desc = desc.substring(0, i * w - 1) + desc.substring(i * w);
333
326
334
334
-
let line = desc.substring(i * w, (i + 1) * w);
335
335
-
print(` │ ${line}${sepSpace.substring(line.length + 4)}│`);
336
336
-
}
337
337
-
print(` ╰${sepLine.substring(3)}╯`);
327
327
+
let line = desc.substring(i * w, (i + 1) * w);
328
328
+
print(` │ ${line}${sepSpace.substring(line.length + 4)}│`);
329
329
+
}
330
330
+
print(` ╰${sepLine.substring(3)}╯`);
338
331
}
339
332
340
333
function main() {
341
341
-
if (!ARGV[0]) return printTasks();
334
334
+
if (!ARGV[0]) return printTasks();
342
335
343
343
-
let input = {};
336
336
+
let input = {};
344
337
345
345
-
for (let i = 0; i < ARGV.length; ++i) {
346
346
-
let arg = [];
347
347
-
let cmd = ARGV[i];
348
348
-
for (let j = i + 1; j < ARGV.length && ARGV[j][0] !== "-"; ++j)
349
349
-
arg.push(ARGV[j]);
338
338
+
for (let i = 0; i < ARGV.length; ++i) {
339
339
+
let arg = [];
340
340
+
let cmd = ARGV[i];
341
341
+
for (let j = i + 1; j < ARGV.length && ARGV[j][0] !== "-"; ++j)
342
342
+
arg.push(ARGV[j]);
350
343
351
351
-
switch (cmd) {
352
352
-
case "--eww":
353
353
-
input.eww = true;
354
354
-
break;
355
355
-
case "-m":
356
356
-
input.mod = arg.join(" ");
357
357
-
break;
358
358
-
case "--mod":
359
359
-
input.mod = arg.join(" ");
360
360
-
break;
361
361
-
case "-t":
362
362
-
input.title = arg.join(" ");
363
363
-
break;
364
364
-
case "--title":
365
365
-
input.title = arg.join(" ");
366
366
-
break;
367
367
-
case "-a":
368
368
-
input.title = arg.join(" ");
369
369
-
break;
370
370
-
case "--add":
371
371
-
input.title = arg.join(" ");
372
372
-
break;
373
373
-
case "-D":
374
374
-
input.desc = arg.join(" ");
375
375
-
break;
376
376
-
case "--description":
377
377
-
input.desc = arg.join(" ");
378
378
-
break;
379
379
-
case "--desc":
380
380
-
input.desc = arg.join(" ");
381
381
-
break;
382
382
-
case "-d":
383
383
-
input.date = arg.join(" ");
384
384
-
break;
385
385
-
case "--date":
386
386
-
input.date = arg.join(" ");
387
387
-
break;
388
388
-
case "--due":
389
389
-
input.date = arg.join(" ");
390
390
-
break;
391
391
-
case "-r":
392
392
-
input.remove = arg.join(" ");
393
393
-
break;
394
394
-
case "--remove":
395
395
-
input.remove = arg.join(" ");
396
396
-
break;
397
397
-
case "--rem":
398
398
-
input.remove = arg.join(" ");
399
399
-
break;
400
400
-
case "-w":
401
401
-
input.terminal_width = arg.join(" ");
402
402
-
break;
403
403
-
case "--width":
404
404
-
input.terminal_width = arg.join(" ");
405
405
-
break;
406
406
-
case "-w":
407
407
-
input.terminal_width = arg.join(" ");
408
408
-
break;
409
409
-
case "--width":
410
410
-
input.terminal_width = arg.join(" ");
411
411
-
break;
412
412
-
case "-g":
413
413
-
input.get_desc = arg.join(" ");
414
414
-
break;
415
415
-
case "--get-desc":
416
416
-
input.get_desc = arg.join(" ");
417
417
-
break;
418
418
-
default:
419
419
-
input.title = cmd + " " + arg.join(" ");
420
420
-
break;
421
421
-
}
422
422
-
i += arg.length;
423
423
-
}
344
344
+
switch (cmd) {
345
345
+
case "--eww":
346
346
+
input.eww = true;
347
347
+
break;
348
348
+
case "-m":
349
349
+
input.mod = arg.join(" ");
350
350
+
break;
351
351
+
case "--mod":
352
352
+
input.mod = arg.join(" ");
353
353
+
break;
354
354
+
case "-t":
355
355
+
input.title = arg.join(" ");
356
356
+
break;
357
357
+
case "--title":
358
358
+
input.title = arg.join(" ");
359
359
+
break;
360
360
+
case "-a":
361
361
+
input.title = arg.join(" ");
362
362
+
break;
363
363
+
case "--add":
364
364
+
input.title = arg.join(" ");
365
365
+
break;
366
366
+
case "-D":
367
367
+
input.desc = arg.join(" ");
368
368
+
break;
369
369
+
case "--description":
370
370
+
input.desc = arg.join(" ");
371
371
+
break;
372
372
+
case "--desc":
373
373
+
input.desc = arg.join(" ");
374
374
+
break;
375
375
+
case "-d":
376
376
+
input.date = arg.join(" ");
377
377
+
break;
378
378
+
case "--date":
379
379
+
input.date = arg.join(" ");
380
380
+
break;
381
381
+
case "--due":
382
382
+
input.date = arg.join(" ");
383
383
+
break;
384
384
+
case "-r":
385
385
+
input.remove = arg.join(" ");
386
386
+
break;
387
387
+
case "--remove":
388
388
+
input.remove = arg.join(" ");
389
389
+
break;
390
390
+
case "--rem":
391
391
+
input.remove = arg.join(" ");
392
392
+
break;
393
393
+
case "-w":
394
394
+
input.terminal_width = arg.join(" ");
395
395
+
break;
396
396
+
case "--width":
397
397
+
input.terminal_width = arg.join(" ");
398
398
+
break;
399
399
+
case "-w":
400
400
+
input.terminal_width = arg.join(" ");
401
401
+
break;
402
402
+
case "--width":
403
403
+
input.terminal_width = arg.join(" ");
404
404
+
break;
405
405
+
case "-g":
406
406
+
input.get_desc = arg.join(" ");
407
407
+
break;
408
408
+
case "--get-desc":
409
409
+
input.get_desc = arg.join(" ");
410
410
+
break;
411
411
+
default:
412
412
+
input.title = cmd + " " + arg.join(" ");
413
413
+
break;
414
414
+
}
415
415
+
i += arg.length;
416
416
+
}
424
417
425
425
-
if (input.remove) remove(input);
426
426
-
else if (input.mod) mod(input);
427
427
-
else if (input.eww) eww();
428
428
-
else if (input.get_desc) getDesc(input);
429
429
-
else if (input.title) add(input);
418
418
+
if (input.remove) remove(input);
419
419
+
else if (input.mod) mod(input);
420
420
+
else if (input.eww) eww();
421
421
+
else if (input.get_desc) getDesc(input);
422
422
+
else if (input.title) add(input);
430
423
431
431
-
if (!input.eww && !input.get_desc) printTasks(input);
424
424
+
if (!input.eww && !input.get_desc) printTasks(input);
432
425
}
433
426
434
427
main();
+122
-128
home/isabel/programs/configs/gui/bars/eww/config/scss/common.scss
···
1
1
@mixin widget($radii: $widget_radius) {
2
2
-
border-radius: $radii;
3
3
-
color: $fg_color;
4
4
-
background-color: $widget_bg;
5
5
-
box-shadow: inset 0 0 0 $border_width $border_color;
2
2
+
border-radius: $radii;
3
3
+
color: $fg_color;
4
4
+
background-color: $widget_bg;
5
5
+
box-shadow: inset 0 0 0 $border_width $border_color;
6
6
}
7
7
8
8
@mixin button(
9
9
-
$flat: false,
10
10
-
$interactive: true,
11
11
-
$radii: $radii,
12
12
-
$focusable: false
9
9
+
$flat: false,
10
10
+
$interactive: true,
11
11
+
$radii: $radii,
12
12
+
$focusable: false
13
13
) {
14
14
-
border-radius: $radii;
15
15
-
color: $fg_color;
14
14
+
border-radius: $radii;
15
15
+
color: $fg_color;
16
16
17
17
-
@if $flat {
18
18
-
background-color: transparent;
19
19
-
background-image: none;
20
20
-
box-shadow: none;
21
21
-
} @else {
22
22
-
background-color: $button_bg;
23
23
-
box-shadow: inset 0 0 0 $border_width $border_color;
24
24
-
}
17
17
+
@if $flat {
18
18
+
background-color: transparent;
19
19
+
background-image: none;
20
20
+
box-shadow: none;
21
21
+
} @else {
22
22
+
background-color: $button_bg;
23
23
+
box-shadow: inset 0 0 0 $border_width $border_color;
24
24
+
}
25
25
26
26
-
@if $interactive {
27
27
-
@if $focusable {
28
28
-
&:focus {
29
29
-
box-shadow: inset 0 0 0 $border_width $accent;
30
30
-
background-color: $hover;
31
31
-
color: $hover_fg;
32
32
-
}
33
33
-
}
26
26
+
@if $interactive {
27
27
+
@if $focusable {
28
28
+
&:focus {
29
29
+
box-shadow: inset 0 0 0 $border_width $accent;
30
30
+
background-color: $hover;
31
31
+
color: $hover_fg;
32
32
+
}
33
33
+
}
34
34
35
35
-
&:hover {
36
36
-
box-shadow: inset 0 0 0 $border_width $border_color;
37
37
-
background-color: $hover;
38
38
-
color: $hover_fg;
39
39
-
}
35
35
+
&:hover {
36
36
+
box-shadow: inset 0 0 0 $border_width $border_color;
37
37
+
background-color: $hover;
38
38
+
color: $hover_fg;
39
39
+
}
40
40
41
41
-
&:active {
42
42
-
box-shadow: inset 0 0 0 $border_width $border_color;
43
43
-
background-color: $accent;
44
44
-
color: $accent_fg;
45
45
-
}
46
46
-
}
41
41
+
&:active {
42
42
+
box-shadow: inset 0 0 0 $border_width $border_color;
43
43
+
background-color: $accent;
44
44
+
color: $accent_fg;
45
45
+
}
46
46
+
}
47
47
}
48
48
49
49
@mixin floating_widget($shadow: true, $padding: $popover_padding) {
50
50
-
@if $shadow {
51
51
-
box-shadow:
52
52
-
0 0 5px 0 rgba(0, 0, 0, 0.6),
53
53
-
inset 0 0 0 $border_width $popover_border_color;
54
54
-
} @else {
55
55
-
box-shadow: inset 0 0 0 $border_width $popover_border_color;
56
56
-
}
50
50
+
@if $shadow {
51
51
+
box-shadow:
52
52
+
0 0 5px 0 rgba(0, 0, 0, 0.6),
53
53
+
inset 0 0 0 $border_width $popover_border_color;
54
54
+
} @else {
55
55
+
box-shadow: inset 0 0 0 $border_width $popover_border_color;
56
56
+
}
57
57
58
58
-
border-radius: $popover_radius;
59
59
-
margin: $wm_gaps;
60
60
-
background-color: $bg_color;
61
61
-
color: $fg_color;
62
62
-
padding: $padding;
58
58
+
border-radius: $popover_radius;
59
59
+
margin: $wm_gaps;
60
60
+
background-color: $bg_color;
61
61
+
color: $fg_color;
62
62
+
padding: $padding;
63
63
}
64
64
65
65
@mixin slider(
66
66
-
$width: 0.4em,
67
67
-
$color: $accent,
68
68
-
$slider: true,
69
69
-
$focusable: false
66
66
+
$width: 0.4em,
67
67
+
$color: $accent,
68
68
+
$slider: true,
69
69
+
$focusable: false
70
70
) {
71
71
-
trough {
72
72
-
border-radius: $button_radius;
73
73
-
border: $border;
74
74
-
background-color: $button_bg;
75
75
-
min-height: $width;
76
76
-
min-width: $width;
71
71
+
trough {
72
72
+
border-radius: $button_radius;
73
73
+
border: $border;
74
74
+
background-color: $button_bg;
75
75
+
min-height: $width;
76
76
+
min-width: $width;
77
77
78
78
-
highlight,
79
79
-
progress {
80
80
-
border-radius: $popover_radius * 0.8;
81
81
-
background-color: $color;
82
82
-
min-height: $width;
83
83
-
min-width: $width;
84
84
-
}
78
78
+
highlight,
79
79
+
progress {
80
80
+
border-radius: $popover_radius * 0.8;
81
81
+
background-color: $color;
82
82
+
min-height: $width;
83
83
+
min-width: $width;
84
84
+
}
85
85
86
86
-
slider {
87
87
-
@if $slider {
88
88
-
background-color: $fg_color;
89
89
-
border-radius: $button_radius;
90
90
-
border: $border;
91
91
-
min-height: $width;
92
92
-
min-width: $width;
93
93
-
}
94
94
-
}
95
95
-
}
86
86
+
slider {
87
87
+
@if $slider {
88
88
+
background-color: $fg_color;
89
89
+
border-radius: $button_radius;
90
90
+
border: $border;
91
91
+
min-height: $width;
92
92
+
min-width: $width;
93
93
+
}
94
94
+
}
95
95
+
}
96
96
97
97
-
&:hover trough {
98
98
-
background-color: $hover;
99
99
-
}
97
97
+
&:hover trough {
98
98
+
background-color: $hover;
99
99
+
}
100
100
101
101
-
@if $focusable {
102
102
-
trough:focus {
103
103
-
background-color: $hover;
104
104
-
box-shadow: inset 0 0 0 $border_width $accent;
101
101
+
@if $focusable {
102
102
+
trough:focus {
103
103
+
background-color: $hover;
104
104
+
box-shadow: inset 0 0 0 $border_width $accent;
105
105
106
106
-
highlight,
107
107
-
progress {
108
108
-
background-color: transparentize($color, 0.3);
109
109
-
}
110
110
-
}
111
111
-
}
106
106
+
highlight,
107
107
+
progress {
108
108
+
background-color: transparentize($color, 0.3);
109
109
+
}
110
110
+
}
111
111
+
}
112
112
}
113
113
114
114
@mixin darkened($radii: 0) {
115
115
-
border-radius: $radii * 0.99;
115
115
+
border-radius: $radii * 0.99;
116
116
117
117
-
@if $theme == "dark" {
118
118
-
box-shadow: inset 0 0 3em 1em transparentize($bg_color, 0.1);
119
119
-
}
117
117
+
@if $theme == "dark" {
118
118
+
box-shadow: inset 0 0 3em 1em transparentize($bg_color, 0.1);
119
119
+
}
120
120
121
121
-
@if $theme == "light" {
122
122
-
background-color: transparentize($bg_color, 0.5);
123
123
-
}
121
121
+
@if $theme == "light" {
122
122
+
background-color: transparentize($bg_color, 0.5);
123
123
+
}
124
124
}
125
125
126
126
@mixin tooltip {
127
127
-
> * > * {
128
128
-
background-color: $bg_color;
129
129
-
border-radius: $button_radius;
130
130
-
border: $border_width solid $popover_border_color;
131
131
-
color: $fg_color;
132
132
-
padding: 8px;
133
133
-
margin: 4px;
134
134
-
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.4);
135
135
-
}
127
127
+
> * > * {
128
128
+
background-color: $bg_color;
129
129
+
border-radius: $button_radius;
130
130
+
border: $border_width solid $popover_border_color;
131
131
+
color: $fg_color;
132
132
+
padding: 8px;
133
133
+
margin: 4px;
134
134
+
box-shadow: 0 0 3px 0 rgba(0, 0, 0, 0.4);
135
135
+
}
136
136
}
137
137
138
138
@mixin scrollbar {
139
139
-
scrollbar.vertical {
140
140
-
slider {
141
141
-
background: $widget_bg;
142
142
-
border-radius: $radii;
143
143
-
min-width: 0.6em;
144
144
-
min-height: 2em;
145
145
-
}
146
146
-
}
147
147
-
overshoot {
148
148
-
border-radius: $radii;
149
149
-
&.top {
150
150
-
background: linear-gradient(
151
151
-
transparentize($bg_color, 0.6),
152
152
-
transparent
153
153
-
);
154
154
-
}
155
155
-
&.bottom {
156
156
-
background: linear-gradient(
157
157
-
transparent,
158
158
-
transparentize($bg_color, 0.6)
159
159
-
);
160
160
-
}
161
161
-
}
139
139
+
scrollbar.vertical {
140
140
+
slider {
141
141
+
background: $widget_bg;
142
142
+
border-radius: $radii;
143
143
+
min-width: 0.6em;
144
144
+
min-height: 2em;
145
145
+
}
146
146
+
}
147
147
+
overshoot {
148
148
+
border-radius: $radii;
149
149
+
&.top {
150
150
+
background: linear-gradient(transparentize($bg_color, 0.6), transparent);
151
151
+
}
152
152
+
&.bottom {
153
153
+
background: linear-gradient(transparent, transparentize($bg_color, 0.6));
154
154
+
}
155
155
+
}
162
156
}
+4
-4
home/isabel/programs/configs/gui/bars/eww/config/scss/variables.scss
···
31
31
$popover_padding: 14px;
32
32
33
33
* {
34
34
-
all: unset;
35
35
-
font-size: 14px;
36
36
-
font-family: "Ubuntu Nerd Font";
37
37
-
transition: 200ms;
34
34
+
all: unset;
35
35
+
font-size: 14px;
36
36
+
font-family: "Ubuntu Nerd Font";
37
37
+
transition: 200ms;
38
38
}
39
39
40
40
$mono_font: "mononoki Nerd Font";
+94
-94
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/bar_widget.scss
···
1
1
@mixin system-indicators($orientation) {
2
2
-
@include button($flat: false, $radii: $panel_button_radius);
3
3
-
.reveal {
4
4
-
@if $orientation == "v" {
5
5
-
padding-top: 0.5em;
6
6
-
}
7
7
-
@if $orientation == "h" {
8
8
-
padding-left: 0.2em;
9
9
-
}
10
10
-
}
11
11
-
.slider {
12
12
-
@include slider($width: 1em, $slider: false);
13
13
-
@if $orientation == "v" {
14
14
-
> * {
15
15
-
min-height: 80px;
16
16
-
}
17
17
-
}
18
18
-
@if $orientation == "h" {
19
19
-
> * {
20
20
-
min-width: 90px;
21
21
-
}
22
22
-
}
23
23
-
}
24
24
-
.icon {
25
25
-
margin: 0.1em 0;
26
26
-
&.battery {
27
27
-
&.low {
28
28
-
color: $destructive;
29
29
-
}
30
30
-
&.charging {
31
31
-
color: $succes;
32
32
-
}
33
33
-
&.charged {
34
34
-
color: $succes;
35
35
-
}
36
36
-
}
37
37
-
&.notifications.active {
38
38
-
color: $yellow;
39
39
-
}
40
40
-
&.network {
41
41
-
&.none,
42
42
-
&.low {
43
43
-
color: $red;
44
44
-
}
45
45
-
&.medium {
46
46
-
}
47
47
-
&.high {
48
48
-
color: $blue;
49
49
-
}
50
50
-
}
51
51
-
&.bluetooth,
52
52
-
&.bt_speaker {
53
53
-
color: $blue;
54
54
-
}
55
55
-
}
2
2
+
@include button($flat: false, $radii: $panel_button_radius);
3
3
+
.reveal {
4
4
+
@if $orientation == "v" {
5
5
+
padding-top: 0.5em;
6
6
+
}
7
7
+
@if $orientation == "h" {
8
8
+
padding-left: 0.2em;
9
9
+
}
10
10
+
}
11
11
+
.slider {
12
12
+
@include slider($width: 1em, $slider: false);
13
13
+
@if $orientation == "v" {
14
14
+
> * {
15
15
+
min-height: 80px;
16
16
+
}
17
17
+
}
18
18
+
@if $orientation == "h" {
19
19
+
> * {
20
20
+
min-width: 90px;
21
21
+
}
22
22
+
}
23
23
+
}
24
24
+
.icon {
25
25
+
margin: 0.1em 0;
26
26
+
&.battery {
27
27
+
&.low {
28
28
+
color: $destructive;
29
29
+
}
30
30
+
&.charging {
31
31
+
color: $succes;
32
32
+
}
33
33
+
&.charged {
34
34
+
color: $succes;
35
35
+
}
36
36
+
}
37
37
+
&.notifications.active {
38
38
+
color: $yellow;
39
39
+
}
40
40
+
&.network {
41
41
+
&.none,
42
42
+
&.low {
43
43
+
color: $red;
44
44
+
}
45
45
+
&.medium {
46
46
+
}
47
47
+
&.high {
48
48
+
color: $blue;
49
49
+
}
50
50
+
}
51
51
+
&.bluetooth,
52
52
+
&.bt_speaker {
53
53
+
color: $blue;
54
54
+
}
55
55
+
}
56
56
}
57
57
58
58
@mixin panel_media() {
59
59
-
.player {
60
60
-
@include button($flat: true, $radii: $panel_button_radius);
61
61
-
}
62
62
-
.controls {
63
63
-
@include button($radii: $panel_button_radius);
64
64
-
button {
65
65
-
&.prev,
66
66
-
&.next,
67
67
-
&.play-pause {
68
68
-
color: transparentize($fg_color, 0.3);
69
69
-
&:hover {
70
70
-
color: transparentize($fg_color, 0.15);
71
71
-
}
72
72
-
&:active {
73
73
-
color: $fg_color;
74
74
-
}
75
75
-
}
76
76
-
}
77
77
-
}
78
78
-
.icon {
79
79
-
&.spotify {
80
80
-
color: $green;
81
81
-
}
82
82
-
&.firefox {
83
83
-
color: $orange;
84
84
-
}
85
85
-
&.mpv {
86
86
-
color: $magenta;
87
87
-
}
88
88
-
}
59
59
+
.player {
60
60
+
@include button($flat: true, $radii: $panel_button_radius);
61
61
+
}
62
62
+
.controls {
63
63
+
@include button($radii: $panel_button_radius);
64
64
+
button {
65
65
+
&.prev,
66
66
+
&.next,
67
67
+
&.play-pause {
68
68
+
color: transparentize($fg_color, 0.3);
69
69
+
&:hover {
70
70
+
color: transparentize($fg_color, 0.15);
71
71
+
}
72
72
+
&:active {
73
73
+
color: $fg_color;
74
74
+
}
75
75
+
}
76
76
+
}
77
77
+
}
78
78
+
.icon {
79
79
+
&.spotify {
80
80
+
color: $green;
81
81
+
}
82
82
+
&.firefox {
83
83
+
color: $orange;
84
84
+
}
85
85
+
&.mpv {
86
86
+
color: $magenta;
87
87
+
}
88
88
+
}
89
89
}
90
90
91
91
@mixin workspaces() {
92
92
-
@include button($flat: false, $radii: $panel_button_radius);
93
93
-
.workspace-btn {
94
94
-
color: $fg_color;
95
95
-
.focus {
96
96
-
color: $accent;
97
97
-
}
98
98
-
&:hover {
99
99
-
color: darken($fg_color, 0.3);
100
100
-
}
101
101
-
}
92
92
+
@include button($flat: false, $radii: $panel_button_radius);
93
93
+
.workspace-btn {
94
94
+
color: $fg_color;
95
95
+
.focus {
96
96
+
color: $accent;
97
97
+
}
98
98
+
&:hover {
99
99
+
color: darken($fg_color, 0.3);
100
100
+
}
101
101
+
}
102
102
}
+24
-24
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/calendar.scss
···
1
1
@mixin calendar() {
2
2
-
calendar {
3
3
-
&.button {
4
4
-
@include button($flat: true);
5
5
-
margin: 1em;
6
6
-
}
2
2
+
calendar {
3
3
+
&.button {
4
4
+
@include button($flat: true);
5
5
+
margin: 1em;
6
6
+
}
7
7
8
8
-
&:selected {
9
9
-
border: 2px solid $accent;
10
10
-
border-radius: $button_radius;
11
11
-
}
8
8
+
&:selected {
9
9
+
border: 2px solid $accent;
10
10
+
border-radius: $button_radius;
11
11
+
}
12
12
13
13
-
&.header {
14
14
-
background-color: transparent;
15
15
-
border: none;
16
16
-
color: transparentize($fg_color, 0.5);
17
17
-
}
13
13
+
&.header {
14
14
+
background-color: transparent;
15
15
+
border: none;
16
16
+
color: transparentize($fg_color, 0.5);
17
17
+
}
18
18
19
19
-
&.highlight {
20
20
-
background-color: transparent;
21
21
-
color: transparentize($accent, 0.5);
22
22
-
}
19
19
+
&.highlight {
20
20
+
background-color: transparent;
21
21
+
color: transparentize($accent, 0.5);
22
22
+
}
23
23
24
24
-
&:indeterminate {
25
25
-
color: transparentize($fg_color, 0.9);
26
26
-
}
24
24
+
&:indeterminate {
25
25
+
color: transparentize($fg_color, 0.9);
26
26
+
}
27
27
28
28
-
font-size: 1.2em;
29
29
-
padding: 0.2em;
30
30
-
}
28
28
+
font-size: 1.2em;
29
29
+
padding: 0.2em;
30
30
+
}
31
31
}
+38
-38
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/events.scss
···
1
1
@mixin events {
2
2
-
label {
3
3
-
font-size: 1.1em;
4
4
-
}
2
2
+
label {
3
3
+
font-size: 1.1em;
4
4
+
}
5
5
6
6
-
.title-box {
7
7
-
padding: $spacing;
8
8
-
border-bottom: 1px solid transparentize($fg_color, 0.9);
6
6
+
.title-box {
7
7
+
padding: $spacing;
8
8
+
border-bottom: 1px solid transparentize($fg_color, 0.9);
9
9
10
10
-
label {
11
11
-
font-size: 1.1em;
12
12
-
}
13
13
-
}
10
10
+
label {
11
11
+
font-size: 1.1em;
12
12
+
}
13
13
+
}
14
14
15
15
-
.events-box {
16
16
-
padding: $spacing;
17
17
-
}
15
15
+
.events-box {
16
16
+
padding: $spacing;
17
17
+
}
18
18
19
19
-
.event {
20
20
-
.deadline {
21
21
-
color: transparentize($fg_color, 0.5);
22
22
-
font-family: $mono_font;
23
23
-
}
19
19
+
.event {
20
20
+
.deadline {
21
21
+
color: transparentize($fg_color, 0.5);
22
22
+
font-family: $mono_font;
23
23
+
}
24
24
25
25
-
&.done {
26
26
-
label {
27
27
-
text-decoration: line-through;
28
28
-
}
25
25
+
&.done {
26
26
+
label {
27
27
+
text-decoration: line-through;
28
28
+
}
29
29
30
30
-
.title {
31
31
-
color: $green;
32
32
-
}
30
30
+
.title {
31
31
+
color: $green;
32
32
+
}
33
33
34
34
-
.deadline {
35
35
-
color: transparentize($green, 0.5);
36
36
-
}
37
37
-
}
34
34
+
.deadline {
35
35
+
color: transparentize($green, 0.5);
36
36
+
}
37
37
+
}
38
38
39
39
-
&.upcoming {
40
40
-
.title {
41
41
-
color: $red;
42
42
-
}
39
39
+
&.upcoming {
40
40
+
.title {
41
41
+
color: $red;
42
42
+
}
43
43
44
44
-
.deadline {
45
45
-
color: transparentize($red, 0.5);
46
46
-
}
47
47
-
}
48
48
-
}
44
44
+
.deadline {
45
45
+
color: transparentize($red, 0.5);
46
46
+
}
47
47
+
}
48
48
+
}
49
49
}
+145
-145
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/media.scss
···
1
1
@mixin media($style: "widget", $height: 12em) {
2
2
-
@if $style == "widget" {
3
3
-
@include widget;
4
4
-
}
5
5
-
@if $style == "popover" {
6
6
-
@include floating_widget;
7
7
-
}
8
8
-
border-radius: $radii;
9
9
-
margin: $spacing;
10
10
-
min-height: $height;
11
11
-
padding: 0;
12
12
-
text-shadow: $text_shadow;
13
13
-
.cover {
14
14
-
@if $style == "widget" {
15
15
-
@include widget;
16
16
-
}
17
17
-
@if $style == "popover" {
18
18
-
border-radius: $radii;
19
19
-
}
20
20
-
background-size: cover;
21
21
-
background-position: center;
22
22
-
.darkened {
23
23
-
@if $style == "widget" {
24
24
-
@include darkened($radii: $button_radius);
25
25
-
}
26
26
-
@if $style == "popover" {
27
27
-
@include darkened($radii: $radii);
28
28
-
}
29
29
-
}
30
30
-
.slider {
31
31
-
@include slider(
32
32
-
$width: 0.4em,
33
33
-
$slider: false,
34
34
-
$color: transparentize($fg_color, 0.3)
35
35
-
);
36
36
-
scale > contents {
37
37
-
trough {
38
38
-
border-radius: 0;
39
39
-
border: 0;
40
40
-
highlight {
41
41
-
border-radius: 0;
42
42
-
}
43
43
-
}
44
44
-
}
45
45
-
}
46
46
-
.box {
47
47
-
margin: $spacing;
48
48
-
}
49
49
-
.artist {
50
50
-
font-size: 1.2em;
51
51
-
}
52
52
-
.title,
53
53
-
.position {
54
54
-
color: transparentize($fg_color, 0.2);
55
55
-
}
56
56
-
.icon.player {
57
57
-
font-size: 1.4em;
58
58
-
margin-left: 0.6em;
59
59
-
}
60
60
-
.controls {
61
61
-
margin: $spacing;
62
62
-
button {
63
63
-
label {
64
64
-
font-size: 2em;
65
65
-
}
66
66
-
&.loop,
67
67
-
&.shuffle {
68
68
-
label {
69
69
-
font-size: 1.2em;
70
70
-
}
71
71
-
}
72
72
-
color: transparentize($fg_color, 0.3);
73
73
-
&:hover {
74
74
-
color: $fg_color;
75
75
-
}
76
76
-
&.active {
77
77
-
color: $accent;
78
78
-
}
79
79
-
&.inactive {
80
80
-
color: transparentize($fg_color, 0.7);
81
81
-
text-shadow: none;
82
82
-
}
83
83
-
&.loop {
84
84
-
&.Playlist {
85
85
-
color: transparentize($accent, 0.2);
86
86
-
}
87
87
-
&.Track {
88
88
-
color: $accent;
89
89
-
}
90
90
-
}
91
91
-
}
92
92
-
}
93
93
-
}
94
94
-
.sidebar {
95
95
-
.slider {
96
96
-
@include slider($width: 0.6em, $slider: false);
97
97
-
}
98
98
-
margin: $spacing * 2;
99
99
-
}
2
2
+
@if $style == "widget" {
3
3
+
@include widget;
4
4
+
}
5
5
+
@if $style == "popover" {
6
6
+
@include floating_widget;
7
7
+
}
8
8
+
border-radius: $radii;
9
9
+
margin: $spacing;
10
10
+
min-height: $height;
11
11
+
padding: 0;
12
12
+
text-shadow: $text_shadow;
13
13
+
.cover {
14
14
+
@if $style == "widget" {
15
15
+
@include widget;
16
16
+
}
17
17
+
@if $style == "popover" {
18
18
+
border-radius: $radii;
19
19
+
}
20
20
+
background-size: cover;
21
21
+
background-position: center;
22
22
+
.darkened {
23
23
+
@if $style == "widget" {
24
24
+
@include darkened($radii: $button_radius);
25
25
+
}
26
26
+
@if $style == "popover" {
27
27
+
@include darkened($radii: $radii);
28
28
+
}
29
29
+
}
30
30
+
.slider {
31
31
+
@include slider(
32
32
+
$width: 0.4em,
33
33
+
$slider: false,
34
34
+
$color: transparentize($fg_color, 0.3)
35
35
+
);
36
36
+
scale > contents {
37
37
+
trough {
38
38
+
border-radius: 0;
39
39
+
border: 0;
40
40
+
highlight {
41
41
+
border-radius: 0;
42
42
+
}
43
43
+
}
44
44
+
}
45
45
+
}
46
46
+
.box {
47
47
+
margin: $spacing;
48
48
+
}
49
49
+
.artist {
50
50
+
font-size: 1.2em;
51
51
+
}
52
52
+
.title,
53
53
+
.position {
54
54
+
color: transparentize($fg_color, 0.2);
55
55
+
}
56
56
+
.icon.player {
57
57
+
font-size: 1.4em;
58
58
+
margin-left: 0.6em;
59
59
+
}
60
60
+
.controls {
61
61
+
margin: $spacing;
62
62
+
button {
63
63
+
label {
64
64
+
font-size: 2em;
65
65
+
}
66
66
+
&.loop,
67
67
+
&.shuffle {
68
68
+
label {
69
69
+
font-size: 1.2em;
70
70
+
}
71
71
+
}
72
72
+
color: transparentize($fg_color, 0.3);
73
73
+
&:hover {
74
74
+
color: $fg_color;
75
75
+
}
76
76
+
&.active {
77
77
+
color: $accent;
78
78
+
}
79
79
+
&.inactive {
80
80
+
color: transparentize($fg_color, 0.7);
81
81
+
text-shadow: none;
82
82
+
}
83
83
+
&.loop {
84
84
+
&.Playlist {
85
85
+
color: transparentize($accent, 0.2);
86
86
+
}
87
87
+
&.Track {
88
88
+
color: $accent;
89
89
+
}
90
90
+
}
91
91
+
}
92
92
+
}
93
93
+
}
94
94
+
.sidebar {
95
95
+
.slider {
96
96
+
@include slider($width: 0.6em, $slider: false);
97
97
+
}
98
98
+
margin: $spacing * 2;
99
99
+
}
100
100
101
101
-
&.spotify {
102
102
-
.icon.player {
103
103
-
color: $green;
104
104
-
}
105
105
-
.sidebar .slider {
106
106
-
@include slider($width: 0.6em, $slider: false, $color: $green);
107
107
-
}
108
108
-
.controls button {
109
109
-
&.active {
110
110
-
color: $green;
111
111
-
}
112
112
-
&.loop {
113
113
-
&.Playlist {
114
114
-
color: transparentize($green, 0.2);
115
115
-
}
116
116
-
&.Track {
117
117
-
color: $green;
118
118
-
}
119
119
-
}
120
120
-
}
121
121
-
}
101
101
+
&.spotify {
102
102
+
.icon.player {
103
103
+
color: $green;
104
104
+
}
105
105
+
.sidebar .slider {
106
106
+
@include slider($width: 0.6em, $slider: false, $color: $green);
107
107
+
}
108
108
+
.controls button {
109
109
+
&.active {
110
110
+
color: $green;
111
111
+
}
112
112
+
&.loop {
113
113
+
&.Playlist {
114
114
+
color: transparentize($green, 0.2);
115
115
+
}
116
116
+
&.Track {
117
117
+
color: $green;
118
118
+
}
119
119
+
}
120
120
+
}
121
121
+
}
122
122
123
123
-
&.firefox {
124
124
-
.icon.player {
125
125
-
color: $orange;
126
126
-
}
127
127
-
}
123
123
+
&.firefox {
124
124
+
.icon.player {
125
125
+
color: $orange;
126
126
+
}
127
127
+
}
128
128
129
129
-
&.mpv {
130
130
-
.icon.player {
131
131
-
color: $magenta;
132
132
-
}
133
133
-
.sidebar .slider {
134
134
-
@include slider($width: 0.6em, $slider: false, $color: $magenta);
135
135
-
}
136
136
-
.controls button {
137
137
-
&.active {
138
138
-
color: $magenta;
139
139
-
}
140
140
-
&.loop {
141
141
-
&.Playlist {
142
142
-
color: transparentize($magenta, 0.2);
143
143
-
}
144
144
-
&.Track {
145
145
-
color: $magenta;
146
146
-
}
147
147
-
}
148
148
-
}
149
149
-
}
129
129
+
&.mpv {
130
130
+
.icon.player {
131
131
+
color: $magenta;
132
132
+
}
133
133
+
.sidebar .slider {
134
134
+
@include slider($width: 0.6em, $slider: false, $color: $magenta);
135
135
+
}
136
136
+
.controls button {
137
137
+
&.active {
138
138
+
color: $magenta;
139
139
+
}
140
140
+
&.loop {
141
141
+
&.Playlist {
142
142
+
color: transparentize($magenta, 0.2);
143
143
+
}
144
144
+
&.Track {
145
145
+
color: $magenta;
146
146
+
}
147
147
+
}
148
148
+
}
149
149
+
}
150
150
}
+54
-54
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/notification.scss
···
1
1
@mixin notification() {
2
2
-
.notification-content {
3
3
-
padding: $popover_padding;
4
4
-
.title {
5
5
-
font-size: 1.2em;
6
6
-
font-weight: 600;
7
7
-
margin-bottom: $popover_padding/2;
8
8
-
}
9
9
-
.image {
10
10
-
min-width: 80px;
11
11
-
min-height: 80px;
12
12
-
background-size: cover;
13
13
-
margin-right: $popover_padding;
14
14
-
border-radius: $button_radius;
15
15
-
}
16
16
-
.action-button {
17
17
-
@include button;
18
18
-
font-size: 1.1em;
19
19
-
font-weight: 500;
20
20
-
padding: 0.5em;
21
21
-
margin-top: $popover_padding;
22
22
-
&:first-child {
23
23
-
margin-right: $popover_padding/2;
24
24
-
}
25
25
-
&:last-child {
26
26
-
margin-left: $popover_padding/2;
27
27
-
}
28
28
-
&:first-child:last-child {
29
29
-
margin-left: 0;
30
30
-
margin-right: 0;
31
31
-
}
32
32
-
}
33
33
-
.close-button {
34
34
-
min-width: 1.4em;
35
35
-
min-height: 1.4em;
36
36
-
}
37
37
-
.time {
38
38
-
color: transparentize($fg_color, 0.4);
39
39
-
margin-right: 0.4em;
40
40
-
}
41
41
-
}
42
42
-
&:hover {
43
43
-
.notification-content {
44
44
-
.close-button {
45
45
-
@include button;
46
46
-
background-color: transparentize($red, 0.5);
47
47
-
&:hover {
48
48
-
background-color: transparentize($red, 0.3);
49
49
-
}
50
50
-
&:active {
51
51
-
background-color: transparentize($red, 0.1);
52
52
-
}
53
53
-
}
54
54
-
}
55
55
-
}
2
2
+
.notification-content {
3
3
+
padding: $popover_padding;
4
4
+
.title {
5
5
+
font-size: 1.2em;
6
6
+
font-weight: 600;
7
7
+
margin-bottom: $popover_padding/2;
8
8
+
}
9
9
+
.image {
10
10
+
min-width: 80px;
11
11
+
min-height: 80px;
12
12
+
background-size: cover;
13
13
+
margin-right: $popover_padding;
14
14
+
border-radius: $button_radius;
15
15
+
}
16
16
+
.action-button {
17
17
+
@include button;
18
18
+
font-size: 1.1em;
19
19
+
font-weight: 500;
20
20
+
padding: 0.5em;
21
21
+
margin-top: $popover_padding;
22
22
+
&:first-child {
23
23
+
margin-right: $popover_padding/2;
24
24
+
}
25
25
+
&:last-child {
26
26
+
margin-left: $popover_padding/2;
27
27
+
}
28
28
+
&:first-child:last-child {
29
29
+
margin-left: 0;
30
30
+
margin-right: 0;
31
31
+
}
32
32
+
}
33
33
+
.close-button {
34
34
+
min-width: 1.4em;
35
35
+
min-height: 1.4em;
36
36
+
}
37
37
+
.time {
38
38
+
color: transparentize($fg_color, 0.4);
39
39
+
margin-right: 0.4em;
40
40
+
}
41
41
+
}
42
42
+
&:hover {
43
43
+
.notification-content {
44
44
+
.close-button {
45
45
+
@include button;
46
46
+
background-color: transparentize($red, 0.5);
47
47
+
&:hover {
48
48
+
background-color: transparentize($red, 0.3);
49
49
+
}
50
50
+
&:active {
51
51
+
background-color: transparentize($red, 0.1);
52
52
+
}
53
53
+
}
54
54
+
}
55
55
+
}
56
56
}
+20
-20
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/sys_sliders.scss
···
1
1
@mixin sys-sliders() {
2
2
-
.slider {
3
3
-
@include slider($width: 0.8em, $slider: false);
4
4
-
}
5
5
-
.percent {
6
6
-
margin: $spacing;
7
7
-
min-width: 2.6em;
8
8
-
}
9
9
-
.icon {
10
10
-
margin: $spacing;
11
11
-
&:first-child {
12
12
-
font-size: 1.4em;
13
13
-
}
14
14
-
}
15
15
-
button {
16
16
-
@include button($flat: true);
17
17
-
margin-right: $spacing;
18
18
-
.icon {
19
19
-
margin: 0;
20
20
-
}
21
21
-
}
2
2
+
.slider {
3
3
+
@include slider($width: 0.8em, $slider: false);
4
4
+
}
5
5
+
.percent {
6
6
+
margin: $spacing;
7
7
+
min-width: 2.6em;
8
8
+
}
9
9
+
.icon {
10
10
+
margin: $spacing;
11
11
+
&:first-child {
12
12
+
font-size: 1.4em;
13
13
+
}
14
14
+
}
15
15
+
button {
16
16
+
@include button($flat: true);
17
17
+
margin-right: $spacing;
18
18
+
.icon {
19
19
+
margin: 0;
20
20
+
}
21
21
+
}
22
22
}
+48
-48
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/toggle_button.scss
···
1
1
@mixin toggle_button($toggle_radius: $radii * 2.4) {
2
2
-
@include button($radii: $toggle_radius);
3
3
-
&.small {
4
4
-
@include button($radii: $toggle_radius * 1.1);
5
5
-
}
6
6
-
margin: $spacing;
7
7
-
.separator {
8
8
-
background-color: $fg_color;
9
9
-
min-width: 2px;
10
10
-
min-height: 1.4em;
11
11
-
}
12
12
-
.half {
13
13
-
@include button($flat: true);
14
14
-
min-height: 3.4em;
15
15
-
&:first-child {
16
16
-
border-radius: $toggle_radius 0 0 $toggle_radius;
17
17
-
}
18
18
-
&:last-child {
19
19
-
border-radius: 0 $toggle_radius $toggle_radius 0;
20
20
-
}
21
21
-
&:hover {
22
22
-
background-color: $hover;
23
23
-
}
24
24
-
}
25
25
-
&.active {
26
26
-
* {
27
27
-
color: $accent_fg;
28
28
-
}
29
29
-
background-color: $accent;
30
30
-
.separator {
31
31
-
background-color: $accent_fg;
32
32
-
}
33
33
-
&:hover {
34
34
-
background-color: transparentize($accent, 0.15);
35
35
-
* {
36
36
-
color: $accent_fg;
37
37
-
}
38
38
-
}
39
39
-
&:focus {
40
40
-
background-color: transparentize($accent, 0.4);
41
41
-
box-shadow: inset 0 0 0 $border_width * 2 $accent;
42
42
-
}
43
43
-
}
44
44
-
.icon {
45
45
-
font-size: 2em;
46
46
-
&.arrow {
47
47
-
font-size: 1.8em;
48
48
-
}
49
49
-
}
2
2
+
@include button($radii: $toggle_radius);
3
3
+
&.small {
4
4
+
@include button($radii: $toggle_radius * 1.1);
5
5
+
}
6
6
+
margin: $spacing;
7
7
+
.separator {
8
8
+
background-color: $fg_color;
9
9
+
min-width: 2px;
10
10
+
min-height: 1.4em;
11
11
+
}
12
12
+
.half {
13
13
+
@include button($flat: true);
14
14
+
min-height: 3.4em;
15
15
+
&:first-child {
16
16
+
border-radius: $toggle_radius 0 0 $toggle_radius;
17
17
+
}
18
18
+
&:last-child {
19
19
+
border-radius: 0 $toggle_radius $toggle_radius 0;
20
20
+
}
21
21
+
&:hover {
22
22
+
background-color: $hover;
23
23
+
}
24
24
+
}
25
25
+
&.active {
26
26
+
* {
27
27
+
color: $accent_fg;
28
28
+
}
29
29
+
background-color: $accent;
30
30
+
.separator {
31
31
+
background-color: $accent_fg;
32
32
+
}
33
33
+
&:hover {
34
34
+
background-color: transparentize($accent, 0.15);
35
35
+
* {
36
36
+
color: $accent_fg;
37
37
+
}
38
38
+
}
39
39
+
&:focus {
40
40
+
background-color: transparentize($accent, 0.4);
41
41
+
box-shadow: inset 0 0 0 $border_width * 2 $accent;
42
42
+
}
43
43
+
}
44
44
+
.icon {
45
45
+
font-size: 2em;
46
46
+
&.arrow {
47
47
+
font-size: 1.8em;
48
48
+
}
49
49
+
}
50
50
}
+20
-20
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/user.scss
···
1
1
@mixin user($width: 10em, $height: 10em) {
2
2
-
padding: 0;
3
3
-
min-height: 10em;
4
4
-
min-width: 10em;
5
5
-
background-image: url($avatar);
6
6
-
background-size: cover;
2
2
+
padding: 0;
3
3
+
min-height: 10em;
4
4
+
min-width: 10em;
5
5
+
background-image: url($avatar);
6
6
+
background-size: cover;
7
7
8
8
-
.darkened {
9
9
-
@include darkened($radii: $button_radius);
10
10
-
padding: 0.3em;
8
8
+
.darkened {
9
9
+
@include darkened($radii: $button_radius);
10
10
+
padding: 0.3em;
11
11
12
12
-
label {
13
13
-
text-shadow: $text_shadow;
12
12
+
label {
13
13
+
text-shadow: $text_shadow;
14
14
15
15
-
&:first-child {
16
16
-
color: transparentize($fg_color, 0.1);
17
17
-
font-size: 1.3em;
18
18
-
}
15
15
+
&:first-child {
16
16
+
color: transparentize($fg_color, 0.1);
17
17
+
font-size: 1.3em;
18
18
+
}
19
19
20
20
-
&:last-child {
21
21
-
color: transparentize($fg_color, 0.3);
22
22
-
font-size: 1.1em;
23
23
-
}
24
24
-
}
25
25
-
}
20
20
+
&:last-child {
21
21
+
color: transparentize($fg_color, 0.3);
22
22
+
font-size: 1.1em;
23
23
+
}
24
24
+
}
25
25
+
}
26
26
}
+45
-45
home/isabel/programs/configs/gui/bars/eww/config/scss/widgets/weather.scss
···
1
1
@mixin weather {
2
2
-
.info {
3
3
-
.place {
4
4
-
label {
5
5
-
font-size: 1.2em;
6
6
-
}
7
7
-
.icon {
8
8
-
font-size: 0.9em;
9
9
-
margin-right: 0.2em;
10
10
-
color: transparentize($accent, 0);
11
11
-
}
12
12
-
}
13
13
-
.feels {
14
14
-
color: transparentize($fg_color, 0.3);
15
15
-
}
16
16
-
.temp {
17
17
-
font-size: 1.2em;
18
18
-
}
19
19
-
}
20
20
-
.icon {
21
21
-
font-size: 2.6em;
2
2
+
.info {
3
3
+
.place {
4
4
+
label {
5
5
+
font-size: 1.2em;
6
6
+
}
7
7
+
.icon {
8
8
+
font-size: 0.9em;
9
9
+
margin-right: 0.2em;
10
10
+
color: transparentize($accent, 0);
11
11
+
}
12
12
+
}
13
13
+
.feels {
14
14
+
color: transparentize($fg_color, 0.3);
15
15
+
}
16
16
+
.temp {
17
17
+
font-size: 1.2em;
18
18
+
}
19
19
+
}
20
20
+
.icon {
21
21
+
font-size: 2.6em;
22
22
23
23
-
&.clear.d {
24
24
-
color: transparentize($yellow, 0.6);
25
25
-
}
26
26
-
&.clear.n {
27
27
-
color: transparentize($blue, 0.6);
28
28
-
}
23
23
+
&.clear.d {
24
24
+
color: transparentize($yellow, 0.6);
25
25
+
}
26
26
+
&.clear.n {
27
27
+
color: transparentize($blue, 0.6);
28
28
+
}
29
29
30
30
-
&.clouds.d {
31
31
-
color: transparentize($fg_color, 0.6);
32
32
-
}
33
33
-
&.clouds.n {
34
34
-
color: transparentize($blue, 0.6);
35
35
-
}
30
30
+
&.clouds.d {
31
31
+
color: transparentize($fg_color, 0.6);
32
32
+
}
33
33
+
&.clouds.n {
34
34
+
color: transparentize($blue, 0.6);
35
35
+
}
36
36
37
37
-
&.rain {
38
38
-
color: transparentize($blue, 0.6);
39
39
-
}
40
40
-
&.thunderstorm {
41
41
-
color: transparentize($yellow, 0.6);
42
42
-
}
43
43
-
&.snow {
44
44
-
color: transparentize($fg_color, 0.6);
45
45
-
}
46
46
-
&.mist {
47
47
-
color: transparentize($teal, 0.6);
48
48
-
}
49
49
-
}
37
37
+
&.rain {
38
38
+
color: transparentize($blue, 0.6);
39
39
+
}
40
40
+
&.thunderstorm {
41
41
+
color: transparentize($yellow, 0.6);
42
42
+
}
43
43
+
&.snow {
44
44
+
color: transparentize($fg_color, 0.6);
45
45
+
}
46
46
+
&.mist {
47
47
+
color: transparentize($teal, 0.6);
48
48
+
}
49
49
+
}
50
50
}
+52
-52
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/app_laucher.scss
···
1
1
.app-launcher {
2
2
-
@include floating_widget;
3
3
-
min-height: 530px;
4
4
-
min-width: 530px;
5
5
-
padding: 3em;
2
2
+
@include floating_widget;
3
3
+
min-height: 530px;
4
4
+
min-width: 530px;
5
5
+
padding: 3em;
6
6
7
7
-
.search {
8
8
-
min-height: 1.4em;
9
9
-
padding: 2em;
10
10
-
border-radius: $radii;
11
11
-
background-image: url($wallpaper);
12
12
-
background-size: cover;
13
13
-
background-position: right bottom;
14
14
-
margin-bottom: 3em;
15
15
-
.icon,
16
16
-
.input {
17
17
-
@include button;
18
18
-
background-color: transparentize($bg_color, 0.1);
19
19
-
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.4);
20
20
-
}
21
21
-
.icon {
22
22
-
min-width: 2.4em;
23
23
-
margin-right: $spacing;
24
24
-
}
25
25
-
.input {
26
26
-
padding: 0.6em 0.8em;
27
27
-
}
28
28
-
}
7
7
+
.search {
8
8
+
min-height: 1.4em;
9
9
+
padding: 2em;
10
10
+
border-radius: $radii;
11
11
+
background-image: url($wallpaper);
12
12
+
background-size: cover;
13
13
+
background-position: right bottom;
14
14
+
margin-bottom: 3em;
15
15
+
.icon,
16
16
+
.input {
17
17
+
@include button;
18
18
+
background-color: transparentize($bg_color, 0.1);
19
19
+
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.4);
20
20
+
}
21
21
+
.icon {
22
22
+
min-width: 2.4em;
23
23
+
margin-right: $spacing;
24
24
+
}
25
25
+
.input {
26
26
+
padding: 0.6em 0.8em;
27
27
+
}
28
28
+
}
29
29
30
30
-
.separator {
31
31
-
min-height: 1px;
32
32
-
background-color: transparentize($fg_color, 0.94);
33
33
-
margin: 0.2em;
34
34
-
}
30
30
+
.separator {
31
31
+
min-height: 1px;
32
32
+
background-color: transparentize($fg_color, 0.94);
33
33
+
margin: 0.2em;
34
34
+
}
35
35
36
36
-
.app {
37
37
-
@include button($flat: true, $focusable: true);
38
38
-
.app-content {
39
39
-
.name {
40
40
-
font-size: 1.1em;
41
41
-
}
42
42
-
.description {
43
43
-
color: transparentize($fg_color, 0.3);
44
44
-
}
45
45
-
.appicon {
46
46
-
background-size: cover;
47
47
-
min-width: 2.4em;
48
48
-
min-height: 2.4em;
49
49
-
margin-right: 1em;
50
50
-
}
51
51
-
padding: 0.6em;
52
52
-
}
53
53
-
}
36
36
+
.app {
37
37
+
@include button($flat: true, $focusable: true);
38
38
+
.app-content {
39
39
+
.name {
40
40
+
font-size: 1.1em;
41
41
+
}
42
42
+
.description {
43
43
+
color: transparentize($fg_color, 0.3);
44
44
+
}
45
45
+
.appicon {
46
46
+
background-size: cover;
47
47
+
min-width: 2.4em;
48
48
+
min-height: 2.4em;
49
49
+
margin-right: 1em;
50
50
+
}
51
51
+
padding: 0.6em;
52
52
+
}
53
53
+
}
54
54
55
55
-
.scroll {
56
56
-
@include scrollbar;
57
57
-
}
55
55
+
.scroll {
56
56
+
@include scrollbar;
57
57
+
}
58
58
}
+59
-59
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/datemenu.scss
···
1
1
.datemenu {
2
2
-
@include floating_widget;
2
2
+
@include floating_widget;
3
3
4
4
-
.widget {
5
5
-
@include widget;
6
6
-
margin: $spacing;
7
7
-
padding: $spacing;
8
8
-
}
4
4
+
.widget {
5
5
+
@include widget;
6
6
+
margin: $spacing;
7
7
+
padding: $spacing;
8
8
+
}
9
9
10
10
-
.clock * {
11
11
-
margin-top: $spacing;
12
12
-
text-shadow: $text_shadow;
13
13
-
font-size: 7em;
14
14
-
}
10
10
+
.clock * {
11
11
+
margin-top: $spacing;
12
12
+
text-shadow: $text_shadow;
13
13
+
font-size: 7em;
14
14
+
}
15
15
16
16
-
.uptime {
17
17
-
margin-bottom: $spacing * 2;
18
18
-
font-size: 1.1em;
19
19
-
text-shadow: $text_shadow;
20
20
-
color: transparentize($fg_color, 0.3);
21
21
-
}
16
16
+
.uptime {
17
17
+
margin-bottom: $spacing * 2;
18
18
+
font-size: 1.1em;
19
19
+
text-shadow: $text_shadow;
20
20
+
color: transparentize($fg_color, 0.3);
21
21
+
}
22
22
23
23
-
.calendar-bin {
24
24
-
padding: 1em 2em 0.4em 2em;
25
25
-
@include calendar;
26
26
-
}
23
23
+
.calendar-bin {
24
24
+
padding: 1em 2em 0.4em 2em;
25
25
+
@include calendar;
26
26
+
}
27
27
28
28
-
.system {
29
29
-
> * {
30
30
-
@include widget;
31
31
-
margin: $spacing;
32
32
-
padding: 5px;
33
33
-
min-width: 3.4em;
34
34
-
min-height: 3.4em;
35
35
-
}
36
36
-
circular-progress {
37
37
-
background-color: $bg_color;
38
38
-
color: $accent;
39
39
-
&.battery {
40
40
-
&.low {
41
41
-
color: $red;
42
42
-
}
43
43
-
}
44
44
-
.icon {
45
45
-
font-size: 1.3em;
46
46
-
}
47
47
-
}
48
48
-
}
28
28
+
.system {
29
29
+
> * {
30
30
+
@include widget;
31
31
+
margin: $spacing;
32
32
+
padding: 5px;
33
33
+
min-width: 3.4em;
34
34
+
min-height: 3.4em;
35
35
+
}
36
36
+
circular-progress {
37
37
+
background-color: $bg_color;
38
38
+
color: $accent;
39
39
+
&.battery {
40
40
+
&.low {
41
41
+
color: $red;
42
42
+
}
43
43
+
}
44
44
+
.icon {
45
45
+
font-size: 1.3em;
46
46
+
}
47
47
+
}
48
48
+
}
49
49
50
50
-
.media {
51
51
-
@include media($style: "widget");
52
52
-
}
50
50
+
.media {
51
51
+
@include media($style: "widget");
52
52
+
}
53
53
54
54
-
.events.widget {
55
55
-
padding: 0;
56
56
-
.events {
57
57
-
@include events;
58
58
-
}
59
59
-
}
54
54
+
.events.widget {
55
55
+
padding: 0;
56
56
+
.events {
57
57
+
@include events;
58
58
+
}
59
59
+
}
60
60
61
61
-
.weather {
62
62
-
@include weather;
63
63
-
}
61
61
+
.weather {
62
62
+
@include weather;
63
63
+
}
64
64
65
65
-
.wallpaper {
66
66
-
min-height: 13em;
67
67
-
background-image: url($assets + "wallpaper.png");
68
68
-
background-size: cover;
69
69
-
}
65
65
+
.wallpaper {
66
66
+
min-height: 13em;
67
67
+
background-image: url($assets + "wallpaper.png");
68
68
+
background-size: cover;
69
69
+
}
70
70
}
+38
-38
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/desktop.scss
···
1
1
.desktop {
2
2
-
background-image: url($wallpaper);
3
3
-
background-size: cover;
2
2
+
background-image: url($wallpaper);
3
3
+
background-size: cover;
4
4
5
5
-
.clock {
6
6
-
color: white;
7
7
-
text-shadow: 4px 4px 4px black;
5
5
+
.clock {
6
6
+
color: white;
7
7
+
text-shadow: 4px 4px 4px black;
8
8
9
9
-
.time {
10
10
-
border: 3px solid $fg_color;
11
11
-
box-shadow: inset 0 0 0 3px $bg_color;
12
12
-
border-radius: $popover_radius;
13
13
-
padding: 0.5em 1.3em;
9
9
+
.time {
10
10
+
border: 3px solid $fg_color;
11
11
+
box-shadow: inset 0 0 0 3px $bg_color;
12
12
+
border-radius: $popover_radius;
13
13
+
padding: 0.5em 1.3em;
14
14
15
15
-
.hour,
16
16
-
.minutes,
17
17
-
.separator {
18
18
-
font-size: 10em;
19
19
-
font-family: $mono_font;
20
20
-
}
21
21
-
}
15
15
+
.hour,
16
16
+
.minutes,
17
17
+
.separator {
18
18
+
font-size: 10em;
19
19
+
font-family: $mono_font;
20
20
+
}
21
21
+
}
22
22
23
23
-
.date {
24
24
-
font-size: 2em;
25
25
-
}
26
26
-
}
23
23
+
.date {
24
24
+
font-size: 2em;
25
25
+
}
26
26
+
}
27
27
28
28
-
.system {
29
29
-
> * {
30
30
-
padding: 8px;
31
31
-
}
28
28
+
.system {
29
29
+
> * {
30
30
+
padding: 8px;
31
31
+
}
32
32
33
33
-
circular-progress {
34
34
-
background-color: transparentize($bg_color, 0.5);
35
35
-
color: $fg_color;
33
33
+
circular-progress {
34
34
+
background-color: transparentize($bg_color, 0.5);
35
35
+
color: $fg_color;
36
36
37
37
-
&.battery {
38
38
-
&.low {
39
39
-
color: $red;
40
40
-
}
41
41
-
}
37
37
+
&.battery {
38
38
+
&.low {
39
39
+
color: $red;
40
40
+
}
41
41
+
}
42
42
43
43
-
.icon {
44
44
-
font-size: 3em;
45
45
-
}
46
46
-
}
47
47
-
}
43
43
+
.icon {
44
44
+
font-size: 3em;
45
45
+
}
46
46
+
}
47
47
+
}
48
48
}
+70
-70
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/dock.scss
···
1
1
$dock_icon_size: 6em;
2
2
3
3
.dock {
4
4
-
.container {
5
5
-
min-width: $dock_icon_size * 11.5;
6
6
-
min-height: $dock_icon_size * 1.3;
7
7
-
&.hovered {
8
8
-
min-width: $dock_icon_size * 11.7;
9
9
-
}
10
10
-
}
4
4
+
.container {
5
5
+
min-width: $dock_icon_size * 11.5;
6
6
+
min-height: $dock_icon_size * 1.3;
7
7
+
&.hovered {
8
8
+
min-width: $dock_icon_size * 11.7;
9
9
+
}
10
10
+
}
11
11
12
12
-
.foot {
13
13
-
@include floating_widget;
14
14
-
margin: 0 1.5em;
15
15
-
padding: 0;
16
16
-
border-radius: $popover_radius $popover_radius 0 0;
17
17
-
border-bottom: none;
18
18
-
min-height: 1.5em; //footer height
19
19
-
}
12
12
+
.foot {
13
13
+
@include floating_widget;
14
14
+
margin: 0 1.5em;
15
15
+
padding: 0;
16
16
+
border-radius: $popover_radius $popover_radius 0 0;
17
17
+
border-bottom: none;
18
18
+
min-height: 1.5em; //footer height
19
19
+
}
20
20
21
21
-
.laucher {
22
22
-
.indicator {
23
23
-
min-height: 0.4em; //indicator height
24
24
-
min-width: 2em; //indicator width
25
25
-
border-radius: $button_radius;
26
26
-
}
27
27
-
.icon {
28
28
-
min-width: $dock_icon_size;
29
29
-
min-height: $dock_icon_size;
30
30
-
background-size: contain;
31
31
-
background-repeat: no-repeat;
32
32
-
}
33
33
-
&:hover {
34
34
-
background-image: linear-gradient(
35
35
-
transparent,
36
36
-
transparentize($fg_color, 0.94)
37
37
-
);
38
38
-
.icon {
39
39
-
min-width: $dock_icon_size * 1.2;
40
40
-
min-height: $dock_icon_size * 1.2;
41
41
-
}
42
42
-
}
43
43
-
&:active {
44
44
-
.indicator {
45
45
-
background-color: $accent;
46
46
-
}
47
47
-
}
48
48
-
&.firefox .icon {
49
49
-
background-image: url($assets + "apps/firefox.png");
50
50
-
}
51
51
-
&.terminal .icon {
52
52
-
background-image: url($assets + "apps/terminal.png");
53
53
-
}
54
54
-
&.file-manager .icon {
55
55
-
background-image: url($assets + "apps/file-manager.png");
56
56
-
}
57
57
-
&.editor .icon {
58
58
-
background-image: url($assets + "apps/editor.png");
59
59
-
}
60
60
-
&.spotify .icon {
61
61
-
background-image: url($assets + "apps/spotify.png");
62
62
-
}
63
63
-
&.caprine .icon {
64
64
-
background-image: url($assets + "apps/caprine.png");
65
65
-
}
66
66
-
&.bitwig .icon {
67
67
-
background-image: url($assets + "apps/bitwig.png");
68
68
-
}
69
69
-
&.battle .icon {
70
70
-
background-image: url($assets + "apps/battle.png");
71
71
-
}
72
72
-
&.bottles .icon {
73
73
-
background-image: url($assets + "apps/bottles.png");
74
74
-
}
75
75
-
}
21
21
+
.laucher {
22
22
+
.indicator {
23
23
+
min-height: 0.4em; //indicator height
24
24
+
min-width: 2em; //indicator width
25
25
+
border-radius: $button_radius;
26
26
+
}
27
27
+
.icon {
28
28
+
min-width: $dock_icon_size;
29
29
+
min-height: $dock_icon_size;
30
30
+
background-size: contain;
31
31
+
background-repeat: no-repeat;
32
32
+
}
33
33
+
&:hover {
34
34
+
background-image: linear-gradient(
35
35
+
transparent,
36
36
+
transparentize($fg_color, 0.94)
37
37
+
);
38
38
+
.icon {
39
39
+
min-width: $dock_icon_size * 1.2;
40
40
+
min-height: $dock_icon_size * 1.2;
41
41
+
}
42
42
+
}
43
43
+
&:active {
44
44
+
.indicator {
45
45
+
background-color: $accent;
46
46
+
}
47
47
+
}
48
48
+
&.firefox .icon {
49
49
+
background-image: url($assets + "apps/firefox.png");
50
50
+
}
51
51
+
&.terminal .icon {
52
52
+
background-image: url($assets + "apps/terminal.png");
53
53
+
}
54
54
+
&.file-manager .icon {
55
55
+
background-image: url($assets + "apps/file-manager.png");
56
56
+
}
57
57
+
&.editor .icon {
58
58
+
background-image: url($assets + "apps/editor.png");
59
59
+
}
60
60
+
&.spotify .icon {
61
61
+
background-image: url($assets + "apps/spotify.png");
62
62
+
}
63
63
+
&.caprine .icon {
64
64
+
background-image: url($assets + "apps/caprine.png");
65
65
+
}
66
66
+
&.bitwig .icon {
67
67
+
background-image: url($assets + "apps/bitwig.png");
68
68
+
}
69
69
+
&.battle .icon {
70
70
+
background-image: url($assets + "apps/battle.png");
71
71
+
}
72
72
+
&.bottles .icon {
73
73
+
background-image: url($assets + "apps/bottles.png");
74
74
+
}
75
75
+
}
76
76
}
+87
-87
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/hbar.scss
···
1
1
.hpanel {
2
2
-
min-height: 2.2em;
3
3
-
font-weight: bold;
4
4
-
font-size: 1.1em;
5
5
-
color: $fg_color;
6
6
-
background-color: transparent;
7
7
-
border-bottom: $border_width solid $popover_border_color;
8
8
-
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.8);
2
2
+
min-height: 2.2em;
3
3
+
font-weight: bold;
4
4
+
font-size: 1.1em;
5
5
+
color: $fg_color;
6
6
+
background-color: transparent;
7
7
+
border-bottom: $border_width solid $popover_border_color;
8
8
+
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.8);
9
9
10
10
-
.button-bin {
11
11
-
margin: 3px 2px;
12
12
-
background-color: $bg_color;
13
13
-
border-radius: $button_radius;
10
10
+
.button-bin {
11
11
+
margin: 3px 2px;
12
12
+
background-color: $bg_color;
13
13
+
border-radius: $button_radius;
14
14
15
15
-
&.launcher {
16
16
-
margin-left: 4px;
17
17
-
}
15
15
+
&.launcher {
16
16
+
margin-left: 4px;
17
17
+
}
18
18
19
19
-
&.powermenu {
20
20
-
margin-right: 4px;
21
21
-
}
22
22
-
}
19
19
+
&.powermenu {
20
20
+
margin-right: 4px;
21
21
+
}
22
22
+
}
23
23
24
24
-
.button {
25
25
-
.icon {
26
26
-
font-size: 1.2em;
27
27
-
}
24
24
+
.button {
25
25
+
.icon {
26
26
+
font-size: 1.2em;
27
27
+
}
28
28
29
29
-
@include button($flat: true, $radii: $panel_button_radius);
29
29
+
@include button($flat: true, $radii: $panel_button_radius);
30
30
31
31
-
> * {
32
32
-
padding: 0 0.7em;
33
33
-
}
31
31
+
> * {
32
32
+
padding: 0 0.7em;
33
33
+
}
34
34
35
35
-
&.launcher {
36
36
-
color: $accent;
37
37
-
}
35
35
+
&.launcher {
36
36
+
color: $accent;
37
37
+
}
38
38
39
39
-
&.powermenu {
40
40
-
color: $red;
41
41
-
}
39
39
+
&.powermenu {
40
40
+
color: $red;
41
41
+
}
42
42
43
43
-
&.window {
44
44
-
@include button($flat: true, $interactive: false);
45
45
-
}
43
43
+
&.window {
44
44
+
@include button($flat: true, $interactive: false);
45
45
+
}
46
46
47
47
-
&.workspaces {
48
48
-
@include button($flat: false, $radii: $panel_button_radius);
49
49
-
background-color: $bg_color;
50
50
-
border-radius: $button_radius;
47
47
+
&.workspaces {
48
48
+
@include button($flat: false, $radii: $panel_button_radius);
49
49
+
background-color: $bg_color;
50
50
+
border-radius: $button_radius;
51
51
52
52
-
.workspace-btn {
53
53
-
label {
54
54
-
font-size: 1.2em;
55
55
-
}
52
52
+
.workspace-btn {
53
53
+
label {
54
54
+
font-size: 1.2em;
55
55
+
}
56
56
57
57
-
margin: 2px;
57
57
+
margin: 2px;
58
58
59
59
-
&.empty {
60
60
-
color: transparentize($fg_color, 0.34);
61
61
-
}
59
59
+
&.empty {
60
60
+
color: transparentize($fg_color, 0.34);
61
61
+
}
62
62
63
63
-
&.occupied {
64
64
-
color: transparentize($fg_color, 0.18);
65
65
-
}
63
63
+
&.occupied {
64
64
+
color: transparentize($fg_color, 0.18);
65
65
+
}
66
66
67
67
-
&.active {
68
68
-
color: $fg_color;
69
69
-
}
67
67
+
&.active {
68
68
+
color: $fg_color;
69
69
+
}
70
70
71
71
-
&:hover {
72
72
-
&.empty {
73
73
-
color: transparentize($fg_color, 0.18);
74
74
-
}
71
71
+
&:hover {
72
72
+
&.empty {
73
73
+
color: transparentize($fg_color, 0.18);
74
74
+
}
75
75
76
76
-
&.occupied {
77
77
-
color: $fg_color;
78
78
-
}
79
79
-
}
76
76
+
&.occupied {
77
77
+
color: $fg_color;
78
78
+
}
79
79
+
}
80
80
81
81
-
&:active {
82
82
-
color: $accent;
83
83
-
}
84
84
-
}
85
85
-
}
81
81
+
&:active {
82
82
+
color: $accent;
83
83
+
}
84
84
+
}
85
85
+
}
86
86
87
87
-
&.system-indicators {
88
88
-
@include system-indicators($orientation: "h");
87
87
+
&.system-indicators {
88
88
+
@include system-indicators($orientation: "h");
89
89
90
90
-
> * > * > * {
91
91
-
padding: 0 0.3em;
92
92
-
}
93
93
-
}
90
90
+
> * > * > * {
91
91
+
padding: 0 0.3em;
92
92
+
}
93
93
+
}
94
94
95
95
-
&.media {
96
96
-
.icon {
97
97
-
margin-right: 0.2em;
95
95
+
&.media {
96
96
+
.icon {
97
97
+
margin-right: 0.2em;
98
98
99
99
-
&.spotify {
100
100
-
color: $green;
101
101
-
}
99
99
+
&.spotify {
100
100
+
color: $green;
101
101
+
}
102
102
103
103
-
&.firefox {
104
104
-
color: $orange;
105
105
-
}
103
103
+
&.firefox {
104
104
+
color: $orange;
105
105
+
}
106
106
107
107
-
&.mpv {
108
108
-
color: $magenta;
109
109
-
}
110
110
-
}
111
111
-
}
112
112
-
}
107
107
+
&.mpv {
108
108
+
color: $magenta;
109
109
+
}
110
110
+
}
111
111
+
}
112
112
+
}
113
113
}
+8
-8
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/media.scss
···
1
1
.media-window {
2
2
-
padding: 0;
3
3
-
.media {
4
4
-
@include media($height: 20em, $style: "popover");
5
5
-
padding: 0;
6
6
-
.cover {
7
7
-
min-width: 20em;
8
8
-
}
9
9
-
}
2
2
+
padding: 0;
3
3
+
.media {
4
4
+
@include media($height: 20em, $style: "popover");
5
5
+
padding: 0;
6
6
+
.cover {
7
7
+
min-width: 20em;
8
8
+
}
9
9
+
}
10
10
}
+55
-55
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/noti_center.scss
···
1
1
.notification-center {
2
2
-
min-width: 400px;
3
3
-
@include floating_widget;
2
2
+
min-width: 400px;
3
3
+
@include floating_widget;
4
4
5
5
-
.title {
6
6
-
button {
7
7
-
font-size: 1em;
8
8
-
padding: 0.4em 1em;
9
9
-
@include button;
10
10
-
}
5
5
+
.title {
6
6
+
button {
7
7
+
font-size: 1em;
8
8
+
padding: 0.4em 1em;
9
9
+
@include button;
10
10
+
}
11
11
12
12
-
label {
13
13
-
font-size: 1.4em;
14
14
-
}
12
12
+
label {
13
13
+
font-size: 1.4em;
14
14
+
}
15
15
16
16
-
margin-bottom: $spacing;
17
17
-
}
16
16
+
margin-bottom: $spacing;
17
17
+
}
18
18
19
19
-
.notifications-list {
20
20
-
@include scrollbar;
19
19
+
.notifications-list {
20
20
+
@include scrollbar;
21
21
22
22
-
.placeholder {
23
23
-
.icon {
24
24
-
font-size: 8em;
25
25
-
}
22
22
+
.placeholder {
23
23
+
.icon {
24
24
+
font-size: 8em;
25
25
+
}
26
26
27
27
-
label {
28
28
-
font-size: 2em;
29
29
-
}
30
30
-
}
27
27
+
label {
28
28
+
font-size: 2em;
29
29
+
}
30
30
+
}
31
31
32
32
-
.notification {
33
33
-
@include notification;
32
32
+
.notification {
33
33
+
@include notification;
34
34
35
35
-
.notification-content {
36
36
-
@include widget;
37
37
-
margin-bottom: $spacing;
38
38
-
border-radius: $widget_radius * 0.3;
39
39
-
}
35
35
+
.notification-content {
36
36
+
@include widget;
37
37
+
margin-bottom: $spacing;
38
38
+
border-radius: $widget_radius * 0.3;
39
39
+
}
40
40
41
41
-
&:first-child .notification-content {
42
42
-
border-radius: $widget_radius $widget_radius $widget_radius *
43
43
-
0.3 $widget_radius * 0.3;
44
44
-
}
41
41
+
&:first-child .notification-content {
42
42
+
border-radius: $widget_radius $widget_radius $widget_radius * 0.3
43
43
+
$widget_radius * 0.3;
44
44
+
}
45
45
46
46
-
&:last-child .notification-content {
47
47
-
border-radius: $widget_radius * 0.3 $widget_radius * 0.3
48
48
-
$widget_radius $widget_radius;
49
49
-
}
46
46
+
&:last-child .notification-content {
47
47
+
border-radius: $widget_radius * 0.3 $widget_radius * 0.3 $widget_radius
48
48
+
$widget_radius;
49
49
+
}
50
50
51
51
-
&:first-child:last-child .notification-content {
52
52
-
border-radius: $widget_radius;
53
53
-
}
54
54
-
}
51
51
+
&:first-child:last-child .notification-content {
52
52
+
border-radius: $widget_radius;
53
53
+
}
54
54
+
}
55
55
56
56
-
margin-bottom: $spacing;
57
57
-
}
56
56
+
margin-bottom: $spacing;
57
57
+
}
58
58
59
59
-
.controls {
60
60
-
@include widget;
61
61
-
padding: $popover_padding * 0.5;
59
59
+
.controls {
60
60
+
@include widget;
61
61
+
padding: $popover_padding * 0.5;
62
62
63
63
-
.sys-sliders {
64
64
-
@include sys-sliders;
65
65
-
}
63
63
+
.sys-sliders {
64
64
+
@include sys-sliders;
65
65
+
}
66
66
67
67
-
.toggle {
68
68
-
min-height: 3.4em;
69
69
-
@include toggle_button($toggle_radius: $radii * 1.4);
70
70
-
}
71
71
-
}
67
67
+
.toggle {
68
68
+
min-height: 3.4em;
69
69
+
@include toggle_button($toggle_radius: $radii * 1.4);
70
70
+
}
71
71
+
}
72
72
}
+7
-7
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/notifications.scss
···
1
1
.notifications-window-box {
2
2
-
.notification {
3
3
-
@include notification;
4
4
-
.notification-content {
5
5
-
min-width: 450px;
6
6
-
@include floating_widget;
7
7
-
}
8
8
-
}
2
2
+
.notification {
3
3
+
@include notification;
4
4
+
.notification-content {
5
5
+
min-width: 450px;
6
6
+
@include floating_widget;
7
7
+
}
8
8
+
}
9
9
}
+16
-16
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/osd.scss
···
1
1
.osd-widget {
2
2
-
@include floating_widget;
3
3
-
padding: 0.3em;
4
4
-
.icon {
5
5
-
font-size: 40px;
6
6
-
color: $accent_fg;
7
7
-
min-width: 30px;
8
8
-
min-height: 30px;
9
9
-
}
10
10
-
.scale {
11
11
-
min-height: 14em;
12
12
-
@include slider($width: 3em);
13
13
-
trough {
14
14
-
background-color: transparent;
15
15
-
border: none;
16
16
-
}
17
17
-
}
2
2
+
@include floating_widget;
3
3
+
padding: 0.3em;
4
4
+
.icon {
5
5
+
font-size: 40px;
6
6
+
color: $accent_fg;
7
7
+
min-width: 30px;
8
8
+
min-height: 30px;
9
9
+
}
10
10
+
.scale {
11
11
+
min-height: 14em;
12
12
+
@include slider($width: 3em);
13
13
+
trough {
14
14
+
background-color: transparent;
15
15
+
border: none;
16
16
+
}
17
17
+
}
18
18
}
+73
-73
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/powermenu.scss
···
1
1
.background.powermenu {
2
2
-
background-color: rgba(0, 0, 0, 0.5);
3
3
-
.content {
4
4
-
@include floating_widget;
5
5
-
.user {
6
6
-
@include user;
7
7
-
}
8
8
-
.clock {
9
9
-
text-shadow: $text_shadow;
10
10
-
margin-bottom: 2.2em;
11
11
-
.hour * {
12
12
-
font-size: 9em;
13
13
-
}
14
14
-
.date {
15
15
-
font-size: 2em;
16
16
-
}
17
17
-
}
18
18
-
.power-menu {
19
19
-
border-radius: $radii * 3;
20
20
-
padding: 15px;
21
21
-
}
22
22
-
.button-bin {
23
23
-
margin: 15px;
24
24
-
margin-bottom: 0;
25
25
-
.button {
26
26
-
@include button($focusable: true);
27
27
-
border-radius: $radii * 2.4;
28
28
-
font-size: 60px;
29
29
-
min-width: 130px;
30
30
-
min-height: 130px;
31
31
-
.icon {
32
32
-
background-size: contain;
33
33
-
margin: 24px;
34
34
-
@if $theme == "light" {
35
35
-
&.shutdown {
36
36
-
background-image: url($assets + "powermenu/light-shutdown.png");
37
37
-
}
38
38
-
&.reboot {
39
39
-
background-image: url($assets + "powermenu/light-reboot.png");
40
40
-
}
41
41
-
&.logout {
42
42
-
background-image: url($assets + "powermenu/light-logout.png");
43
43
-
}
44
44
-
&.suspend {
45
45
-
background-image: url($assets + "powermenu/light-suspend.png");
46
46
-
}
47
47
-
&.lock {
48
48
-
background-image: url($assets + "powermenu/light-lock.png");
49
49
-
}
50
50
-
} @else {
51
51
-
&.shutdown {
52
52
-
background-image: url($assets + "powermenu/shutdown.png");
53
53
-
}
54
54
-
&.reboot {
55
55
-
background-image: url($assets + "powermenu/reboot.png");
56
56
-
}
57
57
-
&.logout {
58
58
-
background-image: url($assets + "powermenu/logout.png");
59
59
-
}
60
60
-
&.suspend {
61
61
-
background-image: url($assets + "powermenu/suspend.png");
62
62
-
}
63
63
-
&.lock {
64
64
-
background-image: url($assets + "powermenu/lock.png");
65
65
-
}
66
66
-
}
67
67
-
}
68
68
-
}
69
69
-
.label {
70
70
-
font-size: 20px;
71
71
-
margin: 8px 0;
72
72
-
}
73
73
-
}
74
74
-
}
2
2
+
background-color: rgba(0, 0, 0, 0.5);
3
3
+
.content {
4
4
+
@include floating_widget;
5
5
+
.user {
6
6
+
@include user;
7
7
+
}
8
8
+
.clock {
9
9
+
text-shadow: $text_shadow;
10
10
+
margin-bottom: 2.2em;
11
11
+
.hour * {
12
12
+
font-size: 9em;
13
13
+
}
14
14
+
.date {
15
15
+
font-size: 2em;
16
16
+
}
17
17
+
}
18
18
+
.power-menu {
19
19
+
border-radius: $radii * 3;
20
20
+
padding: 15px;
21
21
+
}
22
22
+
.button-bin {
23
23
+
margin: 15px;
24
24
+
margin-bottom: 0;
25
25
+
.button {
26
26
+
@include button($focusable: true);
27
27
+
border-radius: $radii * 2.4;
28
28
+
font-size: 60px;
29
29
+
min-width: 130px;
30
30
+
min-height: 130px;
31
31
+
.icon {
32
32
+
background-size: contain;
33
33
+
margin: 24px;
34
34
+
@if $theme == "light" {
35
35
+
&.shutdown {
36
36
+
background-image: url($assets + "powermenu/light-shutdown.png");
37
37
+
}
38
38
+
&.reboot {
39
39
+
background-image: url($assets + "powermenu/light-reboot.png");
40
40
+
}
41
41
+
&.logout {
42
42
+
background-image: url($assets + "powermenu/light-logout.png");
43
43
+
}
44
44
+
&.suspend {
45
45
+
background-image: url($assets + "powermenu/light-suspend.png");
46
46
+
}
47
47
+
&.lock {
48
48
+
background-image: url($assets + "powermenu/light-lock.png");
49
49
+
}
50
50
+
} @else {
51
51
+
&.shutdown {
52
52
+
background-image: url($assets + "powermenu/shutdown.png");
53
53
+
}
54
54
+
&.reboot {
55
55
+
background-image: url($assets + "powermenu/reboot.png");
56
56
+
}
57
57
+
&.logout {
58
58
+
background-image: url($assets + "powermenu/logout.png");
59
59
+
}
60
60
+
&.suspend {
61
61
+
background-image: url($assets + "powermenu/suspend.png");
62
62
+
}
63
63
+
&.lock {
64
64
+
background-image: url($assets + "powermenu/lock.png");
65
65
+
}
66
66
+
}
67
67
+
}
68
68
+
}
69
69
+
.label {
70
70
+
font-size: 20px;
71
71
+
margin: 8px 0;
72
72
+
}
73
73
+
}
74
74
+
}
75
75
}
+58
-58
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/quicksettings.scss
···
1
1
.quick-settings {
2
2
-
@include floating_widget;
2
2
+
@include floating_widget;
3
3
4
4
-
.widget {
5
5
-
@include widget;
6
6
-
margin: $spacing;
7
7
-
padding: $spacing;
8
8
-
}
4
4
+
.widget {
5
5
+
@include widget;
6
6
+
margin: $spacing;
7
7
+
padding: $spacing;
8
8
+
}
9
9
10
10
-
.sys-sliders {
11
11
-
@include sys-sliders;
12
12
-
}
10
10
+
.sys-sliders {
11
11
+
@include sys-sliders;
12
12
+
}
13
13
14
14
-
.sys-actions {
15
15
-
.user {
16
16
-
@include user;
17
17
-
}
18
18
-
.sysactions {
19
19
-
button {
20
20
-
@include button($radii: 40%);
21
21
-
margin: $spacing;
22
22
-
padding: 0.4em;
23
23
-
label {
24
24
-
font-size: 2.4em;
25
25
-
}
26
26
-
&.power {
27
27
-
color: $red;
28
28
-
}
29
29
-
}
30
30
-
.uptime {
31
31
-
font-size: 1.3em;
32
32
-
color: transparentize($fg_color, 0.5);
33
33
-
}
34
34
-
}
35
35
-
}
14
14
+
.sys-actions {
15
15
+
.user {
16
16
+
@include user;
17
17
+
}
18
18
+
.sysactions {
19
19
+
button {
20
20
+
@include button($radii: 40%);
21
21
+
margin: $spacing;
22
22
+
padding: 0.4em;
23
23
+
label {
24
24
+
font-size: 2.4em;
25
25
+
}
26
26
+
&.power {
27
27
+
color: $red;
28
28
+
}
29
29
+
}
30
30
+
.uptime {
31
31
+
font-size: 1.3em;
32
32
+
color: transparentize($fg_color, 0.5);
33
33
+
}
34
34
+
}
35
35
+
}
36
36
37
37
-
.system {
38
38
-
> * > * {
39
39
-
@include widget;
40
40
-
margin: $spacing;
41
41
-
padding: 8px;
42
42
-
min-width: 4.4em;
43
43
-
min-height: 4.4em;
44
44
-
}
45
45
-
circular-progress {
46
46
-
background-color: $bg_color;
47
47
-
color: $accent;
48
48
-
&.battery {
49
49
-
&.low {
50
50
-
color: $red;
51
51
-
}
52
52
-
}
53
53
-
.icon {
54
54
-
font-size: 1.8em;
55
55
-
}
56
56
-
}
57
57
-
}
37
37
+
.system {
38
38
+
> * > * {
39
39
+
@include widget;
40
40
+
margin: $spacing;
41
41
+
padding: 8px;
42
42
+
min-width: 4.4em;
43
43
+
min-height: 4.4em;
44
44
+
}
45
45
+
circular-progress {
46
46
+
background-color: $bg_color;
47
47
+
color: $accent;
48
48
+
&.battery {
49
49
+
&.low {
50
50
+
color: $red;
51
51
+
}
52
52
+
}
53
53
+
.icon {
54
54
+
font-size: 1.8em;
55
55
+
}
56
56
+
}
57
57
+
}
58
58
59
59
-
.toggles .toggle {
60
60
-
@include toggle_button($toggle_radius: $radii * 2.4);
61
61
-
}
59
59
+
.toggles .toggle {
60
60
+
@include toggle_button($toggle_radius: $radii * 2.4);
61
61
+
}
62
62
63
63
-
.media {
64
64
-
@include media($height: 12em);
65
65
-
}
63
63
+
.media {
64
64
+
@include media($height: 12em);
65
65
+
}
66
66
}
+76
-76
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/screenshot.scss
···
1
1
.background.takeshot {
2
2
-
background-color: rgba(0, 0, 0, 0.5);
2
2
+
background-color: rgba(0, 0, 0, 0.5);
3
3
4
4
-
.content {
5
5
-
@include floating_widget;
4
4
+
.content {
5
5
+
@include floating_widget;
6
6
7
7
-
.takeshot-menu {
8
8
-
border-radius: $radii * 3;
9
9
-
padding: 15px;
10
10
-
}
7
7
+
.takeshot-menu {
8
8
+
border-radius: $radii * 3;
9
9
+
padding: 15px;
10
10
+
}
11
11
12
12
-
.button-bin {
13
13
-
margin: 15px;
14
14
-
margin-bottom: 0;
15
15
-
margin-top: 0;
12
12
+
.button-bin {
13
13
+
margin: 15px;
14
14
+
margin-bottom: 0;
15
15
+
margin-top: 0;
16
16
17
17
-
.button {
18
18
-
@include button($focusable: true);
19
19
-
border-radius: $radii * 2.4;
20
20
-
min-width: 130px;
21
21
-
min-height: 130px;
22
22
-
}
17
17
+
.button {
18
18
+
@include button($focusable: true);
19
19
+
border-radius: $radii * 2.4;
20
20
+
min-width: 130px;
21
21
+
min-height: 130px;
22
22
+
}
23
23
24
24
-
.label {
25
25
-
font-size: 20px;
26
26
-
margin: 8px 0;
27
27
-
}
28
28
-
}
24
24
+
.label {
25
25
+
font-size: 20px;
26
26
+
margin: 8px 0;
27
27
+
}
28
28
+
}
29
29
30
30
-
.icon {
31
31
-
font-size: 5rem;
32
32
-
}
30
30
+
.icon {
31
31
+
font-size: 5rem;
32
32
+
}
33
33
34
34
-
.blue {
35
35
-
color: $blue;
36
36
-
}
34
34
+
.blue {
35
35
+
color: $blue;
36
36
+
}
37
37
38
38
-
.red {
39
39
-
color: $red;
40
40
-
}
38
38
+
.red {
39
39
+
color: $red;
40
40
+
}
41
41
42
42
-
.green {
43
43
-
color: $green;
44
44
-
}
45
45
-
}
42
42
+
.green {
43
43
+
color: $green;
44
44
+
}
45
45
+
}
46
46
}
47
47
48
48
.background.previewshot {
49
49
-
.content {
50
50
-
@include floating_widget;
49
49
+
.content {
50
50
+
@include floating_widget;
51
51
52
52
-
.previewshot-menu {
53
53
-
border-radius: $radii * 3;
54
54
-
padding: 15px;
55
55
-
}
52
52
+
.previewshot-menu {
53
53
+
border-radius: $radii * 3;
54
54
+
padding: 15px;
55
55
+
}
56
56
57
57
-
.button-bin {
58
58
-
margin: 15px;
59
59
-
margin-bottom: 0;
60
60
-
margin-top: 0;
57
57
+
.button-bin {
58
58
+
margin: 15px;
59
59
+
margin-bottom: 0;
60
60
+
margin-top: 0;
61
61
62
62
-
.button {
63
63
-
@include button($focusable: true);
64
64
-
border-radius: $radii;
65
65
-
min-width: 15px;
66
66
-
min-height: 50px;
67
67
-
}
62
62
+
.button {
63
63
+
@include button($focusable: true);
64
64
+
border-radius: $radii;
65
65
+
min-width: 15px;
66
66
+
min-height: 50px;
67
67
+
}
68
68
69
69
-
.label {
70
70
-
font-size: 15px;
71
71
-
margin: 8px 0;
72
72
-
}
73
73
-
}
69
69
+
.label {
70
70
+
font-size: 15px;
71
71
+
margin: 8px 0;
72
72
+
}
73
73
+
}
74
74
75
75
-
.icon {
76
76
-
font-size: 1.5rem;
77
77
-
}
75
75
+
.icon {
76
76
+
font-size: 1.5rem;
77
77
+
}
78
78
79
79
-
.blue {
80
80
-
color: $blue;
81
81
-
}
79
79
+
.blue {
80
80
+
color: $blue;
81
81
+
}
82
82
83
83
-
.red {
84
84
-
color: $red;
85
85
-
}
83
83
+
.red {
84
84
+
color: $red;
85
85
+
}
86
86
87
87
-
.green {
88
88
-
color: $green;
89
89
-
}
90
90
-
}
87
87
+
.green {
88
88
+
color: $green;
89
89
+
}
90
90
+
}
91
91
92
92
-
.preview {
93
93
-
background-image: url("/tmp/screenshot.png");
94
94
-
background-size: contain;
95
95
-
background-repeat: no-repeat;
96
96
-
background-position: center;
97
97
-
margin: 1rem;
98
98
-
}
92
92
+
.preview {
93
93
+
background-image: url("/tmp/screenshot.png");
94
94
+
background-size: contain;
95
95
+
background-repeat: no-repeat;
96
96
+
background-position: center;
97
97
+
margin: 1rem;
98
98
+
}
99
99
}
+72
-72
home/isabel/programs/configs/gui/bars/eww/config/scss/windows/vbar.scss
···
1
1
.vpanel {
2
2
-
min-width: 2.2em;
3
3
-
font-weight: bold;
4
4
-
color: $fg_color;
5
5
-
background-color: $bg_color;
2
2
+
min-width: 2.2em;
3
3
+
font-weight: bold;
4
4
+
color: $fg_color;
5
5
+
background-color: $bg_color;
6
6
7
7
-
// &.floating {
8
8
-
margin: $wm_gaps;
9
9
-
border-radius: $panel_radius;
10
10
-
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
11
11
-
border: $border_width solid $popover_border_color;
12
12
-
// }
7
7
+
// &.floating {
8
8
+
margin: $wm_gaps;
9
9
+
border-radius: $panel_radius;
10
10
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
11
11
+
border: $border_width solid $popover_border_color;
12
12
+
// }
13
13
14
14
-
.leftBar .button-bin {
15
15
-
margin: 0.4em 0.4em 0 0.4em;
16
16
-
}
17
17
-
.centerBar .button-bin {
18
18
-
margin: 0.2em 0.4em;
19
19
-
}
20
20
-
.rightBar .button-bin {
21
21
-
margin: 0 0.4em 0.4em 0.4em;
22
22
-
}
14
14
+
.leftBar .button-bin {
15
15
+
margin: 0.4em 0.4em 0 0.4em;
16
16
+
}
17
17
+
.centerBar .button-bin {
18
18
+
margin: 0.2em 0.4em;
19
19
+
}
20
20
+
.rightBar .button-bin {
21
21
+
margin: 0 0.4em 0.4em 0.4em;
22
22
+
}
23
23
24
24
-
.media {
25
25
-
@include panel_media();
26
26
-
.player {
27
27
-
min-height: 2.6em;
28
28
-
}
29
29
-
}
24
24
+
.media {
25
25
+
@include panel_media();
26
26
+
.player {
27
27
+
min-height: 2.6em;
28
28
+
}
29
29
+
}
30
30
31
31
-
.icon {
32
32
-
font-size: 1.3em;
33
33
-
}
34
34
-
.button {
35
35
-
@include button($flat: true, $radii: $panel_button_radius);
36
36
-
> * {
37
37
-
padding: 0.4em;
38
38
-
}
31
31
+
.icon {
32
32
+
font-size: 1.3em;
33
33
+
}
34
34
+
.button {
35
35
+
@include button($flat: true, $radii: $panel_button_radius);
36
36
+
> * {
37
37
+
padding: 0.4em;
38
38
+
}
39
39
40
40
-
&.launcher {
41
41
-
color: $blue;
42
42
-
}
43
43
-
&.powermenu {
44
44
-
color: $red;
45
45
-
}
40
40
+
&.launcher {
41
41
+
color: $blue;
42
42
+
}
43
43
+
&.powermenu {
44
44
+
color: $red;
45
45
+
}
46
46
47
47
-
&.clock {
48
48
-
@include button($flat: false, $interactive: true);
49
49
-
label {
50
50
-
font-size: 1.4em;
51
51
-
}
52
52
-
.separator {
53
53
-
min-height: 0.2em;
54
54
-
padding: 0 0.3em;
55
55
-
.dot {
56
56
-
min-height: 0.15em;
57
57
-
min-width: 0.15em;
58
58
-
border-radius: $radii;
59
59
-
background-color: $fg_color;
60
60
-
}
61
61
-
}
62
62
-
}
47
47
+
&.clock {
48
48
+
@include button($flat: false, $interactive: true);
49
49
+
label {
50
50
+
font-size: 1.4em;
51
51
+
}
52
52
+
.separator {
53
53
+
min-height: 0.2em;
54
54
+
padding: 0 0.3em;
55
55
+
.dot {
56
56
+
min-height: 0.15em;
57
57
+
min-width: 0.15em;
58
58
+
border-radius: $radii;
59
59
+
background-color: $fg_color;
60
60
+
}
61
61
+
}
62
62
+
}
63
63
64
64
-
&.workspaces {
65
65
-
@include workspaces;
66
66
-
}
64
64
+
&.workspaces {
65
65
+
@include workspaces;
66
66
+
}
67
67
68
68
-
&.system-indicators {
69
69
-
@include system-indicators($orientation: "v");
70
70
-
}
71
71
-
}
68
68
+
&.system-indicators {
69
69
+
@include system-indicators($orientation: "v");
70
70
+
}
71
71
+
}
72
72
73
73
-
> * > .separator {
74
74
-
margin: 0.3em 0;
75
75
-
padding: 0 0.8em;
76
76
-
.dot {
77
77
-
min-height: 0.3em;
78
78
-
min-width: 0.3em;
79
79
-
border-radius: $radii;
80
80
-
background-color: transparentize($fg_color, 0.6);
81
81
-
}
82
82
-
}
73
73
+
> * > .separator {
74
74
+
margin: 0.3em 0;
75
75
+
padding: 0 0.8em;
76
76
+
.dot {
77
77
+
min-height: 0.3em;
78
78
+
min-width: 0.3em;
79
79
+
border-radius: $radii;
80
80
+
background-color: transparentize($fg_color, 0.6);
81
81
+
}
82
82
+
}
83
83
}
+280
-280
modules/base/common/services/monitoring/grafana/dashboards/uptime-02.json
···
1
1
{
2
2
-
"annotations": {
3
3
-
"list": [
4
4
-
{
5
5
-
"builtIn": 1,
6
6
-
"datasource": {
7
7
-
"type": "grafana",
8
8
-
"uid": "-- Grafana --"
9
9
-
},
10
10
-
"enable": true,
11
11
-
"hide": true,
12
12
-
"iconColor": "rgba(0, 211, 255, 1)",
13
13
-
"name": "Annotations & Alerts",
14
14
-
"type": "dashboard"
15
15
-
}
16
16
-
]
17
17
-
},
18
18
-
"editable": true,
19
19
-
"fiscalYearStartMonth": 0,
20
20
-
"graphTooltip": 0,
21
21
-
"id": 1,
22
22
-
"links": [],
23
23
-
"liveNow": false,
24
24
-
"panels": [
25
25
-
{
26
26
-
"datasource": {
27
27
-
"type": "prometheus",
28
28
-
"uid": "PBFA97CFB590B2093"
29
29
-
},
30
30
-
"fieldConfig": {
31
31
-
"defaults": {
32
32
-
"color": {
33
33
-
"mode": "palette-classic"
34
34
-
},
35
35
-
"custom": {
36
36
-
"axisBorderShow": false,
37
37
-
"axisCenteredZero": false,
38
38
-
"axisColorMode": "text",
39
39
-
"axisLabel": "",
40
40
-
"axisPlacement": "auto",
41
41
-
"barAlignment": 0,
42
42
-
"drawStyle": "line",
43
43
-
"fillOpacity": 0,
44
44
-
"gradientMode": "none",
45
45
-
"hideFrom": {
46
46
-
"legend": false,
47
47
-
"tooltip": false,
48
48
-
"viz": false
49
49
-
},
50
50
-
"insertNulls": false,
51
51
-
"lineInterpolation": "linear",
52
52
-
"lineWidth": 4,
53
53
-
"pointSize": 5,
54
54
-
"scaleDistribution": {
55
55
-
"type": "linear"
56
56
-
},
57
57
-
"showPoints": "auto",
58
58
-
"spanNulls": false,
59
59
-
"stacking": {
60
60
-
"group": "A",
61
61
-
"mode": "none"
62
62
-
},
63
63
-
"thresholdsStyle": {
64
64
-
"mode": "off"
65
65
-
}
66
66
-
},
67
67
-
"mappings": [
68
68
-
{
69
69
-
"options": {
70
70
-
"from": 0.9,
71
71
-
"result": {
72
72
-
"color": "green",
73
73
-
"index": 0,
74
74
-
"text": "Active"
75
75
-
},
76
76
-
"to": 1
77
77
-
},
78
78
-
"type": "range"
79
79
-
},
80
80
-
{
81
81
-
"options": {
82
82
-
"from": 0.3,
83
83
-
"result": {
84
84
-
"color": "yellow",
85
85
-
"index": 1,
86
86
-
"text": "Intermitant"
87
87
-
},
88
88
-
"to": 0.9
89
89
-
},
90
90
-
"type": "range"
91
91
-
},
92
92
-
{
93
93
-
"options": {
94
94
-
"from": 0,
95
95
-
"result": {
96
96
-
"color": "red",
97
97
-
"index": 2,
98
98
-
"text": "Failing"
99
99
-
},
100
100
-
"to": 0.3
101
101
-
},
102
102
-
"type": "range"
103
103
-
}
104
104
-
],
105
105
-
"max": 1,
106
106
-
"min": 0,
107
107
-
"thresholds": {
108
108
-
"mode": "percentage",
109
109
-
"steps": [
110
110
-
{
111
111
-
"color": "red",
112
112
-
"value": null
113
113
-
},
114
114
-
{
115
115
-
"color": "green",
116
116
-
"value": 80
117
117
-
}
118
118
-
]
119
119
-
}
120
120
-
},
121
121
-
"overrides": []
122
122
-
},
123
123
-
"gridPos": {
124
124
-
"h": 12,
125
125
-
"w": 14,
126
126
-
"x": 0,
127
127
-
"y": 0
128
128
-
},
129
129
-
"id": 1,
130
130
-
"options": {
131
131
-
"legend": {
132
132
-
"calcs": [],
133
133
-
"displayMode": "list",
134
134
-
"placement": "bottom",
135
135
-
"showLegend": true
136
136
-
},
137
137
-
"tooltip": {
138
138
-
"mode": "single",
139
139
-
"sort": "none"
140
140
-
}
141
141
-
},
142
142
-
"targets": [
143
143
-
{
144
144
-
"datasource": {
145
145
-
"type": "prometheus",
146
146
-
"uid": "PBFA97CFB590B2093"
147
147
-
},
148
148
-
"disableTextWrap": false,
149
149
-
"editorMode": "builder",
150
150
-
"expr": "node_systemd_unit_state{name=\"docker-isabelroses-com.service\", state=\"active\"}",
151
151
-
"fullMetaSearch": false,
152
152
-
"includeNullMetadata": true,
153
153
-
"instant": false,
154
154
-
"legendFormat": "Isabelroses.com",
155
155
-
"range": true,
156
156
-
"refId": "Isabelroses.com",
157
157
-
"useBackend": false
158
158
-
},
159
159
-
{
160
160
-
"datasource": {
161
161
-
"type": "prometheus",
162
162
-
"uid": "PBFA97CFB590B2093"
163
163
-
},
164
164
-
"disableTextWrap": false,
165
165
-
"editorMode": "builder",
166
166
-
"expr": "node_systemd_unit_state{name=\"forgejo.service\", state=\"active\"}",
167
167
-
"fullMetaSearch": false,
168
168
-
"hide": false,
169
169
-
"includeNullMetadata": true,
170
170
-
"instant": false,
171
171
-
"legendFormat": "forgejo",
172
172
-
"range": true,
173
173
-
"refId": "forgejo",
174
174
-
"useBackend": false
175
175
-
},
176
176
-
{
177
177
-
"datasource": {
178
178
-
"type": "prometheus",
179
179
-
"uid": "PBFA97CFB590B2093"
180
180
-
},
181
181
-
"disableTextWrap": false,
182
182
-
"editorMode": "builder",
183
183
-
"expr": "node_systemd_unit_state{name=\"opendkim.service\", state=\"active\"}",
184
184
-
"fullMetaSearch": false,
185
185
-
"hide": false,
186
186
-
"includeNullMetadata": true,
187
187
-
"instant": false,
188
188
-
"legendFormat": "Mailserver",
189
189
-
"range": true,
190
190
-
"refId": "Mailserver",
191
191
-
"useBackend": false
192
192
-
},
193
193
-
{
194
194
-
"datasource": {
195
195
-
"type": "prometheus",
196
196
-
"uid": "PBFA97CFB590B2093"
197
197
-
},
198
198
-
"disableTextWrap": false,
199
199
-
"editorMode": "builder",
200
200
-
"expr": "node_systemd_unit_state{name=\"phpfpm-roundcube.service\", state=\"active\"}",
201
201
-
"fullMetaSearch": false,
202
202
-
"hide": false,
203
203
-
"includeNullMetadata": true,
204
204
-
"instant": false,
205
205
-
"legendFormat": "Webmail",
206
206
-
"range": true,
207
207
-
"refId": "Webmail",
208
208
-
"useBackend": false
209
209
-
},
210
210
-
{
211
211
-
"datasource": {
212
212
-
"type": "prometheus",
213
213
-
"uid": "PBFA97CFB590B2093"
214
214
-
},
215
215
-
"disableTextWrap": false,
216
216
-
"editorMode": "builder",
217
217
-
"expr": "node_systemd_unit_state{name=\"matrix-synapse.service\", state=\"active\"}",
218
218
-
"fullMetaSearch": false,
219
219
-
"hide": false,
220
220
-
"includeNullMetadata": true,
221
221
-
"instant": false,
222
222
-
"legendFormat": "Matrix",
223
223
-
"range": true,
224
224
-
"refId": "Matrix",
225
225
-
"useBackend": false
226
226
-
},
227
227
-
{
228
228
-
"datasource": {
229
229
-
"type": "prometheus",
230
230
-
"uid": "PBFA97CFB590B2093"
231
231
-
},
232
232
-
"disableTextWrap": false,
233
233
-
"editorMode": "builder",
234
234
-
"expr": "node_systemd_unit_state{name=\"vaultwarden.service\", state=\"active\"}",
235
235
-
"fullMetaSearch": false,
236
236
-
"hide": false,
237
237
-
"includeNullMetadata": true,
238
238
-
"instant": false,
239
239
-
"legendFormat": "Vaultwarden",
240
240
-
"range": true,
241
241
-
"refId": "Vaultwarden",
242
242
-
"useBackend": false
243
243
-
},
244
244
-
{
245
245
-
"datasource": {
246
246
-
"type": "prometheus",
247
247
-
"uid": "PBFA97CFB590B2093"
248
248
-
},
249
249
-
"disableTextWrap": false,
250
250
-
"editorMode": "builder",
251
251
-
"expr": "node_systemd_unit_state{name=\"phpfpm-nextcloud.service\", state=\"active\"}",
252
252
-
"fullMetaSearch": false,
253
253
-
"hide": false,
254
254
-
"includeNullMetadata": true,
255
255
-
"instant": false,
256
256
-
"legendFormat": "Nextcloud",
257
257
-
"range": true,
258
258
-
"refId": "Nextcloud",
259
259
-
"useBackend": false
260
260
-
}
261
261
-
],
262
262
-
"title": "Uptime",
263
263
-
"type": "timeseries"
264
264
-
}
265
265
-
],
266
266
-
"refresh": "",
267
267
-
"schemaVersion": 38,
268
268
-
"tags": [],
269
269
-
"templating": {
270
270
-
"list": []
271
271
-
},
272
272
-
"time": {
273
273
-
"from": "now-6h",
274
274
-
"to": "now"
275
275
-
},
276
276
-
"timepicker": {},
277
277
-
"timezone": "",
278
278
-
"title": "Uptime",
279
279
-
"uid": "b71552d2-05a6-45f6-8cc2-668da897b591",
280
280
-
"version": 3,
281
281
-
"weekStart": ""
2
2
+
"annotations": {
3
3
+
"list": [
4
4
+
{
5
5
+
"builtIn": 1,
6
6
+
"datasource": {
7
7
+
"type": "grafana",
8
8
+
"uid": "-- Grafana --"
9
9
+
},
10
10
+
"enable": true,
11
11
+
"hide": true,
12
12
+
"iconColor": "rgba(0, 211, 255, 1)",
13
13
+
"name": "Annotations & Alerts",
14
14
+
"type": "dashboard"
15
15
+
}
16
16
+
]
17
17
+
},
18
18
+
"editable": true,
19
19
+
"fiscalYearStartMonth": 0,
20
20
+
"graphTooltip": 0,
21
21
+
"id": 1,
22
22
+
"links": [],
23
23
+
"liveNow": false,
24
24
+
"panels": [
25
25
+
{
26
26
+
"datasource": {
27
27
+
"type": "prometheus",
28
28
+
"uid": "PBFA97CFB590B2093"
29
29
+
},
30
30
+
"fieldConfig": {
31
31
+
"defaults": {
32
32
+
"color": {
33
33
+
"mode": "palette-classic"
34
34
+
},
35
35
+
"custom": {
36
36
+
"axisBorderShow": false,
37
37
+
"axisCenteredZero": false,
38
38
+
"axisColorMode": "text",
39
39
+
"axisLabel": "",
40
40
+
"axisPlacement": "auto",
41
41
+
"barAlignment": 0,
42
42
+
"drawStyle": "line",
43
43
+
"fillOpacity": 0,
44
44
+
"gradientMode": "none",
45
45
+
"hideFrom": {
46
46
+
"legend": false,
47
47
+
"tooltip": false,
48
48
+
"viz": false
49
49
+
},
50
50
+
"insertNulls": false,
51
51
+
"lineInterpolation": "linear",
52
52
+
"lineWidth": 4,
53
53
+
"pointSize": 5,
54
54
+
"scaleDistribution": {
55
55
+
"type": "linear"
56
56
+
},
57
57
+
"showPoints": "auto",
58
58
+
"spanNulls": false,
59
59
+
"stacking": {
60
60
+
"group": "A",
61
61
+
"mode": "none"
62
62
+
},
63
63
+
"thresholdsStyle": {
64
64
+
"mode": "off"
65
65
+
}
66
66
+
},
67
67
+
"mappings": [
68
68
+
{
69
69
+
"options": {
70
70
+
"from": 0.9,
71
71
+
"result": {
72
72
+
"color": "green",
73
73
+
"index": 0,
74
74
+
"text": "Active"
75
75
+
},
76
76
+
"to": 1
77
77
+
},
78
78
+
"type": "range"
79
79
+
},
80
80
+
{
81
81
+
"options": {
82
82
+
"from": 0.3,
83
83
+
"result": {
84
84
+
"color": "yellow",
85
85
+
"index": 1,
86
86
+
"text": "Intermitant"
87
87
+
},
88
88
+
"to": 0.9
89
89
+
},
90
90
+
"type": "range"
91
91
+
},
92
92
+
{
93
93
+
"options": {
94
94
+
"from": 0,
95
95
+
"result": {
96
96
+
"color": "red",
97
97
+
"index": 2,
98
98
+
"text": "Failing"
99
99
+
},
100
100
+
"to": 0.3
101
101
+
},
102
102
+
"type": "range"
103
103
+
}
104
104
+
],
105
105
+
"max": 1,
106
106
+
"min": 0,
107
107
+
"thresholds": {
108
108
+
"mode": "percentage",
109
109
+
"steps": [
110
110
+
{
111
111
+
"color": "red",
112
112
+
"value": null
113
113
+
},
114
114
+
{
115
115
+
"color": "green",
116
116
+
"value": 80
117
117
+
}
118
118
+
]
119
119
+
}
120
120
+
},
121
121
+
"overrides": []
122
122
+
},
123
123
+
"gridPos": {
124
124
+
"h": 12,
125
125
+
"w": 14,
126
126
+
"x": 0,
127
127
+
"y": 0
128
128
+
},
129
129
+
"id": 1,
130
130
+
"options": {
131
131
+
"legend": {
132
132
+
"calcs": [],
133
133
+
"displayMode": "list",
134
134
+
"placement": "bottom",
135
135
+
"showLegend": true
136
136
+
},
137
137
+
"tooltip": {
138
138
+
"mode": "single",
139
139
+
"sort": "none"
140
140
+
}
141
141
+
},
142
142
+
"targets": [
143
143
+
{
144
144
+
"datasource": {
145
145
+
"type": "prometheus",
146
146
+
"uid": "PBFA97CFB590B2093"
147
147
+
},
148
148
+
"disableTextWrap": false,
149
149
+
"editorMode": "builder",
150
150
+
"expr": "node_systemd_unit_state{name=\"docker-isabelroses-com.service\", state=\"active\"}",
151
151
+
"fullMetaSearch": false,
152
152
+
"includeNullMetadata": true,
153
153
+
"instant": false,
154
154
+
"legendFormat": "Isabelroses.com",
155
155
+
"range": true,
156
156
+
"refId": "Isabelroses.com",
157
157
+
"useBackend": false
158
158
+
},
159
159
+
{
160
160
+
"datasource": {
161
161
+
"type": "prometheus",
162
162
+
"uid": "PBFA97CFB590B2093"
163
163
+
},
164
164
+
"disableTextWrap": false,
165
165
+
"editorMode": "builder",
166
166
+
"expr": "node_systemd_unit_state{name=\"forgejo.service\", state=\"active\"}",
167
167
+
"fullMetaSearch": false,
168
168
+
"hide": false,
169
169
+
"includeNullMetadata": true,
170
170
+
"instant": false,
171
171
+
"legendFormat": "forgejo",
172
172
+
"range": true,
173
173
+
"refId": "forgejo",
174
174
+
"useBackend": false
175
175
+
},
176
176
+
{
177
177
+
"datasource": {
178
178
+
"type": "prometheus",
179
179
+
"uid": "PBFA97CFB590B2093"
180
180
+
},
181
181
+
"disableTextWrap": false,
182
182
+
"editorMode": "builder",
183
183
+
"expr": "node_systemd_unit_state{name=\"opendkim.service\", state=\"active\"}",
184
184
+
"fullMetaSearch": false,
185
185
+
"hide": false,
186
186
+
"includeNullMetadata": true,
187
187
+
"instant": false,
188
188
+
"legendFormat": "Mailserver",
189
189
+
"range": true,
190
190
+
"refId": "Mailserver",
191
191
+
"useBackend": false
192
192
+
},
193
193
+
{
194
194
+
"datasource": {
195
195
+
"type": "prometheus",
196
196
+
"uid": "PBFA97CFB590B2093"
197
197
+
},
198
198
+
"disableTextWrap": false,
199
199
+
"editorMode": "builder",
200
200
+
"expr": "node_systemd_unit_state{name=\"phpfpm-roundcube.service\", state=\"active\"}",
201
201
+
"fullMetaSearch": false,
202
202
+
"hide": false,
203
203
+
"includeNullMetadata": true,
204
204
+
"instant": false,
205
205
+
"legendFormat": "Webmail",
206
206
+
"range": true,
207
207
+
"refId": "Webmail",
208
208
+
"useBackend": false
209
209
+
},
210
210
+
{
211
211
+
"datasource": {
212
212
+
"type": "prometheus",
213
213
+
"uid": "PBFA97CFB590B2093"
214
214
+
},
215
215
+
"disableTextWrap": false,
216
216
+
"editorMode": "builder",
217
217
+
"expr": "node_systemd_unit_state{name=\"matrix-synapse.service\", state=\"active\"}",
218
218
+
"fullMetaSearch": false,
219
219
+
"hide": false,
220
220
+
"includeNullMetadata": true,
221
221
+
"instant": false,
222
222
+
"legendFormat": "Matrix",
223
223
+
"range": true,
224
224
+
"refId": "Matrix",
225
225
+
"useBackend": false
226
226
+
},
227
227
+
{
228
228
+
"datasource": {
229
229
+
"type": "prometheus",
230
230
+
"uid": "PBFA97CFB590B2093"
231
231
+
},
232
232
+
"disableTextWrap": false,
233
233
+
"editorMode": "builder",
234
234
+
"expr": "node_systemd_unit_state{name=\"vaultwarden.service\", state=\"active\"}",
235
235
+
"fullMetaSearch": false,
236
236
+
"hide": false,
237
237
+
"includeNullMetadata": true,
238
238
+
"instant": false,
239
239
+
"legendFormat": "Vaultwarden",
240
240
+
"range": true,
241
241
+
"refId": "Vaultwarden",
242
242
+
"useBackend": false
243
243
+
},
244
244
+
{
245
245
+
"datasource": {
246
246
+
"type": "prometheus",
247
247
+
"uid": "PBFA97CFB590B2093"
248
248
+
},
249
249
+
"disableTextWrap": false,
250
250
+
"editorMode": "builder",
251
251
+
"expr": "node_systemd_unit_state{name=\"phpfpm-nextcloud.service\", state=\"active\"}",
252
252
+
"fullMetaSearch": false,
253
253
+
"hide": false,
254
254
+
"includeNullMetadata": true,
255
255
+
"instant": false,
256
256
+
"legendFormat": "Nextcloud",
257
257
+
"range": true,
258
258
+
"refId": "Nextcloud",
259
259
+
"useBackend": false
260
260
+
}
261
261
+
],
262
262
+
"title": "Uptime",
263
263
+
"type": "timeseries"
264
264
+
}
265
265
+
],
266
266
+
"refresh": "",
267
267
+
"schemaVersion": 38,
268
268
+
"tags": [],
269
269
+
"templating": {
270
270
+
"list": []
271
271
+
},
272
272
+
"time": {
273
273
+
"from": "now-6h",
274
274
+
"to": "now"
275
275
+
},
276
276
+
"timepicker": {},
277
277
+
"timezone": "",
278
278
+
"title": "Uptime",
279
279
+
"uid": "b71552d2-05a6-45f6-8cc2-668da897b591",
280
280
+
"version": 3,
281
281
+
"weekStart": ""
282
282
}