feat(ags): add path variable and use powermenu widget
This commit is contained in:
parent
087901b2d6
commit
59ae78fb54
9 changed files with 14 additions and 14 deletions
|
@ -1,4 +1,3 @@
|
||||||
const { Battery } = ags.Service;
|
|
||||||
const { Label, Icon, Stack, ProgressBar, Overlay, Box } = ags.Widget;
|
const { Label, Icon, Stack, ProgressBar, Overlay, Box } = ags.Widget;
|
||||||
import { Separator } from '../common.js';
|
import { Separator } from '../common.js';
|
||||||
const { exec } = ags.Utils;
|
const { exec } = ags.Utils;
|
||||||
|
|
|
@ -20,7 +20,7 @@ export const Heart = EventBox({
|
||||||
className: 'toggle-off',
|
className: 'toggle-off',
|
||||||
halign: 'center',
|
halign: 'center',
|
||||||
onPrimaryClickRelease: () => {
|
onPrimaryClickRelease: () => {
|
||||||
exec('/home/matt/.nix/config/ags/bin/heart.sh toggle');
|
exec("bash -c '$AGS_PATH/heart.sh toggle'");
|
||||||
},
|
},
|
||||||
child: Box({
|
child: Box({
|
||||||
className: 'heart-toggle',
|
className: 'heart-toggle',
|
||||||
|
|
|
@ -4,13 +4,13 @@ import { EventBox } from '../common.js';
|
||||||
const deflisten = subprocess;
|
const deflisten = subprocess;
|
||||||
|
|
||||||
deflisten(
|
deflisten(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/notif.sh icon'],
|
['bash', '-c', '$AGS_PATH/notif.sh icon'],
|
||||||
(output) => {
|
(output) => {
|
||||||
NotifButton.child.children[0].label = ' ' + output;
|
NotifButton.child.children[0].label = ' ' + output;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
deflisten(
|
deflisten(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/notif-toggle.sh state'],
|
['bash', '-c', '$AGS_PATH/notif-toggle.sh state'],
|
||||||
(output) => {
|
(output) => {
|
||||||
print(output)
|
print(output)
|
||||||
if (output == 'On') {
|
if (output == 'On') {
|
||||||
|
@ -24,7 +24,7 @@ export const NotifButton = EventBox({
|
||||||
className: 'toggle-off',
|
className: 'toggle-off',
|
||||||
onPrimaryClickRelease: function() {
|
onPrimaryClickRelease: function() {
|
||||||
subprocess(
|
subprocess(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/notif-toggle.sh toggle'],
|
['bash', '-c', '$AGS_PATH/notif-toggle.sh toggle'],
|
||||||
(output) => {
|
(output) => {
|
||||||
print(output)
|
print(output)
|
||||||
if (output == 'On') {
|
if (output == 'On') {
|
||||||
|
|
|
@ -5,7 +5,7 @@ const deflisten = subprocess;
|
||||||
import { EventBox } from '../common.js';
|
import { EventBox } from '../common.js';
|
||||||
|
|
||||||
deflisten(
|
deflisten(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/osk-toggle.sh getState'],
|
['bash', '-c', '$AGS_PATH/osk-toggle.sh getState'],
|
||||||
(output) => {
|
(output) => {
|
||||||
if (output == 'Running') {
|
if (output == 'Running') {
|
||||||
OskToggle.toggleClassName('toggle-on', true);
|
OskToggle.toggleClassName('toggle-on', true);
|
||||||
|
@ -18,7 +18,7 @@ export const OskToggle = EventBox({
|
||||||
className: 'toggle-off',
|
className: 'toggle-off',
|
||||||
onPrimaryClickRelease: function() {
|
onPrimaryClickRelease: function() {
|
||||||
subprocess(
|
subprocess(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/osk-toggle.sh toggle'],
|
['bash', '-c', '$AGS_PATH/osk-toggle.sh toggle'],
|
||||||
(output) => {
|
(output) => {
|
||||||
if (output == 'Running') {
|
if (output == 'Running') {
|
||||||
OskToggle.toggleClassName('toggle-on', false);
|
OskToggle.toggleClassName('toggle-on', false);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { EventBox } from '../common.js';
|
||||||
const deflisten = subprocess;
|
const deflisten = subprocess;
|
||||||
|
|
||||||
deflisten(
|
deflisten(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/qs-toggle.sh state'],
|
['bash', '-c', '$AGS_PATH/qs-toggle.sh state'],
|
||||||
(output) => {
|
(output) => {
|
||||||
print(output)
|
print(output)
|
||||||
if (output == 'On') {
|
if (output == 'On') {
|
||||||
|
@ -18,7 +18,7 @@ export const QsToggle = EventBox({
|
||||||
className: 'toggle-off',
|
className: 'toggle-off',
|
||||||
onPrimaryClickRelease: function() {
|
onPrimaryClickRelease: function() {
|
||||||
subprocess(
|
subprocess(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/qs-toggle.sh toggle'],
|
['bash', '-c', '$AGS_PATH/qs-toggle.sh toggle'],
|
||||||
(output) => {
|
(output) => {
|
||||||
print(output)
|
print(output)
|
||||||
if (output == 'On') {
|
if (output == 'On') {
|
||||||
|
|
|
@ -7,7 +7,7 @@ export const TabletToggle = EventBox({
|
||||||
className: 'toggle-off',
|
className: 'toggle-off',
|
||||||
onPrimaryClickRelease: function() {
|
onPrimaryClickRelease: function() {
|
||||||
subprocess(
|
subprocess(
|
||||||
['bash', '-c', '/home/matt/.nix/config/ags/bin/tablet-toggle.sh toggle'],
|
['bash', '-c', '$AGS_PATH/tablet-toggle.sh toggle'],
|
||||||
(output) => {
|
(output) => {
|
||||||
print(output)
|
print(output)
|
||||||
if (output == 'Tablet') {
|
if (output == 'Tablet') {
|
||||||
|
|
|
@ -9,7 +9,7 @@ export const Powermenu = ags.Widget.Window({
|
||||||
|
|
||||||
startWidget: ags.Widget.Button({
|
startWidget: ags.Widget.Button({
|
||||||
className: 'shutdown',
|
className: 'shutdown',
|
||||||
onPrimaryClickRelease: 'echo shutdown',
|
onPrimaryClickRelease: 'systemctl poweroff',
|
||||||
|
|
||||||
child: ags.Widget.Label({
|
child: ags.Widget.Label({
|
||||||
label: '襤',
|
label: '襤',
|
||||||
|
@ -18,7 +18,7 @@ export const Powermenu = ags.Widget.Window({
|
||||||
|
|
||||||
centerWidget: ags.Widget.Button({
|
centerWidget: ags.Widget.Button({
|
||||||
className: 'reboot',
|
className: 'reboot',
|
||||||
onPrimaryClickRelease: 'echo reboot',
|
onPrimaryClickRelease: 'systemctl reboot',
|
||||||
|
|
||||||
child: ags.Widget.Label({
|
child: ags.Widget.Label({
|
||||||
label: '勒',
|
label: '勒',
|
||||||
|
@ -27,7 +27,7 @@ export const Powermenu = ags.Widget.Window({
|
||||||
|
|
||||||
endWidget: ags.Widget.Button({
|
endWidget: ags.Widget.Button({
|
||||||
className: 'logout',
|
className: 'logout',
|
||||||
onPrimaryClickRelease: 'echo logout',
|
onPrimaryClickRelease: 'hyprctl dispatch exit',
|
||||||
|
|
||||||
child: ags.Widget.Label({
|
child: ags.Widget.Label({
|
||||||
label: '',
|
label: '',
|
||||||
|
|
|
@ -173,7 +173,7 @@ bind = $mainMod, T, togglespecialworkspace, thunder
|
||||||
bind = $mainMod, C, killactive,
|
bind = $mainMod, C, killactive,
|
||||||
|
|
||||||
bind = $mainMod, L, exec, $LOCK_PATH/lock.sh
|
bind = $mainMod, L, exec, $LOCK_PATH/lock.sh
|
||||||
bind = $mainMod SHIFT, E, exec, eww open closer && $EWW_PATH/open.sh powermenu
|
bind = $mainMod SHIFT, E, exec, ags toggle-window powermenu
|
||||||
bindn =, Escape, exec, $EWW_PATH/close-opened.sh
|
bindn =, Escape, exec, $EWW_PATH/close-opened.sh
|
||||||
bind = $mainMod SHIFT, SPACE, togglefloating,
|
bind = $mainMod SHIFT, SPACE, togglefloating,
|
||||||
bind = $mainMod, D, exec, wofi --show drun
|
bind = $mainMod, D, exec, wofi --show drun
|
||||||
|
|
|
@ -33,6 +33,7 @@ in
|
||||||
env = XDG_DATA_DIRS, ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
|
env = XDG_DATA_DIRS, ${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
|
||||||
$kora = "$HOME/.config/share"
|
$kora = "$HOME/.config/share"
|
||||||
|
|
||||||
|
env = AGS_PATH, ${configDir}/ags/bin
|
||||||
env = EWW_PATH, ${configDir}/eww/scripts
|
env = EWW_PATH, ${configDir}/eww/scripts
|
||||||
env = HYPR_PATH, ${configDir}/hypr/scripts
|
env = HYPR_PATH, ${configDir}/hypr/scripts
|
||||||
env = LOCK_PATH, ${configDir}/gtklock/scripts
|
env = LOCK_PATH, ${configDir}/gtklock/scripts
|
||||||
|
|
Loading…
Reference in a new issue