fix music controls keybind

This commit is contained in:
end-4
2024-02-22 16:20:13 +07:00
parent e9c3485f1b
commit a93399b150
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -1,13 +1,16 @@
import Variable from 'resource:///com/github/Aylur/ags/variable.js';
import Mpris from 'resource:///com/github/Aylur/ags/service/mpris.js';
const { exec } = Utils;
import Gdk from 'gi://Gdk';
// Global vars for external control (through keybinds)
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}'`));
+2 -1
View File
@@ -81,7 +81,7 @@ bind = Super, B, exec, ags -t 'sideleft'
bind = Super, A, exec, ags -t 'sideleft'
bind = Super, O, exec, ags -t 'sideleft'
bind = Super, N, exec, ags -t 'sideright'
bind = Super, M, exec, ags run-js 'openMusicControls.value = (!Mpris.getPlayer() ? false : !openMusicControls.value);'
bind = Super, M, exec, ags run-js 'openMusicControls.value = (!mpris.getPlayer() ? false : !openMusicControls.value);'
bind = Super, Comma, exec, ags run-js 'openColorScheme.value = true; Utils.timeout(2000, () => openColorScheme.value = false);'
bind = Super, K, exec, ags -t 'osk'
bind = Control+Alt, Delete, exec, ags -t 'session'
@@ -198,3 +198,4 @@ bindle = Alt, K, exec, ydotool key 108:1 108:0
bindle = Alt, J, exec, ydotool key 105:1 105:0
bindle = Alt, L, exec, ydotool key 106:1 106:0