forked from Shinonome/dots-hyprland
multimonitor for osk
This commit is contained in:
@@ -7,7 +7,7 @@ const SysTrayItem = (item) => Button({
|
|||||||
className: 'bar-systray-item',
|
className: 'bar-systray-item',
|
||||||
child: Icon({
|
child: Icon({
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
icon: item.icon,
|
icon: `${item.icon}`,
|
||||||
setup: (self) => self.hook(item, (self) => self.icon = item.icon),
|
setup: (self) => self.hook(item, (self) => self.icon = item.icon),
|
||||||
}),
|
}),
|
||||||
setup: (self) => self
|
setup: (self) => self
|
||||||
|
|||||||
@@ -62,12 +62,6 @@ const CheatsheetHeader = () => Widget.CenterBox({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const ClickOutsideToClose = () => Widget.EventBox({
|
|
||||||
onPrimaryClick: () => App.closeWindow('cheatsheet'),
|
|
||||||
onSecondaryClick: () => App.closeWindow('cheatsheet'),
|
|
||||||
onMiddleClick: () => App.closeWindow('cheatsheet'),
|
|
||||||
});
|
|
||||||
|
|
||||||
export default (id) => PopupWindow({
|
export default (id) => PopupWindow({
|
||||||
name: `cheatsheet${id}`,
|
name: `cheatsheet${id}`,
|
||||||
layer: 'overlay',
|
layer: 'overlay',
|
||||||
@@ -76,7 +70,6 @@ export default (id) => PopupWindow({
|
|||||||
child: Widget.Box({
|
child: Widget.Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
children: [
|
children: [
|
||||||
ClickOutsideToClose(),
|
|
||||||
Widget.Box({
|
Widget.Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
className: "cheatsheet-bg spacing-v-15",
|
className: "cheatsheet-bg spacing-v-15",
|
||||||
|
|||||||
@@ -6,5 +6,5 @@ export default (id) => PopupWindow({
|
|||||||
name: `osk${id}`,
|
name: `osk${id}`,
|
||||||
showClassName: 'osk-show',
|
showClassName: 'osk-show',
|
||||||
hideClassName: 'osk-hide',
|
hideClassName: 'osk-hide',
|
||||||
child: OnScreenKeyboard(),
|
child: OnScreenKeyboard({ id: id }),
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ const KeyboardWindow = () => Box({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export default () => {
|
export default ({ id }) => {
|
||||||
const kbWindow = KeyboardWindow();
|
const kbWindow = KeyboardWindow();
|
||||||
const gestureEvBox = EventBox({ child: kbWindow })
|
const gestureEvBox = EventBox({ child: kbWindow })
|
||||||
const gesture = Gtk.GestureDrag.new(gestureEvBox);
|
const gesture = Gtk.GestureDrag.new(gestureEvBox);
|
||||||
@@ -249,7 +249,7 @@ export default () => {
|
|||||||
gesture.connect('drag-end', () => {
|
gesture.connect('drag-end', () => {
|
||||||
var offset = gesture.get_offset()[2];
|
var offset = gesture.get_offset()[2];
|
||||||
if (offset > 50) {
|
if (offset > 50) {
|
||||||
App.closeWindow('osk');
|
App.closeWindow(`osk${id}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
kbWindow.setCss(`
|
kbWindow.setCss(`
|
||||||
|
|||||||
@@ -2,12 +2,12 @@ import Widget from 'resource:///com/github/Aylur/ags/widget.js';
|
|||||||
import SessionScreen from "./sessionscreen.js";
|
import SessionScreen from "./sessionscreen.js";
|
||||||
import PopupWindow from '../.widgethacks/popupwindow.js';
|
import PopupWindow from '../.widgethacks/popupwindow.js';
|
||||||
|
|
||||||
export default () => PopupWindow({ // On-screen keyboard
|
export default (id = '') => PopupWindow({ // On-screen keyboard
|
||||||
name: 'session',
|
name: `session${id}`,
|
||||||
visible: false,
|
visible: false,
|
||||||
keymode: 'exclusive',
|
keymode: 'exclusive',
|
||||||
layer: 'overlay',
|
layer: 'overlay',
|
||||||
exclusivity: 'ignore',
|
exclusivity: 'ignore',
|
||||||
anchor: ['top', 'bottom', 'left', 'right'],
|
anchor: ['top', 'bottom', 'left', 'right'],
|
||||||
child: SessionScreen(),
|
child: SessionScreen({ id: id }),
|
||||||
})
|
})
|
||||||
@@ -59,16 +59,16 @@ const SessionButton = (name, icon, command, props = {}, colorid = 0) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export default () => {
|
export default ({ id = '' }) => {
|
||||||
// lock, logout, sleep
|
// lock, logout, sleep
|
||||||
const lockButton = SessionButton('Lock', 'lock', () => { App.closeWindow('session'); execAsync(['loginctl', 'lock-session']).catch(print) }, {}, 1);
|
const lockButton = SessionButton('Lock', 'lock', () => { App.closeWindow(`session${id}`); execAsync(['loginctl', 'lock-session']).catch(print) }, {}, 1);
|
||||||
const logoutButton = SessionButton('Logout', 'logout', () => { App.closeWindow('session'); execAsync(['bash', '-c', 'pkill Hyprland || pkill sway || pkill niri || loginctl terminate-user $USER']).catch(print) }, {}, 2);
|
const logoutButton = SessionButton('Logout', 'logout', () => { App.closeWindow(`session${id}`); execAsync(['bash', '-c', 'pkill Hyprland || pkill sway || pkill niri || loginctl terminate-user $USER']).catch(print) }, {}, 2);
|
||||||
const sleepButton = SessionButton('Sleep', 'sleep', () => { App.closeWindow('session'); execAsync(['bash', '-c', 'systemctl suspend || loginctl suspend']).catch(print) }, {}, 3);
|
const sleepButton = SessionButton('Sleep', 'sleep', () => { App.closeWindow(`session${id}`); execAsync(['bash', '-c', 'systemctl suspend || loginctl suspend']).catch(print) }, {}, 3);
|
||||||
// hibernate, shutdown, reboot
|
// hibernate, shutdown, reboot
|
||||||
const hibernateButton = SessionButton('Hibernate', 'downloading', () => { App.closeWindow('session'); execAsync(['bash', '-c', 'systemctl hibernate || loginctl hibernate']).catch(print) }, {}, 4);
|
const hibernateButton = SessionButton('Hibernate', 'downloading', () => { App.closeWindow(`session${id}`); execAsync(['bash', '-c', 'systemctl hibernate || loginctl hibernate']).catch(print) }, {}, 4);
|
||||||
const shutdownButton = SessionButton('Shutdown', 'power_settings_new', () => { App.closeWindow('session'); execAsync(['bash', '-c', 'systemctl poweroff || loginctl poweroff']).catch(print) }, {}, 5);
|
const shutdownButton = SessionButton('Shutdown', 'power_settings_new', () => { App.closeWindow(`session${id}`); execAsync(['bash', '-c', 'systemctl poweroff || loginctl poweroff']).catch(print) }, {}, 5);
|
||||||
const rebootButton = SessionButton('Reboot', 'restart_alt', () => { App.closeWindow('session'); execAsync(['bash', '-c', 'systemctl reboot || loginctl reboot']).catch(print) }, {}, 6);
|
const rebootButton = SessionButton('Reboot', 'restart_alt', () => { App.closeWindow(`session${id}`); execAsync(['bash', '-c', 'systemctl reboot || loginctl reboot']).catch(print) }, {}, 6);
|
||||||
const cancelButton = SessionButton('Cancel', 'close', () => App.closeWindow('session'), { className: 'session-button-cancel' }, 7);
|
const cancelButton = SessionButton('Cancel', 'close', () => App.closeWindow(`session${id}`), { className: 'session-button-cancel' }, 7);
|
||||||
|
|
||||||
const sessionDescription = Widget.Box({
|
const sessionDescription = Widget.Box({
|
||||||
vertical: true,
|
vertical: true,
|
||||||
@@ -104,9 +104,9 @@ export default () => {
|
|||||||
vertical: true,
|
vertical: true,
|
||||||
children: [
|
children: [
|
||||||
Widget.EventBox({
|
Widget.EventBox({
|
||||||
onPrimaryClick: () => App.closeWindow('session'),
|
onPrimaryClick: () => App.closeWindow(`session${id}`),
|
||||||
onSecondaryClick: () => App.closeWindow('session'),
|
onSecondaryClick: () => App.closeWindow(`session${id}`),
|
||||||
onMiddleClick: () => App.closeWindow('session'),
|
onMiddleClick: () => App.closeWindow(`session${id}`),
|
||||||
}),
|
}),
|
||||||
Widget.Box({
|
Widget.Box({
|
||||||
hpack: 'center',
|
hpack: 'center',
|
||||||
|
|||||||
@@ -77,11 +77,6 @@ export default () => Box({
|
|||||||
hexpand: true,
|
hexpand: true,
|
||||||
css: 'min-width: 2px;',
|
css: 'min-width: 2px;',
|
||||||
children: [
|
children: [
|
||||||
EventBox({
|
|
||||||
onPrimaryClick: () => App.closeWindow('sideleft'),
|
|
||||||
onSecondaryClick: () => App.closeWindow('sideleft'),
|
|
||||||
onMiddleClick: () => App.closeWindow('sideleft'),
|
|
||||||
}),
|
|
||||||
widgetContent,
|
widgetContent,
|
||||||
],
|
],
|
||||||
setup: (self) => self
|
setup: (self) => self
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export default () => SidebarModule({
|
|||||||
className: 'sidebar-module-scripts-button',
|
className: 'sidebar-module-scripts-button',
|
||||||
child: scriptStateIcon,
|
child: scriptStateIcon,
|
||||||
onClicked: () => {
|
onClicked: () => {
|
||||||
App.closeWindow('sideleft');
|
closeEverything();
|
||||||
execAsync([`bash`, `-c`, `${userOptions.apps.terminal} fish -C "${script.command}"`]).catch(print)
|
execAsync([`bash`, `-c`, `${userOptions.apps.terminal} fish -C "${script.command}"`]).catch(print)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
scriptStateIcon.label = 'done';
|
scriptStateIcon.label = 'done';
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export const ToggleIconBluetooth = (props = {}) => Widget.Button({
|
|||||||
},
|
},
|
||||||
onSecondaryClickRelease: () => {
|
onSecondaryClickRelease: () => {
|
||||||
execAsync(['bash', '-c', `${userOptions.apps.bluetooth}`]).catch(print);
|
execAsync(['bash', '-c', `${userOptions.apps.bluetooth}`]).catch(print);
|
||||||
App.closeWindow('sideright');
|
closeEverything();
|
||||||
},
|
},
|
||||||
child: BluetoothIndicator(),
|
child: BluetoothIndicator(),
|
||||||
setup: (self) => {
|
setup: (self) => {
|
||||||
@@ -227,8 +227,8 @@ export const ModulePowerIcon = (props = {}) => Widget.Button({
|
|||||||
className: 'txt-small sidebar-iconbutton',
|
className: 'txt-small sidebar-iconbutton',
|
||||||
tooltipText: 'Session',
|
tooltipText: 'Session',
|
||||||
onClicked: () => {
|
onClicked: () => {
|
||||||
App.toggleWindow('session');
|
closeEverything();
|
||||||
App.closeWindow('sideright');
|
Utils.timeout(1, () => App.openWindow('session'));
|
||||||
},
|
},
|
||||||
child: MaterialIcon('power_settings_new', 'norm'),
|
child: MaterialIcon('power_settings_new', 'norm'),
|
||||||
setup: button => {
|
setup: button => {
|
||||||
|
|||||||
Reference in New Issue
Block a user