some tweaks to making hyprland work betterer

This commit is contained in:
Chris Cochrun 2024-07-01 16:33:47 -05:00
parent 64a0004f5c
commit 01f5aeeab8
4 changed files with 14 additions and 9 deletions

View file

@ -6,6 +6,9 @@ const audio = await Service.import('audio')
import { NotificationPopups } from "./notifications.js"
const laptop = Utils.exec(`hostname`) === "syl";
console.log(laptop ? "Running on syl" : "Running on kaladin");
function map_workspaces(id) {
switch (id) {
case 1:
@ -138,10 +141,11 @@ function Bar(monitor = 0) {
return Widget.Window({
monitor,
name: `bar${monitor}`, // this name has to be unique
anchor: ['bottom', 'left', 'right'],
anchor: [laptop ? 'bottom' : 'top', 'left', 'right'],
exclusivity: "exclusive",
margins: [0, 20, 8, 20],
margins: [0, 20, 0, 20],
child: Widget.CenterBox({
css: laptop ? "margin-bottom: 1em; margin-top: 0.4em" : "margin-bottom: 1em; margin-top: 1em;",
class_name: "windowbox",
startWidget: Widget.Box({
spacing: 0,
@ -158,7 +162,7 @@ function Bar(monitor = 0) {
expander,
volume_indicator,
system_tray(),
battery_function(),
laptop ? battery_function() : null
],
}),
}),
@ -168,7 +172,7 @@ function Bar(monitor = 0) {
App.config({
style: css,
windows: [
Bar(0), // can be instantiated for each monitor
Bar(laptop ? 0 : 0), // can be instantiated for each monitor
NotificationPopups(),
],
})