forked from Shinonome/dots-hyprland
sync
This commit is contained in:
@@ -1,23 +1,25 @@
|
||||
const { Gdk, Gtk } = imports.gi;
|
||||
import { App, Service, Utils, Variable, Widget } from '../imports.js';
|
||||
import { App, SCREEN_WIDTH, SCREEN_HEIGHT, Service, Utils, Variable, Widget } from '../imports.js';
|
||||
const { Box, Button, Entry, EventBox, Icon, Label, Revealer, Scrollable, Stack } = Widget;
|
||||
|
||||
export const MarginRevealer = ({
|
||||
transition = 'slide_down',
|
||||
child,
|
||||
revealChild,
|
||||
showClass = 'element-show', // These are for animation curve
|
||||
showClass = 'element-show', // These are for animation curve, they don't really hide
|
||||
hideClass = 'element-hide', // Don't put margins in these classes!
|
||||
extraProperties = [],
|
||||
...rest
|
||||
}) => {
|
||||
child.toggleClassName(`${revealChild ? showClass : hideClass}`, true);
|
||||
const widget = Scrollable({
|
||||
...rest,
|
||||
css: `min-height: 0px;`,
|
||||
properties: [
|
||||
['revealChild', true], // It'll be set to false after init if it's supposed to hide
|
||||
['transition', transition],
|
||||
['show', (self) => {
|
||||
if (self._revealChild) return;
|
||||
self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
|
||||
child.toggleClassName(hideClass, false);
|
||||
child.toggleClassName(showClass, true);
|
||||
self._revealChild = true;
|
||||
@@ -38,17 +40,21 @@ export const MarginRevealer = ({
|
||||
child.css = `margin-top: -${child.get_allocated_height()}px;`;
|
||||
}],
|
||||
['toggle', (self) => {
|
||||
console.log('toggle');
|
||||
if (self._revealChild) self._hide(self);
|
||||
else self._show(self);
|
||||
}],
|
||||
...extraProperties,
|
||||
],
|
||||
child: child,
|
||||
setup: (self) => {
|
||||
self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
|
||||
if (!revealChild)
|
||||
self.set_policy(Gtk.PolicyType.ALWAYS, Gtk.PolicyType.ALWAYS);
|
||||
else
|
||||
self.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.NEVER);
|
||||
self.child = child;
|
||||
},
|
||||
...rest,
|
||||
});
|
||||
child.toggleClassName(`${revealChild ? showClass : hideClass}`, true);
|
||||
return widget;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,15 +144,37 @@ export default ({
|
||||
transition: 'slide_up',
|
||||
transitionDuration: 120,
|
||||
revealChild: false,
|
||||
child: Label({
|
||||
xalign: 0,
|
||||
className: `txt-smallie notif-body-${notifObject.urgency}`,
|
||||
useMarkup: true,
|
||||
xalign: 0,
|
||||
justify: Gtk.Justification.LEFT,
|
||||
maxWidthChars: 24,
|
||||
wrap: true,
|
||||
label: notifObject.body,
|
||||
child: Box({
|
||||
vertical: true,
|
||||
className: 'spacing-v-10',
|
||||
children: [
|
||||
Label({
|
||||
xalign: 0,
|
||||
className: `txt-smallie notif-body-${notifObject.urgency}`,
|
||||
useMarkup: true,
|
||||
xalign: 0,
|
||||
justify: Gtk.Justification.LEFT,
|
||||
maxWidthChars: 24,
|
||||
wrap: true,
|
||||
label: notifObject.body,
|
||||
}),
|
||||
Box({
|
||||
homogeneous: true,
|
||||
className: 'notif-actions',
|
||||
children: [
|
||||
Button({
|
||||
className: `notif-action notif-action-${notifObject.urgency}`,
|
||||
label: 'Close',
|
||||
onClicked: () => destroyWithAnims(),
|
||||
}),
|
||||
...notifObject.actions.map(action => Widget.Button({
|
||||
className: `notif-action notif-action-${notifObject.urgency}`,
|
||||
onClicked: () => notifObject.invoke(action.id),
|
||||
label: action.label,
|
||||
}))
|
||||
],
|
||||
})
|
||||
]
|
||||
}),
|
||||
});
|
||||
const notifIcon = Box({
|
||||
@@ -217,11 +239,13 @@ export default ({
|
||||
notifTextPreview.revealChild = false;
|
||||
notifTextExpanded.revealChild = true;
|
||||
self.child.label = 'expand_less';
|
||||
expanded = true;
|
||||
}
|
||||
else {
|
||||
notifTextPreview.revealChild = true;
|
||||
notifTextExpanded.revealChild = false;
|
||||
self.child.label = 'expand_more';
|
||||
expanded = true;
|
||||
}
|
||||
},
|
||||
child: MaterialIcon('expand_more', 'norm', {
|
||||
@@ -240,7 +264,6 @@ export default ({
|
||||
})
|
||||
|
||||
// Gesture stuff
|
||||
|
||||
const gesture = Gtk.GestureDrag.new(widget);
|
||||
var initDirX = 0;
|
||||
var initDirVertical = -1; // -1: unset, 0: horizontal, 1: vertical
|
||||
@@ -320,11 +343,13 @@ export default ({
|
||||
notifTextPreview.revealChild = false;
|
||||
notifTextExpanded.revealChild = true;
|
||||
expanded = true;
|
||||
notifExpandButton.child.label = 'expand_less';
|
||||
}
|
||||
else if (initDirVertical == 1 && offset_y < -MOVE_THRESHOLD && expanded) {
|
||||
notifTextPreview.revealChild = true;
|
||||
notifTextExpanded.revealChild = false;
|
||||
expanded = false;
|
||||
notifExpandButton.child.label = 'expand_more';
|
||||
}
|
||||
|
||||
}, 'drag-update')
|
||||
|
||||
@@ -8,13 +8,13 @@ cd ~/Videos || exit
|
||||
if [[ "$(pidof wf-recorder)" == "" ]]; then
|
||||
notify-send "Starting recording" 'recording_'"$(getdate)"'.mp4' -a 'record-script.sh'
|
||||
if [[ "$1" == "--sound" ]]; then
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor & disown
|
||||
elif [[ "$1" == "--fullscreen-sound" ]]; then
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --audio=alsa_output.pci-0000_08_00.6.analog-stereo.monitor & disown
|
||||
elif [[ "$1" == "--fullscreen" ]]; then
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t & disown
|
||||
else
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)"
|
||||
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown
|
||||
fi
|
||||
else
|
||||
/usr/bin/kill --signal SIGINT wf-recorder
|
||||
|
||||
@@ -87,9 +87,9 @@
|
||||
"BLACK_500": "#393634",
|
||||
"BLACK_700": "#33302F",
|
||||
"BLACK_900": "#2B2928",
|
||||
"accent_bg_color": "#d6baff",
|
||||
"accent_fg_color": "#3d1c70",
|
||||
"accent_color": "#d6baff",
|
||||
"accent_bg_color": "#d8baff",
|
||||
"accent_fg_color": "#3e1b6f",
|
||||
"accent_color": "#d8baff",
|
||||
"destructive_bg_color": "#ffb4a9",
|
||||
"destructive_fg_color": "#680003",
|
||||
"destructive_color": "#ffb4a9",
|
||||
@@ -104,17 +104,17 @@
|
||||
"view_bg_color": "#1d1b1e",
|
||||
"view_fg_color": "#e7e1e6",
|
||||
"headerbar_bg_color": "mix(@dialog_bg_color, @window_bg_color, 0.5)",
|
||||
"headerbar_fg_color": "#eadef7",
|
||||
"headerbar_border_color": "#4b4358",
|
||||
"headerbar_fg_color": "#eaddf7",
|
||||
"headerbar_border_color": "#4b4357",
|
||||
"headerbar_backdrop_color": "@headerbar_bg_color",
|
||||
"headerbar_shade_color": "rgba(0, 0, 0, 0.09)",
|
||||
"card_bg_color": "#111012",
|
||||
"card_fg_color": "#eadef7",
|
||||
"card_fg_color": "#eaddf7",
|
||||
"card_shade_color": "rgba(0, 0, 0, 0.09)",
|
||||
"dialog_bg_color": "#4b4358",
|
||||
"dialog_fg_color": "#eadef7",
|
||||
"popover_bg_color": "#4b4358",
|
||||
"popover_fg_color": "#eadef7",
|
||||
"dialog_bg_color": "#4b4357",
|
||||
"dialog_fg_color": "#eaddf7",
|
||||
"popover_bg_color": "#4b4357",
|
||||
"popover_fg_color": "#eaddf7",
|
||||
"thumbnail_bg_color": "#1a1b26",
|
||||
"thumbnail_fg_color": "#AEE5FA",
|
||||
"shade_color": "rgba(0, 0, 0, 0.36)",
|
||||
|
||||
@@ -1,30 +1,29 @@
|
||||
$darkmode: true;
|
||||
$primary: #e2e2e2;
|
||||
$onPrimary: #000000;
|
||||
$primaryContainer: #6b6b6b;
|
||||
$onPrimaryContainer: #e2e2e2;
|
||||
$secondary: #e2e2e2;
|
||||
$onSecondary: #000000;
|
||||
$secondaryContainer: #313131;
|
||||
$onSecondaryContainer: #e2e2e2;
|
||||
$tertiary: #e2e2e2;
|
||||
$onTertiary: #000000;
|
||||
$tertiaryContainer: #000000;
|
||||
$onTertiaryContainer: #e2e2e2;
|
||||
$error: #e2e2e2;
|
||||
$onError: #000000;
|
||||
$errorContainer: #000000;
|
||||
$onErrorContainer: #e2e2e2;
|
||||
$colorbarbg: #000000;
|
||||
$background: #000000;
|
||||
$onBackground: #e2e2e2;
|
||||
$surface: #000000;
|
||||
$onSurface: #e2e2e2;
|
||||
$surfaceVariant: #202020;
|
||||
$onSurfaceVariant: #e2e2e2;
|
||||
$outline: #a1a1a1;
|
||||
$primary: #d8baff;
|
||||
$onPrimary: #3e1b6f;
|
||||
$primaryContainer: #563587;
|
||||
$onPrimaryContainer: #eedcff;
|
||||
$secondary: #cec2da;
|
||||
$onSecondary: #352d40;
|
||||
$secondaryContainer: #4b4357;
|
||||
$onSecondaryContainer: #eaddf7;
|
||||
$tertiary: #f1b7c2;
|
||||
$onTertiary: #4a252e;
|
||||
$tertiaryContainer: #643b44;
|
||||
$onTertiaryContainer: #ffd9e1;
|
||||
$error: #ffb4a9;
|
||||
$onError: #680003;
|
||||
$errorContainer: #930006;
|
||||
$onErrorContainer: #ffb4a9;
|
||||
$colorbarbg: #111012;
|
||||
$background: #111012;
|
||||
$onBackground: #e7e1e6;
|
||||
$surface: #1d1b1e;
|
||||
$onSurface: #e7e1e6;
|
||||
$surfaceVariant: #4a454e;
|
||||
$onSurfaceVariant: #cbc4ce;
|
||||
$outline: #958f99;
|
||||
$shadow: #000000;
|
||||
$inverseSurface: #e2e2e2;
|
||||
$inverseOnSurface: #000000;
|
||||
$inversePrimary: #e2e2e2;
|
||||
|
||||
$inverseSurface: #e7e1e6;
|
||||
$inverseOnSurface: #323033;
|
||||
$inversePrimary: #6e4da1;
|
||||
|
||||
@@ -1 +1,29 @@
|
||||
|
||||
$darkmode: true;
|
||||
$primary: #c4c0ff;
|
||||
$onPrimary: #251a8c;
|
||||
$primaryContainer: #3c36a1;
|
||||
$onPrimaryContainer: #e3dfff;
|
||||
$secondary: #c7c4dd;
|
||||
$onSecondary: #2f2e42;
|
||||
$secondaryContainer: #464559;
|
||||
$onSecondaryContainer: #e3dff9;
|
||||
$tertiary: #eab9d1;
|
||||
$onTertiary: #472639;
|
||||
$tertiaryContainer: #603c50;
|
||||
$onTertiaryContainer: #ffd8eb;
|
||||
$error: #ffb4a9;
|
||||
$onError: #680003;
|
||||
$errorContainer: #930006;
|
||||
$onErrorContainer: #ffb4a9;
|
||||
$colorbarbg: #101012;
|
||||
$background: #101012;
|
||||
$onBackground: #e5e1e6;
|
||||
$surface: #1c1b1f;
|
||||
$onSurface: #e5e1e6;
|
||||
$surfaceVariant: #47464f;
|
||||
$onSurfaceVariant: #c8c5d0;
|
||||
$outline: #928f9a;
|
||||
$shadow: #000000;
|
||||
$inverseSurface: #e5e1e6;
|
||||
$inverseOnSurface: #313033;
|
||||
$inversePrimary: #5550bb;
|
||||
|
||||
@@ -1 +1,26 @@
|
||||
// SCSS Variables
|
||||
// Generated by 'wal'
|
||||
$wallpaper: "/home/end/.cache/ags/media/375d6eb3358763763a73710dca3bbfad1a5434d8";
|
||||
|
||||
// Special
|
||||
$background: #0a0919;
|
||||
$foreground: #bfacd9;
|
||||
$cursor: #bfacd9;
|
||||
|
||||
// Colors
|
||||
$color0: #0a0919;
|
||||
$color1: #2E2693;
|
||||
$color2: #382FA6;
|
||||
$color3: #4C2F99;
|
||||
$color4: #4839B3;
|
||||
$color5: #5A49B4;
|
||||
$color6: #5C4CC7;
|
||||
$color7: #bfacd9;
|
||||
$color8: #857897;
|
||||
$color9: #2E2693;
|
||||
$color10: #382FA6;
|
||||
$color11: #4C2F99;
|
||||
$color12: #4839B3;
|
||||
$color13: #5A49B4;
|
||||
$color14: #5C4CC7;
|
||||
$color15: #bfacd9;
|
||||
|
||||
@@ -154,3 +154,53 @@ $notif_surface: $t_background;
|
||||
padding: 0rem;
|
||||
color: $secondaryContainer;
|
||||
}
|
||||
|
||||
.notif-actions {
|
||||
min-height: 2.045rem;
|
||||
}
|
||||
|
||||
.notif-action {
|
||||
@include small-rounding;
|
||||
}
|
||||
|
||||
.notif-action-low {
|
||||
background-color: $l_t_surfaceVariant;
|
||||
color: $onSurfaceVariant;
|
||||
}
|
||||
|
||||
.notif-action-low:focus,
|
||||
.notif-action-low:hover {
|
||||
background-color: mix($t_onSurfaceVariant, $l_t_surfaceVariant, 10%);
|
||||
}
|
||||
|
||||
.notif-action-low:active {
|
||||
background-color: mix($t_onSurfaceVariant, $l_t_surfaceVariant, 15%);
|
||||
}
|
||||
|
||||
.notif-action-normal {
|
||||
background-color: $l_t_surfaceVariant;
|
||||
color: $onSurfaceVariant;
|
||||
}
|
||||
|
||||
.notif-action-normal:focus,
|
||||
.notif-action-normal:hover {
|
||||
background-color: mix($t_onSurfaceVariant, $l_t_surfaceVariant, 10%);
|
||||
}
|
||||
|
||||
.notif-action-normal:active {
|
||||
background-color: mix($t_onSurfaceVariant, $l_t_surfaceVariant, 15%);
|
||||
}
|
||||
|
||||
.notif-action-critical {
|
||||
background-color: $t_onSurfaceVariant;
|
||||
color: $onSurfaceVariant;
|
||||
}
|
||||
|
||||
.notif-action-critical:focus,
|
||||
.notif-action-critical:hover {
|
||||
background-color: mix($t_onSurfaceVariant, $l_t_surfaceVariant, 10%);
|
||||
}
|
||||
|
||||
.notif-action-critical:active {
|
||||
background-color: mix($t_onSurfaceVariant, $l_t_surfaceVariant, 15%);
|
||||
}
|
||||
|
||||
@@ -8,12 +8,13 @@
|
||||
}
|
||||
|
||||
.osd-value {
|
||||
@include elevation-border;
|
||||
@include elevation2;
|
||||
background-color: $t_background;
|
||||
border-radius: 1.023rem;
|
||||
padding: 0.625rem 1.023rem;
|
||||
padding-top: 0.313rem;
|
||||
margin: 10px;
|
||||
@include elevation2;
|
||||
}
|
||||
|
||||
.osd-progress {
|
||||
@@ -117,4 +118,12 @@
|
||||
background-color: $background;
|
||||
color: $onBackground;
|
||||
box { background-color: $onBackground; }
|
||||
}
|
||||
|
||||
.osd-show {
|
||||
transition: 200ms cubic-bezier(0.1, 1, 0, 1);
|
||||
}
|
||||
|
||||
.osd-hide {
|
||||
transition: 190ms cubic-bezier(0.85, 0, 0.15, 1);
|
||||
}
|
||||
@@ -503,10 +503,11 @@ $onChatgpt: $onPrimary;
|
||||
.sidebar-chat-apiswitcher {
|
||||
@include full-rounding;
|
||||
@include group-padding;
|
||||
background-color: $surface;
|
||||
background-color: $t_surface;
|
||||
}
|
||||
|
||||
.sidebar-chat-apiswitcher-icon {
|
||||
@include menu_decel;
|
||||
@include full-rounding;
|
||||
min-width: 2.182rem;
|
||||
min-height: 2.182rem;
|
||||
@@ -514,7 +515,8 @@ $onChatgpt: $onPrimary;
|
||||
}
|
||||
|
||||
.sidebar-chat-apiswitcher-icon-enabled {
|
||||
color: $primary;
|
||||
background-color: $secondaryContainer;
|
||||
color: $onSecondaryContainer;
|
||||
}
|
||||
|
||||
.sidebar-chat-viewport {
|
||||
|
||||
+425
-373
File diff suppressed because it is too large
Load Diff
@@ -3,6 +3,7 @@ const { GLib, Gtk } = imports.gi;
|
||||
import { App, Service, Utils, Widget } from '../../imports.js';
|
||||
import Audio from 'resource:///com/github/Aylur/ags/service/audio.js';
|
||||
const { Box, Label, ProgressBar, Revealer } = Widget;
|
||||
import { MarginRevealer } from '../../lib/advancedrevealers.js';
|
||||
import Brightness from '../../services/brightness.js';
|
||||
import Indicator from '../../services/indicator.js';
|
||||
|
||||
@@ -56,11 +57,14 @@ const volumeIndicator = OsdValue('Volume',
|
||||
}]],
|
||||
);
|
||||
|
||||
export default () => Revealer({
|
||||
export default () => MarginRevealer({
|
||||
transition: 'slide_down',
|
||||
showClass: 'osd-show',
|
||||
hideClass: 'osd-hide',
|
||||
connections: [
|
||||
[Indicator, (revealer, value) => {
|
||||
revealer.revealChild = (value > -1);
|
||||
if(value > -1) revealer._show(revealer);
|
||||
else revealer._hide(revealer);
|
||||
}, 'popup'],
|
||||
],
|
||||
child: Box({
|
||||
|
||||
@@ -4,6 +4,7 @@ const { exec, execAsync } = Utils;
|
||||
import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
|
||||
|
||||
const { Box, EventBox, Icon, Scrollable, Label, Button, Revealer } = Widget;
|
||||
import { MarginRevealer } from '../../lib/advancedrevealers.js';
|
||||
import { AnimatedCircProg } from "../../lib/animatedcircularprogress.js";
|
||||
import { MaterialIcon } from '../../lib/materialicon.js';
|
||||
import { showMusicControls } from '../../variables.js';
|
||||
@@ -343,9 +344,11 @@ const MusicControlsWidget = (player) => Box({
|
||||
]
|
||||
})
|
||||
|
||||
export default () => Widget.Revealer({
|
||||
export default () => MarginRevealer({
|
||||
transition: 'slide_down',
|
||||
transitionDuration: 170,
|
||||
revealChild: false,
|
||||
showClass: 'osd-show',
|
||||
hideClass: 'osd-hide',
|
||||
child: Box({
|
||||
connections: [[Mpris, box => {
|
||||
let foundPlayer = false;
|
||||
@@ -371,7 +374,8 @@ export default () => Widget.Revealer({
|
||||
}),
|
||||
connections: [
|
||||
[showMusicControls, (revealer) => {
|
||||
revealer.revealChild = showMusicControls.value;
|
||||
if(showMusicControls.value) revealer._show(revealer);
|
||||
else revealer._hide(revealer);
|
||||
}],
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user