From 1313535e7b45095bef66e41438d5f245478d35b1 Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 7 May 2024 01:22:54 +0900 Subject: update --- config/ags/variables.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 config/ags/variables.js (limited to 'config/ags/variables.js') diff --git a/config/ags/variables.js b/config/ags/variables.js new file mode 100644 index 00000000..ec4aedec --- /dev/null +++ b/config/ags/variables.js @@ -0,0 +1,21 @@ +const { Gtk } = imports.gi; +import Variable from 'resource:///com/github/Aylur/ags/variable.js'; +import * as Utils from 'resource:///com/github/Aylur/ags/utils.js'; +const { exec, execAsync } = Utils; + +Gtk.IconTheme.get_default().append_search_path(`${App.configDir}/assets/icons`); + +// 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'; + } +} -- cgit v1.2.3