To have a list of all the so called ThemedIcons for your GTK app, download https://flathub.org/apps/details/org.gnome.design.IconLibrary
I have just spent 30 minutes for this. Thank you Gnome developers
import requests | |
from gi.repository import Gtk, Adw, GdkPixbuf, GLib | |
def gtk_image_from_url(url: str, image: Gtk.Image): | |
"""Using the requests module we load an image from a http endpoint, then we can create a Pixbuf loader to load our image""" | |
response = requests.get(url) | |
response.raise_for_status() | |
loader = GdkPixbuf.PixbufLoader() | |
loader.write_bytes(GLib.Bytes.new(response.content)) |
def ask(message: str, options: set) -> str: | |
_input = None | |
while not _input in options: | |
_input = input(message) | |
return _input |
def key_in_dict(_dict: dict, key_lookup: str, separator='.'): | |
""" | |
Searches for a nested key in a dictionary and returns its value, or None if nothing was found. | |
key_lookup must be a string where each key is deparated by a given "separator" character, which by default is a dot | |
""" | |
if not isinstance(_dict, dict): | |
raise TypeError('First argument must be type Dict') | |
keys = key_lookup.split(separator) | |
subdict = _dict |
{ | |
// Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "prefix": "log", | |
// "body": [ | |
// "console.log('$1');", |
/** | |
The first time I wanted to create an extension for Gnome, I spent two hours trying to understand how to do this, due to bad documentation. | |
So now I am sharing this once for all. | |
*/ | |
const ByteArray = imports.byteArray; | |
function exec(command) { | |
const output = GLib.spawn_command_line_sync(command); | |
return { | |
ok: output[0], | |
standard_output: ByteArray.toString(output[1]), |
To have a list of all the so called ThemedIcons for your GTK app, download https://flathub.org/apps/details/org.gnome.design.IconLibrary
I have just spent 30 minutes for this. Thank you Gnome developers
I'm writing this because I found it harder than expected, but actually is super easy.
Shift + c
, you can select more than oneShift + v
, will ask for confirmation.NOTE
On older versions, you simply had to press c
and v
without Shift
currentdndstate=$(gsettings get org.gnome.desktop.notifications show-banners); if [ $currentdndstate == "false" ]; then gsettings set org.gnome.desktop.notifications show-banners true; else gsettings set org.gnome.desktop.notifications show-banners false; fi |
Copy to ./config/fish/functions/mkdd.fish
function mkdd -d "Create a directory and set CWD"
command mkdir $argv
if test $status = 0
switch $argv[(count $argv)]
case '*'
cd $argv[(count $argv)]
return
end
#!/bin/bash | |
# Comments and complaints http://www.nicknorton.net, last modification | |
# by mijorus here https://gist.github.com/mijorus/f7c127a62230490df4e796207ce540bf. | |
# GUI for mouse wheel speed using imwheel in Gnome | |
# imwheel needs to be installed for this script to work | |
# sudo apt-get install imwheel | |
# Pretty much hard wired to only use a mouse with | |
# left, right and wheel in the middle. | |
# If you have a mouse with complications or special needs, | |
# use the command xev to find what your wheel does. |