change order of center left section of bar; introduce focus mode

This commit is contained in:
end-4
2024-02-29 23:04:09 +07:00
parent f7ccb7b605
commit 79fba3e164
15 changed files with 524 additions and 47 deletions
+12 -1
View File
@@ -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';
}
}