Skip to content

Instantly share code, notes, and snippets.

View Afacanc38's full-sized avatar
🎯
Focusing

Alperen İsa Nalbant Afacanc38

🎯
Focusing
View GitHub Profile
@Afacanc38
Afacanc38 / gtk4-search-example-python-pygobject-libadwaita-2022.py
Last active January 25, 2023 13:12
Gtk4 SearchBar Example Python 2022
# Thanks to @keremgokcek for helping to make the search action.
import gi, sys
gi.require_version (
'Gtk',
'4.0'
)
gi.require_version (
'Adw',
'1'
)
@sulincix
sulincix / android.sh
Last active November 14, 2022 15:32
Android Emulatörü
#!/bin/bash
set -e
self=$(realpath $0)
# Creating sdk directory
mkdir -p $HOME/.android-emulator/sdk
cd $HOME/.android-emulator/
# İnstalling java
if [[ ! -d $HOME/.android-emulator/jdk-18 ]] ; then
wget -c https://download.java.net/openjdk/jdk18/ri/openjdk-18+36_linux-x64_bin.tar.gz -O java.tar.gz
tar -xf java.tar.gz
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 6, 2024 10:42
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@KurtJacobson
KurtJacobson / sys_notify.py
Created July 29, 2018 05:41
Qt DBus sys notify module for Linux systems
#!/usr/bin/env python
# Copyright (c) 2018 Kurt Jacobson
# <kurtcjacobson@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
@KurtJacobson
KurtJacobson / header_bar.py
Last active August 22, 2022 10:25
Custom GTK+ HeaderBar with fullscreen toggle button
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
@lmmx
lmmx / command_not_found_handle.sh
Last active December 11, 2021 08:49
command_not_found_handle function
command_not_found_handle ()
{
if [ -x /usr/lib/command-not-found ]; then
/usr/bin/python /usr/lib/command-not-found -- $1;
return $?;
else
return 127;
fi
}
@jampola
jampola / clock.py
Last active April 3, 2023 08:56
Simple clock using PyGTK and GObject.timeout_add()
#!/usr/bin/python
from gi.repository import Gtk, GObject
from datetime import datetime
class MainWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="app")
self.box = Gtk.Box(spacing=6)
self.add(self.box)
@carlos-jenkins
carlos-jenkins / app.py
Created February 10, 2014 22:42
Gtk+ 3.0 application theming using GResource. Compile using `glib-compile-resources gtktheme.gresource.xml`
# -*- coding:utf-8 -*-
#
# Copyright (C) 2013 Carlos Jenkins <carlos@jenkins.co.cr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@sergejx
sergejx / gist:2358089
Created April 11, 2012 08:59
Set dark theme for GTK+ application
from gi.repository import Gtk
settings = Gtk.Settings.get_default()
settings.set_property("gtk-application-prefer-dark-theme", True)