parent
5d27b3d975
commit
f3e06554e4
105 changed files with 245 additions and 254 deletions
nixosModules/ags/config/widgets/powermenu
32
nixosModules/ags/config/widgets/powermenu/_index.scss
Normal file
32
nixosModules/ags/config/widgets/powermenu/_index.scss
Normal file
|
@ -0,0 +1,32 @@
|
|||
@use 'sass:color';
|
||||
@use '../../style/colors';
|
||||
|
||||
.powermenu {
|
||||
font-size: 70px;
|
||||
padding: 10px;
|
||||
|
||||
icon {
|
||||
min-width: 130px;
|
||||
min-height: 130px;
|
||||
}
|
||||
|
||||
button {
|
||||
margin: 5px 10px;
|
||||
transition: all ease .2s;
|
||||
|
||||
&:hover,
|
||||
&:active {
|
||||
background-color: color.adjust(colors.$window_bg_color, $lightness: 3%);
|
||||
}
|
||||
}
|
||||
|
||||
.shutdown {
|
||||
color: colors.$red_1;
|
||||
}
|
||||
.reboot {
|
||||
color: colors.$purple_1;
|
||||
}
|
||||
.logout {
|
||||
color: colors.$yellow_1;
|
||||
}
|
||||
}
|
46
nixosModules/ags/config/widgets/powermenu/main.tsx
Normal file
46
nixosModules/ags/config/widgets/powermenu/main.tsx
Normal file
|
@ -0,0 +1,46 @@
|
|||
import { execAsync } from 'astal';
|
||||
import { Astal } from 'astal/gtk3';
|
||||
|
||||
import { hyprMessage } from '../../lib';
|
||||
|
||||
import PopupWindow from '../misc/popup-window';
|
||||
|
||||
|
||||
const PowermenuWidget = () => (
|
||||
<centerbox className="powermenu widget">
|
||||
<button
|
||||
className="shutdown button"
|
||||
cursor="pointer"
|
||||
onButtonReleaseEvent={() => execAsync(['systemctl', 'poweroff']).catch(print)}
|
||||
>
|
||||
<icon icon="system-shutdown-symbolic" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="reboot button"
|
||||
cursor="pointer"
|
||||
onButtonReleaseEvent={() => execAsync(['systemctl', 'reboot']).catch(print)}
|
||||
>
|
||||
<icon icon="system-restart-symbolic" />
|
||||
</button>
|
||||
|
||||
<button
|
||||
className="logout button"
|
||||
cursor="pointer"
|
||||
onButtonReleaseEvent={() => hyprMessage('dispatch exit').catch(print)}
|
||||
>
|
||||
<icon icon="system-log-out-symbolic" />
|
||||
</button>
|
||||
</centerbox>
|
||||
);
|
||||
|
||||
export default () => (
|
||||
<PopupWindow
|
||||
name="powermenu"
|
||||
transition="slide bottom"
|
||||
// To put it at the center of the screen
|
||||
exclusivity={Astal.Exclusivity.IGNORE}
|
||||
>
|
||||
<PowermenuWidget />
|
||||
</PopupWindow>
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue