Restructure, move launcher to astal gtk4
This commit is contained in:
parent
4a769d9eb0
commit
49595c3811
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules/
|
||||||
|
package-lock.json
|
9
build/build.js
Normal file
9
build/build.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// Using commonjs instead of ejs, because more widely compatible
|
||||||
|
const mustache = require( 'mustache' );
|
||||||
|
|
||||||
|
// Define view options (for rendering with mustache)
|
||||||
|
const view = {
|
||||||
|
// Colours
|
||||||
|
'colour_foreground': '',
|
||||||
|
}
|
||||||
|
|
19
build/package.json
Normal file
19
build/package.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "janishutz-config-build",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Build janishutz's dotfiles configs",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://git.janishutz.com/janishutz/dotfiles"
|
||||||
|
},
|
||||||
|
"license": "GPL-3.0-or-later",
|
||||||
|
"author": "janishutz",
|
||||||
|
"type": "commonjs",
|
||||||
|
"main": "build.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"mustache": "^4.2.0"
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,10 @@
|
|||||||
import { App } from "astal/gtk3"
|
import { App } from "astal/gtk4"
|
||||||
import style from "./style.scss"
|
import style from "./style.scss"
|
||||||
import Applauncher from "./ui/AppLauncher"
|
import Bar from "./widget/Bar"
|
||||||
|
|
||||||
App.start({
|
App.start({
|
||||||
instanceName: "launcher",
|
|
||||||
css: style,
|
css: style,
|
||||||
main: Applauncher,
|
main() {
|
||||||
});
|
App.get_monitors().map(Bar)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
// "checkJs": true,
|
// "checkJs": true,
|
||||||
// "allowJs": true,
|
// "allowJs": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "astal/gtk3",
|
"jsxImportSource": "astal/gtk4",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,31 +1,36 @@
|
|||||||
import { App, Astal, Gtk, Gdk } from "astal/gtk3"
|
import { App, Astal, Gtk, Gdk } from "astal/gtk4"
|
||||||
import { Variable } from "astal"
|
import { Variable } from "astal"
|
||||||
|
|
||||||
const time = Variable("").poll(1000, "date")
|
const time = Variable("").poll(1000, "date")
|
||||||
|
|
||||||
export default function AppLauncher(gdkmonitor: Gdk.Monitor) {
|
export default function Bar(gdkmonitor: Gdk.Monitor) {
|
||||||
const { TOP, LEFT, RIGHT } = Astal.WindowAnchor
|
const { TOP, LEFT, RIGHT } = Astal.WindowAnchor
|
||||||
|
|
||||||
return <window
|
return <window
|
||||||
className="Bar"
|
visible
|
||||||
|
cssClasses={["Bar"]}
|
||||||
gdkmonitor={gdkmonitor}
|
gdkmonitor={gdkmonitor}
|
||||||
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
exclusivity={Astal.Exclusivity.EXCLUSIVE}
|
||||||
anchor={TOP | LEFT | RIGHT}
|
anchor={TOP | LEFT | RIGHT}
|
||||||
application={App}>
|
application={App}>
|
||||||
<centerbox>
|
<centerbox cssName="centerbox">
|
||||||
<button
|
<button
|
||||||
onClicked="echo hello"
|
onClicked="echo hello"
|
||||||
|
hexpand
|
||||||
halign={Gtk.Align.CENTER}
|
halign={Gtk.Align.CENTER}
|
||||||
>
|
>
|
||||||
Welcome to AGS!
|
Welcome to AGS!
|
||||||
</button>
|
</button>
|
||||||
<box />
|
<box />
|
||||||
<button
|
<menubutton
|
||||||
onClicked={() => print("hello")}
|
hexpand
|
||||||
halign={Gtk.Align.CENTER}
|
halign={Gtk.Align.CENTER}
|
||||||
>
|
>
|
||||||
<label label={time()} />
|
<label label={time()} />
|
||||||
</button>
|
<popover>
|
||||||
|
<Gtk.Calendar />
|
||||||
|
</popover>
|
||||||
|
</menubutton>
|
||||||
</centerbox>
|
</centerbox>
|
||||||
</window>
|
</window>
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user