mirror of
https://github.com/Snigdha-OS/snigdhaos-kernel-switcher.git
synced 2025-09-20 12:54:56 +02:00
🐛 fix(_dir): move to main directory
This commit is contained in:
@@ -0,0 +1,172 @@
|
||||
box#box{
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
box#main{
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
padding-bottom: 20px;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
box#box_padding_left{
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
box#vbox_flowbox_message {
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
box#vbox_active_kernel{
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
box#hbox_notify_revealer{
|
||||
padding: 10px 10px 10px 10px;
|
||||
border-radius: 10px;
|
||||
border-spacing: 5px;
|
||||
background-color: #3fe1b0;
|
||||
color: #0e1313;
|
||||
border-color: transparent;
|
||||
}
|
||||
|
||||
box#box_row{
|
||||
padding-left: 20px;
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
box#hbox_kernel{
|
||||
background-color: @theme_base_color;
|
||||
padding-bottom: 8px;
|
||||
/*box-shadow: -6px 8px 10px rgba(81,41,10,0.1),0px 2px 2px rgba(81,41,10,0.2);*/
|
||||
}
|
||||
|
||||
box#vbox_header{
|
||||
background-color: @theme_base_color;
|
||||
border-top: 1px solid @borders;
|
||||
border-bottom: 1px solid @borders;
|
||||
border-left: 1px solid @borders;
|
||||
border-right: 1px solid @borders;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius: 100px;
|
||||
border-spacing: 5px;
|
||||
font-weight: bold;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
/*box-shadow: -6px 8px 10px rgba(81,41,10,0.1),0px 2px 2px rgba(81,41,10,0.2);*/
|
||||
}
|
||||
|
||||
box#hbox_warning{
|
||||
background-color: #004085;
|
||||
color: white;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
padding: 5px 5px 5px 5px;
|
||||
}
|
||||
|
||||
label#label_notify_revealer{
|
||||
background-color: #3fe1b0;
|
||||
color: #0e1313;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
label#label_active_kernel {
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
label#label_flowbox_message{
|
||||
padding: 10px 10px 10px 10px;
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
label#label_stack_kernel {
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
border-top: 1px solid @borders;
|
||||
border-bottom: 1px solid @borders;
|
||||
border-left: 1px solid @borders;
|
||||
border-right: 1px solid @borders;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius: 100px;
|
||||
border-spacing: 5px;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
color: #fcfcfc;
|
||||
background-color: @theme_base_color;
|
||||
}
|
||||
|
||||
label#label_stack_desc {
|
||||
font-size: 12.5px;
|
||||
font-weight: 600;
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-style: italic;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
}
|
||||
|
||||
label#label_community_warning {
|
||||
font-size: 12.5px;
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
}
|
||||
|
||||
label#label_error{
|
||||
font-size: 12.5px;
|
||||
font-weight: 600;
|
||||
padding: 5px 5px 5px 5px;
|
||||
color: #fcfcfc;
|
||||
background-color: #E42217;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
border-top: 1px solid @borders;
|
||||
border-bottom: 1px solid @borders;
|
||||
border-left: 1px solid @borders;
|
||||
border-right: 1px solid @borders;
|
||||
padding: 5px 5px 5px 5px;
|
||||
border-radius: 10px;
|
||||
border-spacing: 5px;
|
||||
}
|
||||
|
||||
label#label_stack_count {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-style: italic;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
}
|
||||
|
||||
label#label_kernel_version {
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-size: 12px;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
}
|
||||
|
||||
label#label_kernel_flowbox {
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-size: 11px;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
}
|
||||
|
||||
label#label_about {
|
||||
padding: 5px 5px 5px 5px;
|
||||
font-size: 11px;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
}
|
||||
|
||||
button#button_uninstall_kernel{
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.sidebar label{
|
||||
font-size: 12.5px;
|
||||
font-weight: 500;
|
||||
padding: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
#textview_log text{
|
||||
background-color: #232627;
|
||||
color: #fcfcfc;
|
||||
font-family: 'Noto Sans', 'Helvetica', sans-serif;
|
||||
border-top: 1px solid @borders;
|
||||
border-bottom: 1px solid @borders;
|
||||
border-left: 1px solid @borders;
|
||||
border-right: 1px solid @borders;
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
#!/bin/python
|
||||
import os
|
||||
import libs.functions as fn
|
||||
from ui.ManagerGUI import ManagerGUI
|
||||
import gi
|
||||
gi.require_version("Gtk", "4.0")
|
||||
from gi.repository import Gtk, Gio, GLib, Gdk
|
||||
|
||||
base_dir = fn.os.path.dirname(fn.os.path.realpath(__file__))
|
||||
|
||||
app_name = "Snigdha OS Kernel Switcher"
|
||||
app_version = "${app_version}"
|
||||
app_name_dir = "snigdhaos-kernel-switcher"
|
||||
app_id = "org.snigdhaos.kernelswitcher"
|
||||
lock_file = "/tmp/.sks.lock"
|
||||
progress_lock_file = "/tmp/.sks-progress.lock"
|
||||
pid_file ="/tmp/.sks.pid"
|
||||
|
||||
class Main(Gtk.Application):
|
||||
def __init__(self):
|
||||
super().__init__(application_id=app_id, flags=Gio.ApplicationFlags.FLAGS_NONE)
|
||||
|
||||
def do_activate(self):
|
||||
default_context = GLib.MainContext.default()
|
||||
win = self.props.active_window
|
||||
if not win:
|
||||
win = ManagerGUI(application=self, app_name=app_name, default_context=default_context,app_version=app_version)
|
||||
display = Gtk.Widget.get_display(win)
|
||||
win.set_icon_name("snigdhaos-kernel-switcher-tux")
|
||||
provider = Gtk.CssProvider.new()
|
||||
css_file = Gio.file_new_for_path(css_file)
|
||||
Gtk.StyleContext.add_provider_for_display(display, provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
|
||||
win.present()
|
||||
|
||||
def do_startup(self):
|
||||
Gtk.Application.do_startup(self)
|
||||
|
||||
def do_shutdown(self):
|
||||
Gtk.Application.do_shutdown(self)
|
||||
if os.path.exists(lock_file):
|
||||
os.remove(lock_file)
|
||||
if os.path.exists(pid_file):
|
||||
os.remove(pid_file)
|
||||
if os.path.exists(progress_lock_file):
|
||||
os.remove(progress_lock_file)
|
||||
|
||||
def snigdhal_handler(sig, frame):
|
||||
Gtk.main_quit(0)
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
if not fn.os.path.isfile(lock_file):
|
||||
with open(pid_file, "w") as f:
|
||||
f.write(str(fn.os.getpid()))
|
||||
app = Main()
|
||||
app.run(None)
|
||||
else:
|
||||
md = Gtk.MessageDialog(parent=Main(), flags=0,message_type=Gtk.MessageType.INFO,buttons=Gtk.ButtonsType.YES_NO,text="%s Lock File Found!" % app_name)
|
||||
md.format_secondary_markup("A %s lock file Found!\nAnother substance of %s is running!\nClick 'Yes' to remove the lockfile and restart the app." %(lock_file, app_name))
|
||||
result = md.run()
|
||||
md.destroy()
|
||||
if result in (Gtk.ResponseType.OK, Gtk.ResponseType.YES):
|
||||
pid = ""
|
||||
if fn.os.path.exists(pid_file):
|
||||
with open(pid_file, "r") as f:
|
||||
i = f.read()
|
||||
pid = i.rstrip().lstrip()
|
||||
else:
|
||||
fn.os.unlink(lock_file)
|
||||
fn.sys.exit(1)
|
||||
else:
|
||||
fn.sys.exit(1)
|
||||
except Exception as e:
|
||||
print("Error Occured in __main__")
|
Reference in New Issue
Block a user