forked from Shinonome/dots-hyprland
ags: sync
This commit is contained in:
@@ -146,11 +146,11 @@ const CalendarWidget = () => {
|
||||
const defaultShown = 'calendar';
|
||||
const contentStack = Widget.Stack({
|
||||
hexpand: true,
|
||||
items: [
|
||||
['calendar', CalendarWidget()],
|
||||
['todo', TodoWidget()],
|
||||
// ['stars', Widget.Label({ label: 'GitHub feed will be here' })],
|
||||
],
|
||||
children: {
|
||||
'calendar': CalendarWidget(),
|
||||
'todo': TodoWidget(),
|
||||
// 'stars': Widget.Label({ label: 'GitHub feed will be here' }),
|
||||
},
|
||||
transition: 'slide_up_down',
|
||||
transitionDuration: 180,
|
||||
setup: (stack) => Utils.timeout(1, () => {
|
||||
@@ -159,7 +159,7 @@ const contentStack = Widget.Stack({
|
||||
})
|
||||
|
||||
const StackButton = (stackItemName, icon, name) => Widget.Button({
|
||||
className: 'button-minsize sidebar-navrail-btn sidebar-button-alone txt-small spacing-h-5',
|
||||
className: 'button-minsize sidebar-navrail-btn txt-small spacing-h-5',
|
||||
onClicked: (button) => {
|
||||
contentStack.shown = stackItemName;
|
||||
const kids = button.get_parent().get_children();
|
||||
|
||||
@@ -2,7 +2,7 @@ import PopupWindow from '../../lib/popupwindow.js';
|
||||
import SidebarRight from "./sideright.js";
|
||||
|
||||
export default () => PopupWindow({
|
||||
focusable: true,
|
||||
keymode: 'exclusive',
|
||||
anchor: ['right', 'top', 'bottom'],
|
||||
name: 'sideright',
|
||||
showClassName: 'sideright-show',
|
||||
|
||||
@@ -85,7 +85,8 @@ export default (props) => {
|
||||
self.toggleClassName('notif-listaction-btn-enabled', Notifications.dnd);
|
||||
});
|
||||
const clearButton = ListActionButton('clear_all', 'Clear', () => {
|
||||
notificationList.get_children().forEach(ch => ch.destroy());
|
||||
// Manual destruction is not necessary
|
||||
// since Notifications.clear() sends destroy signals to every notif
|
||||
Notifications.clear();
|
||||
});
|
||||
const listTitle = Box({
|
||||
@@ -121,10 +122,10 @@ export default (props) => {
|
||||
const listContents = Stack({
|
||||
transition: 'crossfade',
|
||||
transitionDuration: 150,
|
||||
items: [
|
||||
['empty', notifEmptyContent],
|
||||
['list', notifList]
|
||||
],
|
||||
children: {
|
||||
'empty': notifEmptyContent,
|
||||
'list': notifList,
|
||||
},
|
||||
setup: (self) => self
|
||||
.hook(Notifications, (self) => self.shown = (Notifications.notifications.length > 0 ? 'list' : 'empty'))
|
||||
,
|
||||
|
||||
@@ -25,9 +25,10 @@ const timeRow = Box({
|
||||
className: 'txt-small txt',
|
||||
setup: (self) => self
|
||||
.poll(5000, label => {
|
||||
execAsync(['bash', '-c', `uptime -p | sed -e 's/up //;s/ hours,/h/;s/ minutes/m/'`]).then(upTimeString => {
|
||||
label.label = `Uptime: ${upTimeString}`;
|
||||
}).catch(print);
|
||||
execAsync(['bash', '-c', `w | sed -n '1p' | cut -d, -f1 | cut -d' ' -f4-`])
|
||||
.then(upTimeString => {
|
||||
label.label = `Uptime: ${upTimeString}`;
|
||||
}).catch(print);
|
||||
})
|
||||
,
|
||||
}),
|
||||
|
||||
@@ -202,10 +202,10 @@ const UndoneTodoList = () => {
|
||||
const todoItemsBox = Widget.Stack({
|
||||
vpack: 'fill',
|
||||
transition: 'slide_left_right',
|
||||
items: [
|
||||
['undone', UndoneTodoList()],
|
||||
['done', todoItems(true)],
|
||||
],
|
||||
children: {
|
||||
'undone': UndoneTodoList(),
|
||||
'done': todoItems(true),
|
||||
},
|
||||
});
|
||||
|
||||
export const TodoWidget = () => {
|
||||
|
||||
Reference in New Issue
Block a user