Skip to content

Instantly share code, notes, and snippets.

@candidtim
candidtim / .alacritty.toml
Last active July 13, 2024 04:14
Alacritty Nord theme TOML
# TOML interpretation of the https://github.com/nordtheme/alacritty
# See also: https://github.com/nordtheme/alacritty/issues/40
# (if the above is resolved, you may not need this Gist)
[colors.primary]
background = "#2e3440"
foreground = "#d8dee9"
dim_foreground = "#a5abb6"
[colors.cursor]
@candidtim
candidtim / README.template.rst
Created December 8, 2016 23:32
Include generated help into README

# SED

sed is really nice, look:

## Usage

## Final note

Have fun with sed

@candidtim
candidtim / myappindicator_v5.py
Last active December 3, 2021 18:50
Ubuntu AppIndicator to show Chuck Norris jokes
# This code is an example for a tutorial on Ubuntu Unity/Gnome AppIndicators:
# http://candidtim.github.io/appindicator/2014/09/13/ubuntu-appindicator-step-by-step.html
import os
import signal
import json
from urllib2 import Request, urlopen, URLError
from gi.repository import Gtk as gtk
@candidtim
candidtim / myappindicator_v4.py
Last active July 15, 2021 21:40
Minimal Ubuntu AppIndicator in Python, with custom icon and a "Quit" menu item
import os
import signal
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, os.path.abspath('sample_icon.svg'), appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
@candidtim
candidtim / myappindicator_v3.py
Created February 12, 2015 20:59
Minimal Ubuntu AppIndicator in Python, with "Quit" menu item
import signal
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, 'whatever', appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(build_menu())
@candidtim
candidtim / myappindicator_v2.py
Created February 12, 2015 20:44
Minimal Ubuntu AppIndicator in Python, with support for SIGINT (e.g. Ctrl+C)
import signal
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, 'whatever', appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(gtk.Menu())
@candidtim
candidtim / myappindicator_v1.py
Last active September 8, 2020 14:58
Minimal set-up for an Ubuntu AppIndicator in Python
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, 'whatever', appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(gtk.Menu())
gtk.main()