Answer the question
In order to leave comments, you need to log in
How to run a fullscreen Python GTK3 application on Debian 9.5 (i386) without a desktop environment installed?
In Debian 9.5 (i386) without a shell installed, the fullscreen method on an object of the Gtk.Window class does not work:
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
from gi.repository import Gdk, Gtk, GdkPixbuf
class LockScreen(Gtk.Window):
def __init__(self, app, config):
super().__init__(name='lock_screen')
self.app = app
cssProvider = Gtk.CssProvider()
cssProvider.load_from_path('./static/styles.css')
screen = Gdk.Screen.get_default()
styleContext = Gtk.StyleContext()
styleContext.add_provider_for_screen(screen, cssProvider, Gtk.STYLE_PROVIDER_PRIORITY_USER)
self.box = Gtk.Box(halign=Gtk.Align.CENTER, orientation=Gtk.Orientation.VERTICAL, parent=self,
valign=Gtk.Align.CENTER, name='lock_screen_box')
self.tonb_label = Gtk.Label('Тюменская Областная Научная Библиотека', justify=Gtk.Justification.CENTER,
name='tonb_label', parent=self.box)
self.icons = {
name: GdkPixbuf.Pixbuf.new_from_file_at_scale('./static/icons/{0}.svg'.format(name), 96, 96, True)
for name in [
'app_started',
'network_connected',
'network_disconnected',
'workstation_locked',
'workstation_unlocked',
'workstation_shutdown',
'reader_binded',
'error',
]
}
self.status_icon = Gtk.Image(name='status_icon', parent=self.box)
self.status_label = Gtk.Label(justify=Gtk.Justification.CENTER, name='status_label', parent=self.box,
width_chars=56)
self.fullscreen()
self.connect("destroy", Gtk.main_quit)
self.show_all()
...
greeter-session=defender_greeter
[Desktop Entry]
Name=TONB Thin Defender
Comment=No comments
Exec=/bin/bash /home/defender/thin-defender/thin_defender/run.sh
Type=Application
X-Ubuntu-Gettext-Domain=lightdm
cd /home/defender/thin-defender/thin_defender
/home/defender/thin-defender/.venv/bin/python3 /home/defender/thin-defender/thin_defender/manage.py run_app --config test
Answer the question
In order to leave comments, you need to log in
I tried to install and configure openbox as a window manager, but got tired of the configs.
It turned out to be easier not to use the fullscreen() method, which depends on window managers:
But to get the current display width and height from Gdk.Screen and set it using the resize() method:
Result:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question