forked from Shinonome/dots-hyprland
wifi: right click -> configure with sidebar
This commit is contained in:
@@ -268,6 +268,12 @@ export const ExpandingIconTabContainer = ({
|
|||||||
mainBox.nextTab = () => shownIndex.value = Math.min(shownIndex.value + 1, count - 1);
|
mainBox.nextTab = () => shownIndex.value = Math.min(shownIndex.value + 1, count - 1);
|
||||||
mainBox.prevTab = () => shownIndex.value = Math.max(shownIndex.value - 1, 0);
|
mainBox.prevTab = () => shownIndex.value = Math.max(shownIndex.value - 1, 0);
|
||||||
mainBox.cycleTab = () => shownIndex.value = (shownIndex.value + 1) % count;
|
mainBox.cycleTab = () => shownIndex.value = (shownIndex.value + 1) % count;
|
||||||
|
mainBox.focusName = (name) => {
|
||||||
|
const focusIndex = names.indexOf(name);
|
||||||
|
if (focusIndex !== -1) {
|
||||||
|
shownIndex.value = focusIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
mainBox.shown = shownIndex;
|
mainBox.shown = shownIndex;
|
||||||
|
|
||||||
return mainBox;
|
return mainBox;
|
||||||
|
|||||||
@@ -9,14 +9,14 @@ const { execAsync, exec } = Utils;
|
|||||||
import { BluetoothIndicator, NetworkIndicator } from '../.commonwidgets/statusicons.js';
|
import { BluetoothIndicator, NetworkIndicator } from '../.commonwidgets/statusicons.js';
|
||||||
import { setupCursorHover } from '../.widgetutils/cursorhover.js';
|
import { setupCursorHover } from '../.widgetutils/cursorhover.js';
|
||||||
import { MaterialIcon } from '../.commonwidgets/materialicon.js';
|
import { MaterialIcon } from '../.commonwidgets/materialicon.js';
|
||||||
|
import { sidebarOptionsStack } from './sideright.js';
|
||||||
|
|
||||||
export const ToggleIconWifi = (props = {}) => Widget.Button({
|
export const ToggleIconWifi = (props = {}) => Widget.Button({
|
||||||
className: 'txt-small sidebar-iconbutton',
|
className: 'txt-small sidebar-iconbutton',
|
||||||
tooltipText: 'Wifi | Right-click to configure',
|
tooltipText: 'Wifi | Right-click to configure',
|
||||||
onClicked: () => Network.toggleWifi(),
|
onClicked: () => Network.toggleWifi(),
|
||||||
onSecondaryClickRelease: () => {
|
onSecondaryClick: () => {
|
||||||
execAsync(['bash', '-c', `${userOptions.apps.network}`, '&']);
|
sidebarOptionsStack.focusName('Wifi networks')
|
||||||
App.closeWindow('sideright');
|
|
||||||
},
|
},
|
||||||
child: NetworkIndicator(),
|
child: NetworkIndicator(),
|
||||||
setup: (self) => {
|
setup: (self) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user