Giter Club home page Giter Club logo

Comments (6)

erosostolato avatar erosostolato commented on September 27, 2024 2

It worked after a clean install.

from sticky-window-snapping.

Flupp avatar Flupp commented on September 27, 2024

Do the following files and directories exist?

~/.local/share/kwin/scripts/sticky-window-snapping/
~/.local/share/kservices5/kwin-script-sticky-window-snapping.desktop
% tree ~/.local/share/kwin/scripts/sticky-window-snapping/
├── contents/
│   ├── code/
│   │   └── main.js
│   ├── config/
│   │   └── main.xml
│   └── ui/
│       └── config.ui
├── gpl-2.0.txt
└── metadata.desktop

You can start KWin with log output enabled:

#!/bin/bash
QT_LOGGING_RULES='*=false; kwin_scripting=true' exec kwin_x11 --replace

Maybe you find some helpful output. (You can adapt the QT_LOGGING_RULES to your needs.)

If you are not sure if the script is actually loaded, try adding a debug print at the beginning of ~/.local/share/kwin/scripts/sticky-window-snapping/contents/code/main.js and restart KWin as shown above.

print('Hello World!');

from sticky-window-snapping.

erosostolato avatar erosostolato commented on September 27, 2024

This my folder structure:

% tree ~/.local/share/kwin/scripts/sticky-window-snapping/
├── contents
│   ├── code
│   │   ├── main.js
│   │   └── old.js
│   ├── config
│   │   └── main.xml
│   └── ui
│       └── config.ui
├── gpl-2.0.txt
└── metadata.desktop

I restarted kwin and got this message:

$ QT_LOGGING_RULES='*=false; kwin_scripting=true' exec kwin_x11 --replace 
OpenGL vendor string:                   AMD
OpenGL renderer string:                 Radeon RX 580 Series (POLARIS10, DRM 3.35.0, 5.4.0-66-generic, LLVM 11.0.1)
OpenGL version string:                  4.6 (Compatibility Profile) Mesa 20.3.4 - kisak-mesa PPA
OpenGL shading language version string: 4.60
Driver:                                 RadeonSI
GPU class:                              Arctic Islands
OpenGL version:                         4.6
GLSL version:                           4.60
Mesa version:                           20.3.4
X server version:                       1.20.9
Linux kernel version:                   5.4
Requires strict binding:                yes
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
kwin_scripting: /home/rosostolato/.local/share/kwin/scripts/sticky-window-snapping/contents/code/main.js:38: error: enabledCurrently is not defined

from sticky-window-snapping.

erosostolato avatar erosostolato commented on September 27, 2024

So looking at the code, I saw that the enabledCurrently variable was not defined inside the code.
So I changed it from
enabledCurrently = config.enabledUsually;
to:
var enabledCurrently = config.enabledUsually;

It's not throwing error anymore but it still doesn't work... probably that variable should be global for kwin scripts, I'm not sure.

from sticky-window-snapping.

Flupp avatar Flupp commented on September 27, 2024

Hmm. Strange. My KWin (5.21.1) does not complain about the missing var. Anyways, some more vars were already added in the current development version. Can you try if it works with that version?

https://github.com/Flupp/sticky-window-snapping/blob/master/contents/code/main.js

from sticky-window-snapping.

erosostolato avatar erosostolato commented on September 27, 2024

It did not work... I believe it has something related to my kde installation.

What happened was that I installed kde neon developer edition a couple of months ago but then when plasma 5.21.1 came out, I ran a script to switch back to the user edition. It seems that it worked but I see that I still have the beta version of kwin:

image
image

But it's weird that while I was using developer edition, sticky window was working just fine and it stopped working after I changed it, but it seems that kwin kept the same version but stopped working.

Maybe I'll need to reinstall kde neon =(

from sticky-window-snapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.