forked from Shinonome/dots-hyprland
change order of center left section of bar; introduce focus mode
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
|
||||
import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
|
||||
const { exec } = Utils;
|
||||
const { exec, execAsync } = Utils;
|
||||
import Gdk from 'gi://Gdk';
|
||||
|
||||
// Global vars for external control (through keybinds)
|
||||
@@ -8,9 +8,20 @@ export const showMusicControls = Variable(false, {})
|
||||
export const showColorScheme = Variable(false, {})
|
||||
globalThis['openMusicControls'] = showMusicControls;
|
||||
globalThis['openColorScheme'] = showColorScheme;
|
||||
|
||||
globalThis['mpris'] = Mpris;
|
||||
|
||||
// Screen size
|
||||
export const SCREEN_WIDTH = Number(exec(`bash -c "xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f1 | head -1" | awk '{print $1}'`));
|
||||
export const SCREEN_HEIGHT = Number(exec(`bash -c "xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1" | awk '{print $1}'`));
|
||||
|
||||
// Mode switching
|
||||
export const currentShellMode = Variable('normal', {}) // normal, focus
|
||||
globalThis['currentMode'] = currentShellMode;
|
||||
globalThis['cycleMode'] = () => {
|
||||
if (currentShellMode.value === 'normal') {
|
||||
currentShellMode.value = 'focus';
|
||||
} else {
|
||||
currentShellMode.value = 'normal';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user