forked from Shinonome/dots-hyprland
ags: NixOS compatibility; Partially migrate to new AgsStack syntax
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, () => {
|
||||
|
||||
@@ -122,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