[Astal] Finish modes, move tray into quickactions menu
This commit is contained in:
@@ -1,44 +1,58 @@
|
||||
import { Gtk } from "astal/gtk4";
|
||||
import Power from "./modules/Power";
|
||||
import Audio from "./modules/Audio/Audio";
|
||||
import Bluetooth from "./modules/Bluetooth/Bluetooth";
|
||||
import Brightness from "./modules/Brightness/Brightness";
|
||||
import Player from "./modules/Player/Player";
|
||||
import { BatteryBox } from "./modules/Battery";
|
||||
import { exec } from "astal";
|
||||
import Network from "./modules/Networking/Network";
|
||||
import Audio from './modules/Audio/Audio';
|
||||
import {
|
||||
BatteryBox
|
||||
} from './modules/Battery';
|
||||
import Bluetooth from './modules/Bluetooth/Bluetooth';
|
||||
import Brightness from './modules/Brightness/Brightness';
|
||||
import {
|
||||
Gtk
|
||||
} from 'astal/gtk4';
|
||||
import Network from './modules/Networking/Network';
|
||||
import Player from './modules/Player/Player';
|
||||
import Power from './modules/Power';
|
||||
import SysTray from './modules/SysTray';
|
||||
import {
|
||||
exec
|
||||
} from 'astal';
|
||||
|
||||
const QuickActions = () => {
|
||||
const popover = new Gtk.Popover({ cssClasses: ["quick-actions-wrapper"] });
|
||||
popover.set_child(renderQuickActions());
|
||||
const popover = new Gtk.Popover( {
|
||||
'cssClasses': [ 'quick-actions-wrapper' ]
|
||||
} );
|
||||
|
||||
popover.set_child( renderQuickActions() );
|
||||
|
||||
return popover;
|
||||
};
|
||||
|
||||
const renderQuickActions = () => {
|
||||
const user = exec("/bin/sh -c whoami");
|
||||
const profile = exec("/bin/fish -c get-profile-picture");
|
||||
const cwd = exec("pwd");
|
||||
const user = exec( '/bin/sh -c whoami' );
|
||||
const profile = exec( '/bin/fish -c get-profile-picture' );
|
||||
const cwd = exec( 'pwd' );
|
||||
const um = Power.UserMenu();
|
||||
|
||||
return (
|
||||
<box visible cssClasses={["quick-actions", "popover-box"]} vertical>
|
||||
<box visible cssClasses={[
|
||||
'quick-actions',
|
||||
'popover-box'
|
||||
]} vertical>
|
||||
<centerbox
|
||||
startWidget={
|
||||
<button
|
||||
onClicked={() => um.popup()}
|
||||
cssClasses={["stealthy-button"]}
|
||||
cssClasses={[ 'stealthy-button' ]}
|
||||
child={
|
||||
<box>
|
||||
{um}
|
||||
<Gtk.Frame
|
||||
cssClasses={["avatar-icon"]}
|
||||
cssClasses={[ 'avatar-icon' ]}
|
||||
child={
|
||||
<image
|
||||
file={
|
||||
profile !== ""
|
||||
profile !== ''
|
||||
? profile
|
||||
: cwd +
|
||||
"/no-avatar-icon.jpg"
|
||||
: cwd
|
||||
+ '/no-avatar-icon.jpg'
|
||||
}
|
||||
></image>
|
||||
}
|
||||
@@ -53,6 +67,7 @@ const renderQuickActions = () => {
|
||||
hexpand={false}
|
||||
>
|
||||
<BatteryBox></BatteryBox>
|
||||
<SysTray.SystemTray></SysTray.SystemTray>
|
||||
<Power.Power></Power.Power>
|
||||
</box>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user