├── ActivateWindows └── README.md /ActivateWindows: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | import cairo 3 | 4 | import gi 5 | 6 | import warnings 7 | warnings.filterwarnings("ignore", category=DeprecationWarning) # genius fix 8 | 9 | gi.require_version('Gtk', '3.0') 10 | gi.require_version('Gdk', '3.0') 11 | 12 | from gi.repository import Gtk, Gdk 13 | 14 | root = Gdk.get_default_root_window() 15 | screen = root.get_screen() 16 | 17 | def get_screen_size(display): 18 | mon_geoms = [ 19 | display.get_monitor(i).get_geometry() 20 | for i in range(display.get_n_monitors()) 21 | ] 22 | 23 | x0 = min(r.x for r in mon_geoms) 24 | y0 = min(r.y for r in mon_geoms) 25 | x1 = max(r.x + r.width for r in mon_geoms) 26 | y1 = max(r.y + r.height for r in mon_geoms) 27 | 28 | return x1 - x0, y1 - y0 29 | 30 | class ActivateWindows (Gtk.Window): 31 | def __init__(self): 32 | super().__init__(type=Gtk.WindowType.POPUP) 33 | try: # in case it gets removed 34 | self.set_wmclass("ActivateWindows", "ActivateWindows"); 35 | except: 36 | pass; 37 | 38 | self.set_app_paintable(True); 39 | screen = self.get_screen(); 40 | visual = screen.get_rgba_visual(); 41 | self.set_visual(visual); 42 | self.show_all(); 43 | 44 | width, height = get_screen_size(Gdk.Display.get_default()) 45 | SELF_WIDTH = 350 46 | SELF_HEIGHT = 100 47 | self.resize(SELF_WIDTH, 100); 48 | self.move(width - (SELF_WIDTH + 15), height - (SELF_HEIGHT + 15)); 49 | 50 | self.set_decorated(False); 51 | self.set_skip_taskbar_hint(True) 52 | self.set_skip_pager_hint(True) 53 | self.set_keep_above(True) 54 | self.set_type_hint(Gdk.WindowTypeHint.NOTIFICATION) 55 | 56 | self.set_accept_focus(False) 57 | self.set_focus_on_map(False) 58 | self.input_shape_combine_region(cairo.Region()) 59 | 60 | self.connect('draw', self._on_draw) 61 | def _on_draw(self, _wid, ctx): 62 | ctx.save() 63 | 64 | ctx.set_source_rgba(166, 166, 166, 0.6); 65 | ctx.select_font_face("Segoe UI", 66 | cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL); 67 | ctx.set_font_size(26); 68 | ctx.move_to(0, 50 - 26 / 2); 69 | ctx.show_text("Activate Windows"); 70 | ctx.set_font_size(18); 71 | ctx.move_to(0, 50 + 26 / 2); 72 | ctx.show_text("Go to PC settings to activate Windows."); 73 | 74 | ctx.restore() 75 | 76 | def main(): 77 | win = ActivateWindows(); 78 | win.connect("destroy", Gtk.main_quit); 79 | win.set_title("ActivateWindows") 80 | win.show_all() 81 | 82 | Gtk.main() 83 | 84 | if __name__=="__main__": 85 | try: 86 | main() 87 | except KeyboardInterrupt: 88 | exit(0) 89 | else: 90 | print("This program is not meant to be imported to other Python modules. Please run ActivateWindows as a standalone script!") 91 | 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ActivateWindows 2 | Linux activate windows prompt 3 | ## Just does this: 4 | ![image](https://user-images.githubusercontent.com/82973108/160489111-016154e6-3293-4564-b86d-eacc62902fdc.png) 5 | 6 | ## Note: 7 | Please add "name: 'ActivateWindows'" to your picom blur exclude if you're doing using blur. A compositor is required for transparency. --------------------------------------------------------------------------------