Workspaces now show up on their appropriate monitors. (#681)
* Workspaces now show up on their appropriate monitors. * Fixed undefined rules showing up.
This commit is contained in:
@@ -3,6 +3,7 @@ import { dependencies, sh } from '../lib/utils';
|
||||
import options from '../options';
|
||||
import { execAsync } from 'astal/process';
|
||||
import { monitorFile } from 'astal/file';
|
||||
import { hyprlandService } from 'src/lib/constants/services';
|
||||
|
||||
const WP = `${GLib.get_home_dir()}/.config/background`;
|
||||
|
||||
@@ -14,35 +15,34 @@ class Wallpaper extends GObject.Object {
|
||||
#wallpaper(): void {
|
||||
if (!dependencies('swww')) return;
|
||||
|
||||
sh('hyprctl cursorpos')
|
||||
.then((pos) => {
|
||||
const transitionCmd = [
|
||||
'swww',
|
||||
'img',
|
||||
'--invert-y',
|
||||
'--transition-type',
|
||||
'grow',
|
||||
'--transition-duration',
|
||||
'1.5',
|
||||
'--transition-fps',
|
||||
'30',
|
||||
'--transition-pos',
|
||||
pos.replace(' ', ''),
|
||||
WP,
|
||||
].join(' ');
|
||||
try {
|
||||
const cursorPosition = hyprlandService.message('cursorpos');
|
||||
const transitionCmd = [
|
||||
'swww',
|
||||
'img',
|
||||
'--invert-y',
|
||||
'--transition-type',
|
||||
'grow',
|
||||
'--transition-duration',
|
||||
'1.5',
|
||||
'--transition-fps',
|
||||
'30',
|
||||
'--transition-pos',
|
||||
cursorPosition.replace(' ', ''),
|
||||
WP,
|
||||
].join(' ');
|
||||
|
||||
sh(transitionCmd)
|
||||
.then(() => {
|
||||
this.notify('wallpaper');
|
||||
this.emit('changed', true);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Error setting wallpaper:', err);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Error getting cursor position:', err);
|
||||
});
|
||||
sh(transitionCmd)
|
||||
.then(() => {
|
||||
this.notify('wallpaper');
|
||||
this.emit('changed', true);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error('Error setting wallpaper:', err);
|
||||
});
|
||||
} catch (err) {
|
||||
console.error('Error getting cursor position:', err);
|
||||
}
|
||||
}
|
||||
|
||||
async #setWallpaper(path: string): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user