plasma-applet-eventcalendar icon indicating copy to clipboard operation
plasma-applet-eventcalendar copied to clipboard

Google oauth handler using an external Python script

Open gaganpreet opened this issue 1 year ago β€’ 29 comments

This fixes Google authorization by relying on an external Python script to handle redirects. I tested a couple of scenarios and it works fine on my end. I stuck to the standard library so it should work on every system out of the box.

Fixes #333

gaganpreet avatar Apr 13 '23 21:04 gaganpreet

Tested this on

Kubuntu 22.04
5.19.0-38-generic

No issues while sigining up, loads all events.

Thank you

MRo47 avatar Apr 17 '23 10:04 MRo47

I prefer this solution to the golang one. I assume the golang binary would run in any distro but I wouldn't be able to confirm that.

I was apprehensive of depending on the executable dataengine for both of these PRs as I wasn't sure if all dataengines were being removed in Plasma6 though. Seems that there's going to be a Plasma5Support package to keep them around for the short term though.

I'd originally planned to rewrite all of the the google api request code in python, but the golang PR made me realize that was overkill. Thank you both for the simpler solution.

Zren avatar Apr 19 '23 17:04 Zren

I've cloned this repo and installed it, but when trying to sign in to google, I keep getting the issue as previous. How do we use the python script to log in?

dodo-the-dev avatar Apr 24 '23 13:04 dodo-the-dev

Installed this version and can confirm it works like a charm. I am on Endeavor OS (Arch), KDE 5.27.4

shakeelansari63 avatar May 04 '23 19:05 shakeelansari63

I've cloned this repo and installed it, but when trying to sign in to google, I keep getting the issue as previous. How do we use the python script to log in?

Did you switch to google-calendar-fix branch? I did same mistake, I cloned gaganpreet's repo and installed it from master branch not realising the changes are in different branch. And was still getting same error. But later switched to google-calendar-fix branch and re-installed and it started working.

shakeelansari63 avatar May 04 '23 19:05 shakeelansari63

I've cloned this repo and installed it, but when trying to sign in to google, I keep getting the issue as previous. How do we use the python script to log in?

Did you switch to google-calendar-fix branch? I did same mistake, I cloned gaganpreet's repo and installed it from master branch not realising the changes are in different branch. And was still getting same error. But later switched to google-calendar-fix branch and re-installed and it started working.

Well, do I fell dumb or what 🀣

dodo-the-dev avatar May 05 '23 09:05 dodo-the-dev

Ok, I tried that, and still doesn't work. Just keeps coming up with the same error. What am I not doing correctly?

dodo-the-dev avatar May 05 '23 10:05 dodo-the-dev

Try Clean Install.

Remove Old plasmoid

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar

And then install updated one.

shakeelansari63 avatar May 05 '23 12:05 shakeelansari63

Try Clean Install.

Remove Old plasmoid

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar

And then install updated one.

Nope, used that, still get the same. I give up!

Thanks for your help thought

dodo-the-dev avatar May 05 '23 12:05 dodo-the-dev

@dodo-the-dev Just wondering how did you install it originally. Did you install it from KDE store / Git or via your Distro's Package manager.

If you had installed via distro's package manager, it might be installed system wide in /usr/share/plasma/plasmoids/

In that case, you may have to remove it from /usr/share/plasma/plasmoids/ for clean install.

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar
sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar

And then install it from gaganpreet:google-calendar-fix

You can give this a try if you wish to :+1:

shakeelansari63 avatar May 09 '23 13:05 shakeelansari63

Oh wow, I didn't have anything in those folders, so I downloaded the Zip instead of the github and it worked first time. Not sure why, but thanks

dodo-the-dev avatar May 15 '23 13:05 dodo-the-dev

Works for me on fedora 38, Plasma 5.27.5

aokugel avatar May 22 '23 01:05 aokugel

@gaganpreet Could you make this changes also for v68 branch? I tried to add them manually to that branch but then I got error 401 invalid client or client not found. I need v68 branch because of this:

https://github.com/Zren/plasma-applet-eventcalendar/issues/153

pmsobrado avatar May 22 '23 12:05 pmsobrado

@Zren and when this pull request will be merged? :)

kanocz avatar Jun 07 '23 11:06 kanocz

Hi @Zren, just wanted to let you know that I tested @gaganpreet's solution via python script and it works on my system!

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar
sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar

git clone https://github.com/gaganpreet/plasma-applet-eventcalendar eventcalendar
cd eventcalendar
git switch google-calendar-fix
git pull
sh ./install

System Specs:

           `.:/ossyyyysso/:.               neil@FractalNorth 
        .:oyyyyyyyyyyyyyyyyyyo:`           ----------------- 
      -oyyyyyyyodMMyyyyyyyysyyyyo-         OS: Kubuntu 22.04.2 LTS x86_64 
    -syyyyyyyyyydMMyoyyyydmMMyyyyys-       Kernel: 5.19.0-43-generic 
   oyyysdMysyyyydMMMMMMMMMMMMMyyyyyyyo     Uptime: 1 hour, 30 mins 
 `oyyyydMMMMysyysoooooodMMMMyyyyyyyyyo`    Packages: 2490 (dpkg), 19 (flatpak), 9 (snap) 
 oyyyyyydMMMMyyyyyyyyyyyysdMMysssssyyyo    Shell: bash 5.1.16 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Resolution: 1920x1080 
oyyyysoodMyyyyyyyyyyyyyyyyyyydMMMMysyyyo   DE: Plasma 5.24.7 
yyysdMMMMMyyyyyyyyyyyyyyyyyyysosyyyyyyyy   WM: KWin 
yyysdMMMMMyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   WM Theme: Sweet-Dark-transparent 
oyyyyysosdyyyyyyyyyyyyyyyyyyydMMMMysyyyo   Theme: [Plasma], Breeze [GTK2/3] 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Icons: candy-icons [Plasma], candy-icons [GTK2/3] 
 oyyyyyydMMMysyyyyyyyyyyysdMMyoyyyoyyyo    Terminal: konsole 
 `oyyyydMMMysyyyoooooodMMMMyoyyyyyyyyo     CPU: AMD Ryzen 9 5950X (32) @ 3.400GHz 
   oyyysyyoyyyysdMMMMMMMMMMMyyyyyyyyo      GPU: NVIDIA GeForce RTX 3090 
    -syyyyyyyyydMMMysyyydMMMysyyyys-       Memory: 4283MiB / 32008MiB 
      -oyyyyyyydMMyyyyyyysosyyyyo-
        ./oyyyyyyyyyyyyyyyyyyo/.                                   
           `.:/oosyyyysso/:.`

NeilPandya avatar Jun 09 '23 10:06 NeilPandya

I followed as @NeilPandya, works in my system too.

ebecerra@muss 
------------- 
OS: Manjaro Linux x86_64 
Host: Latitude 5430 
Kernel: 6.1.41-1-MANJARO 
Uptime: 23 mins 
Packages: 1316 (pacman), 9 (flatpak) 
Shell: zsh 5.9 
Resolution: 1920x1080 
DE: Plasma 5.27.6 
WM: kwin 
Theme: [Plasma], Breeze [GTK2/3] 
Icons: [Plasma], breeze [GTK2/3] 
Terminal: konsole 
Terminal Font: IBM Plex Mono 18 
CPU: 12th Gen Intel i7-1265U (12) @ 4.800GHz 
GPU: Intel Alder Lake-UP3 GT2 [Iris Xe Graphics] 
Memory: 4039MiB / 31787MiB 

elbecerrasoto avatar Jul 31 '23 00:07 elbecerrasoto

hey @Zren, its been a month since last reference of this PR and Im wondering when will you merge this PR or whether you need more test from others on which side?

EDIT:

I manage to use this branch and It's working, took me a bit of a brawl since I use @kanocz version first and i need to do clean install thx to @NeilPandya

                     ./o.                  dhupee@Akago 
                   ./sssso-                ¨¨¨¨¨¨¨¨¨¨¨¨ 
                 `:osssssss+-              ╭──────────── Software ──────────── 
               `:+sssssssssso/.            β”‚ OSβ€Ί EndeavourOS 
             `-/ossssssssssssso/.          β”‚ Kernelβ€Ί 6.4.12-arch1-1 
           `-/+sssssssssssssssso+:`        β”‚ Packagesβ€Ί 1367 (pacman), 12 (flatpak) 
         `-:/+sssssssssssssssssso+/.       β”‚ Shellβ€Ί zsh 5.9 
       `.://osssssssssssssssssssso++-      β”‚ DEβ€Ί Plasma 5.27.7 
      .://+ssssssssssssssssssssssso++:     β”‚ Terminalβ€Ί konsole 
    .:///ossssssssssssssssssssssssso++:    β”‚ Local IPβ€Ί 172.16.0.2 
  `:////ssssssssssssssssssssssssssso+++.   β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Hardware ──────────── 
`-////+ssssssssssssssssssssssssssso++++-   β”‚ Hostβ€Ί Nitro AN515-43 V1.12 
 `..-+oosssssssssssssssssssssssso+++++/`   β”‚ CPUβ€Ί AMD Ryzen 5 3550H with Radeon Vega Mobile Gfx (8) @ 2.100GHz 
   ./++++++++++++++++++++++++++++++/:.     β”‚ GPUβ€Ί AMD ATI Radeon Vega Series / Radeon Vega Mobile Series 
  `:::::::::::::::::::::::::------``       β”‚ GPUβ€Ί AMD ATI Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X 
                                           β”‚ Memoryβ€Ί 8069MiB / 13916MiB 
                                           β”‚ Disk (/)β€Ί 171G / 901G (20%) 
                                           β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ Uptime ───────────── 
                                           β”‚β€Ί 5 days, 18 hours, 50 mins 

dhupee avatar Sep 06 '23 11:09 dhupee

Thanks to @gaganpreet, @NeilPandya for his guide. It works perfectly on

Operating System: openSUSE Tumbleweed 20230906
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.109.0
Qt Version: 5.15.10
Kernel Version: 6.4.12-1-default (64-bit)
Graphics Platform: X11

magdymawad avatar Sep 10 '23 12:09 magdymawad

Works on: Operating System: Manjaro Linux KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 Kernel Version: 6.5.3-1-MANJARO (64-bit)

But I do get a warning: "Providing a metadata.desktop file for KPackage metadata is deprecated." Which is just minor and it installs perfectly and Authorisation works.

Pentasis avatar Oct 02 '23 11:10 Pentasis

@Zren any update to when this branch can be merged?

NeilPandya avatar Oct 15 '23 09:10 NeilPandya

Hi @Zren, just wanted to let you know that I tested @gaganpreet's solution via python script and it works on my system!

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar
sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar

git clone https://github.com/gaganpreet/plasma-applet-eventcalendar eventcalendar
cd eventcalendar
git switch google-calendar-fix
git pull
sh ./install

works nicely here too!

                  -`                    johnny@johnny-g55590
                 .o+`                   --------------------
                `ooo/                   OS: Garuda Linux x86_64
               `+oooo:                  Host: G5 5590 
              `+oooooo:                 Kernel: 6.6.4-zen1-1-zen
              -+oooooo+:                Uptime: 1 hour, 10 mins
            `/:-:++oooo+:               Battery: 100% [Full]
           `/++++/+++++++:              
          `/++++++++++++++:             Packages: 1907 (pacman)
         `/+++ooooooooooooo/`           Shell: zsh
        ./ooosssso++osssssso+`          Resolution: 2560x2160
       .oossssso-````/ossssss+`         Terminal: kitty
      -osssssso.      :ssssssso.        
     :osssssss/        osssso+++.       CPU: Intel i7-9750H (12) @ 4.5GHz
    /ossssssss/        +ssssooo/-       Memory: 6119MiB / 15803MiB (38%)
  `/ossssso+/:-        -:/+osssso+-     
 `+sso+:-`                 `.-/+oso:                            
`++:.                           `-/+/                           
.`                                 `/   

joaociocca avatar Dec 08 '23 01:12 joaociocca

I'm following these steps:

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar

git clone https://github.com/gaganpreet/plasma-applet-eventcalendar eventcalendar cd eventcalendar git switch google-calendar-fix git pull sh ./install

However, when I get to git switch google-calendar-fix , I get the following: fatal: invalid reference: google-calendar-fix

Any ideas on what I'm doing wrong? I'm very layperson with this entire scene btw.

BackOnMyBS avatar Dec 29 '23 18:12 BackOnMyBS

Any ideas on what I'm doing wrong? I'm very layperson with this entire scene btw.

not without knowing/seeing exactly what you tried. Command by command.

joaociocca avatar Dec 30 '23 01:12 joaociocca

Wish this PR soon gets merged to master. So that people don't have to keep working with workarounds like cloning feature branch and installing manually.

shakeelansari63 avatar Dec 30 '23 10:12 shakeelansari63

I'm following these steps:

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar git clone https://github.com/gaganpreet/plasma-applet-eventcalendar eventcalendar cd eventcalendar git switch google-calendar-fix git pull sh ./install

However, when I get to git switch google-calendar-fix , I get the following: fatal: invalid reference: google-calendar-fix

Any ideas on what I'm doing wrong? I'm very layperson with this entire scene btw.

@BackOnMyBS ,

Can you type git branch, and share the results? We can see what branches are shown as available to be switched to in the repo you cloned.

Neil

NeilPandya avatar Jan 07 '24 14:01 NeilPandya

Any ideas on what I'm doing wrong? I'm very layperson with this entire scene btw.

not without knowing/seeing exactly what you tried. Command by command.

@BackOnMyBS Also, maybe you can try again and copy/paste your terminal output to another post here or on pastebin or something like that so others can take a look?

NeilPandya avatar Jan 07 '24 14:01 NeilPandya

I'm following these steps:

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar git clone https://github.com/gaganpreet/plasma-applet-eventcalendar eventcalendar cd eventcalendar git switch google-calendar-fix git pull sh ./install

However, when I get to git switch google-calendar-fix , I get the following: fatal: invalid reference: google-calendar-fix

Any ideas on what I'm doing wrong? I'm very layperson with this entire scene btw.

Try git checkout google-calendar-fix instead of git switch google-calendar-fix if that helps

shakeelansari63 avatar Jan 07 '24 14:01 shakeelansari63

@Zren Any updates on when this PR can be merged? Thanks again.

NeilPandya avatar Feb 29 '24 15:02 NeilPandya

Hi @Zren, just wanted to let you know that I tested @gaganpreet's solution via python script and it works on my system!

rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar
sudo rm -rf /usr/share/plasma/plasmoids/org.kde.plasma.eventcalendar

git clone https://github.com/gaganpreet/plasma-applet-eventcalendar eventcalendar
cd eventcalendar
git switch google-calendar-fix
git pull
sh ./install

System Specs:

           `.:/ossyyyysso/:.               neil@FractalNorth 
        .:oyyyyyyyyyyyyyyyyyyo:`           ----------------- 
      -oyyyyyyyodMMyyyyyyyysyyyyo-         OS: Kubuntu 22.04.2 LTS x86_64 
    -syyyyyyyyyydMMyoyyyydmMMyyyyys-       Kernel: 5.19.0-43-generic 
   oyyysdMysyyyydMMMMMMMMMMMMMyyyyyyyo     Uptime: 1 hour, 30 mins 
 `oyyyydMMMMysyysoooooodMMMMyyyyyyyyyo`    Packages: 2490 (dpkg), 19 (flatpak), 9 (snap) 
 oyyyyyydMMMMyyyyyyyyyyyysdMMysssssyyyo    Shell: bash 5.1.16 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Resolution: 1920x1080 
oyyyysoodMyyyyyyyyyyyyyyyyyyydMMMMysyyyo   DE: Plasma 5.24.7 
yyysdMMMMMyyyyyyyyyyyyyyyyyyysosyyyyyyyy   WM: KWin 
yyysdMMMMMyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy   WM Theme: Sweet-Dark-transparent 
oyyyyysosdyyyyyyyyyyyyyyyyyyydMMMMysyyyo   Theme: [Plasma], Breeze [GTK2/3] 
-yyyyyyyydMysyyyyyyyyyyyyyysdMMMMMysyyy-   Icons: candy-icons [Plasma], candy-icons [GTK2/3] 
 oyyyyyydMMMysyyyyyyyyyyysdMMyoyyyoyyyo    Terminal: konsole 
 `oyyyydMMMysyyyoooooodMMMMyoyyyyyyyyo     CPU: AMD Ryzen 9 5950X (32) @ 3.400GHz 
   oyyysyyoyyyysdMMMMMMMMMMMyyyyyyyyo      GPU: NVIDIA GeForce RTX 3090 
    -syyyyyyyyydMMMysyyydMMMysyyyys-       Memory: 4283MiB / 32008MiB 
      -oyyyyyyydMMyyyyyyysosyyyyo-
        ./oyyyyyyyyyyyyyyyyyyo/.                                   
           `.:/oosyyyysso/:.`

Operating System: Kubuntu 22.04 KDE Plasma Version: 5.24.7 KDE Frameworks Version: 5.92.0 Qt Version: 5.15.3 Kernel Version: 5.19.0-43-generic (64-bit) Graphics Platform: X11 Processors: 32 Γ— AMD Ryzen 9 5950X 16-Core Processor Memory: 31.3 GiB of RAM Graphics Processor: NVIDIA GeForce RTX 3090/PCIe/SSE2

It works here too!!!

         _,met$$$$$gg.           dan@urios
      ,g$$$$$$$$$$$$$$$P.        OS: Debian 12 bookworm
    ,g$$P""       """Y$$.".      Kernel: x86_64 Linux 6.1.0-21-amd64
   ,$$P'              `$$$.      Uptime: 10h 50m
  ',$$P       ,ggs.     `$$b:    Packages: 3249
  `d$$'     ,$P"'   .    $$$     Shell: bash 5.2.15
   $$P      d$'     ,    $$P     Resolution: 5760x1080
   $$:      $$.   -    ,d$$'     DE: KDE 5.103.0 / Plasma 5.27.5
   $$\;      Y$b._   _,d$P'      WM: KWin
   Y$$.    `.`"Y$$$$P"'          GTK Theme: Sweet-v40 [GTK2/3]
   `$$b      "-.__               Icon Theme: candy-icons
    `Y$$                         Disk: 2.9T / 5.7T (51%)
     `Y$$.                       CPU: Intel Core i5-9600K @ 6x 4.6GHz [50.0Β°C]
       `$$b.                     GPU: AMD Radeon RX 470 Graphics (polaris10, LLVM 15.0.6, DRM 3.49, 6.1.0-21-amd64)
         `Y$$b.                  RAM: 8752MiB / 15856MiB
            `"Y$b._             
                `""""           

roosartwork avatar Jul 06 '24 18:07 roosartwork