Blog

  • funckey

    funckey

    funckey is a simple go cli program that wraps lower level linux cli apps that are commonly mapped to function keys on laptops.

    I made this so I could easily map my volume and brightness function keys on my laptop to work when running xmonad and xmobar (see config examples below). If you’re using gnome/kde you probably don’t need something like this.

    Setup / Install

    go get github.com/jacktasia/funckey
    then
    go install github.com/jacktasia/funckey

    required packages

    Ensure you have pactl installed

    and

    that the /sys/class/backlight/intel_backlight/brightness file exists.

    brightness file permissions

    By default the brightness file is owned by root.

    Your user needs to be able to edit the brightness file, change jack to your username:

    sudo chown jack:jack /sys/class/backlight/intel_backlight/brightness

    This will change the permissions for just this boot. To change the permissions going forward do this:

    sudo nano /etc/udev/rules.d/90-myrules.rules and add a line with:

    Again, make sure you update your username here (replace jack) too.

    KERNEL=="intel_backlight", SUBSYSTEM=="backlight", RUN+="/usr/bin/find /sys/class/backlight/intel_backlight/ -type f -name brightness -exec chown jack:jack {} ; -exec chmod 666 {} ;"
    

    Commands

    Controlling Volume

    • funckey volume down Decrease system volume by ~10%
    • funckey volume up Increase system volume by ~10%
    • funckey volume toggle-mute Toggle the mute volume
    • funckey volume mute Mute system volume
    • funckey volume unmute Un-mute system volume
    • funckey volume get-percent Get the system volume
    • funckey volume set-percent N Set the system volume by percent

    Controlling Brightness

    • funckey brightness down Decrease screen brightness by ~10%
    • funckey brightness up Increase screen brightness by ~10%
    • funckey brightness get-percent Get the screen brightness
    • funckey brightness set-percent N Set the screen brightness by percent
    • funckey brightness status Set the screen brightness status

    xmonad keybindings

    A snippet of my xmonad.hs config using import XMonad.Util.EZConfig:

      ("<XF86MonBrightnessDown>", spawn "funckey brightness down"),
      ("<XF86MonBrightnessUp>", spawn "funckey brightness up"),
      ("<XF86AudioLowerVolume>", spawn "funckey volume down"),
      ("<XF86AudioRaiseVolume>", spawn "funckey volume up"),
      ("<XF86AudioMute>", spawn "funckey volume toggle-mute")

    xmobar config

    In the commands section of the config:

            , Run Com "funckey" ["brightness", "get-percent"] "mybrightness" 2
            , Run Com "funckey" ["volume", "get-percent"] "myvolume" 2

    then in the template you can have something like:

    | Screen: %mybrightness% | Vol: %myvolume%
    

    Visit original content creator repository
    https://github.com/jacktasia/funckey

  • GoConsoleMenu

    Go Console Menu

    license

    This library provides a way to quickly create the menu for your GoLang console app.

    Overview

    Classes

    Menu

    This is the type that you use to make your menus. It has two constructors one for if the menu items can be updated (shown or hidden) and another for if they can’t. These should be called like this:

    GoConsoleMenu.NewMenu(title)

    Or

    GoConsoleMenu.NewUpdatableMenu(title, updateMenuItemsFunc)

    Methods
    • Display() this starts this menu. This only needs to be called on the root menu in your system, as all sub-menus are handled by this library.
    • AddMenuItem(GoConsoleMenu.NewSubmenuItem(id, description, subMenu)) this adds a submenu item to the menu.
    • AddMenuItem(GoConsoleMenu.NewActionItem(id, description, action)) this adds a action item to the menu.
    • AddHiddenMenuItem this is a helper method that adds a menu item, which is then hidden.
    • ShowMenuItem(id) this can be used to show hidden menu items, most commonly in the method above. This uses the unique id given to the menu item.
    • HideMenuItem(id) this can be used to hide menu items.

    MenuItem

    This is the class used to define items for the menus in your system. It has two constructors one for if the item is a sub menu and another for if its an action. These should be called like this:

    GoConsoleMenu.NewSubmenuItem(id, description, subMenu)

    Or

    GoConsoleMenu.NewActionItem(id, description, action)

    Methods
    • Hide() which is used on menu items, to hide them from the list.
    • Show() which is used on hidden menu items, to show them in the list.
    • SetAsExitOption() which is used to set menu items as the exit option for a menu, either going to the parent menu, or exiting the application.

    Example

    func main() {
    	mainMenu := GoConsoleMenu.NewMenu("Welcome to the main menu.", func(menu *GoConsoleMenu.Menu) {})
    	mainMenu.AddMenuItem(GoConsoleMenu.NewActionItem(100, "Exit menu", func() {}).SetAsExitOption())
    	mainMenu.AddMenuItem(GoConsoleMenu.NewActionItem(101, "Print Hello World", func() 
    	{
    		fmt.Println("Hello World!")
    	}))
    	mainMenu.Display()
    }

    Output

    Welcome to the main menu
    0. Exit menu
    1. Print Hello World
    Select option: 1
    Hello World!
    
    Welcome to the main menu
    0. Exit menu
    1. Print Hello World
    Select option: 0
    
    Process finished with exit code 0
    

    Look at https://gist.github.com/lukewarlow/3bb76d5aefe688c05c1546ca6bf05dbf for a better example implementation of the library.

    Visit original content creator repository https://github.com/lukewarlow/GoConsoleMenu
  • print3d-ffcp-z-axis-shim

    Z-Axis shim spacer for 2016 FlashForge Creator Pro (for glass bed, customizable)

    3D printable customizable shim for using a glass bed in the FlashForge Creator Pro 2016 and similar (formerly thing:1886458)

    License

    Creative Commons – Attribution – Share Alike

    Attribution

    This is a remix of “Z-Axis Shim in 3mm/4mm/5mm Versions for Flashforge Creator Pro Variant Models Glass Bed Powerspec Pro” by Atomist (Thingiverse thing:557994), and “Z-Axis Shim for Flashforge Creator Pro (for glass bed sold by flashforge-eu.com)” by ben8p (Thingiverse thing:1475239).

    Gallery

    Photo 1🔎 Photo 2🔎

    Description and Instructions

    If you want to install a glass bed or another print surface of considerable thickness on your printer, you need to adjust the height at which the Z endstop is triggered, because the extra thickness of the glass is added to the platform. If you don’t do this, the platform will level too high and you are likely to run out of adjustment length of the levelling springs and be unable to level the plate, or even risk ramming the nozzle into the glass and breaking it.

    The easiest way to do this, is to add a shim to the rear of the platform at the location of the Z endstop, to raise this part with roughly the same amount as the thickness of the extra plate. There are many shims available but I couldn’t find any for the 2016 FlashForge Creator Pro, which seems to have screws in different places than other models, so here’s a remix that fits. Ready-to-use models are available in thicknesses from 2 to 6 mm (0.08 to 0.24 inch).

    For those who want to make a custom shim of any thickness between 1 and 10 mm, a customizable OpenSCAD model is provided. Open the .scad file in OpenSCAD and use the OpenSCAD Customizer to create a model with your own desired specifications.

    The shims are designed to slightly clamp themselves between the rods, but if you print them in PLA and often do prints with a hot enclosed chamber, they may lose their ‘springiness’ over time and become a little wiggly. This is not a problem and does not affect their function.

    Hints for Printing

    Print at 0.1 mm layers if you want a reasonably accurate thickness, although this would only matter if you regularly swap between glass plates and things of other thicknesses and don’t want to have to make large readjustments each time.

    Use proper cooling and a sufficient number of top layers to avoid ‘pillowing.’

    I don’t recommend ABS for the shim because flat objects like these tend to curl up a bit when the ABS cools down after being printed. It is best for the shim to be perfectly flat. PETG is a good material but PLA will also do fine unless you’re really going to be printing in a very hot enclosed chamber.

    Updates

    2016/11/12

    First publication on Thingiverse.

    2017/05/01

    Added 6 mm version

    2017/07/30

    Added an option to Customizer to reinforce the center of the part around the hole for the Z axis leadscrew. This allows to make thin shims that do not bend easily.

    2021/06/15

    Migrated to GitHub.

    TAGS

    2016, bed_leveling, customizable, customizer, FFCP, FFCPRo, Glass_bed, shim, spacer, Z-Axis

    Visit original content creator repository https://github.com/DrLex0/print3d-ffcp-z-axis-shim
  • vsslite

    VSSLite

    A vector similarity search engine for humans🥳

    🎁 Install

    $ pip install vsslite

    ✨ Features

    VSSLite provides a user-friendly interface for langchain and sqlite-vss.

    🧩 Start API server

    $ export OPENAI_APIKEY="YOUR_API_KEY"
    $ python -m vsslite

    Or

    import uvicorn
    from vsslite import LangChainVSSLiteServer
    
    app = LangChainVSSLiteServer(YOUR_API_KEY).app
    uvicorn.run(app, host="127.0.0.1", port=8000)

    Go http://127.0.0.1:8000/docs to know the details and try it out.

    🔍 Search

    from vsslite import LangChainVSSLiteClient
    
    # Initialize
    vss = LangChainVSSLiteClient()
    
    # Add data with embeddings
    vss.add("The difference between eel and conger eel is that eel is more expensive.")
    vss.add("Red pandas are smaller than pandas, but when it comes to cuteness, there is no \"lesser\" about them.")
    vss.add("There is no difference between \"Ohagi\" and \"Botamochi\" themselves; they are used interchangeably depending on the season.")
    
    # Search
    print(vss.search("fish", count=1))
    print(vss.search("animal", count=1))
    print(vss.search("food", count=1))

    Now you can get these search results.

    $ python run.py
    
    [{'page_content': 'The difference between eel and conger eel is that eel is more expensive.', 'metadata': {'source': 'inline'}}]
    [{'page_content': 'Red pandas are smaller than pandas, but when it comes to cuteness, there is no "lesser" about them.', 'metadata': {'source': 'inline'}}]
    [{'page_content': 'There is no difference between "Ohagi" and "Botamochi" themselves; they are used interchangeably depending on the season.', 'metadata': {'source': 'inline'}}]

    🔧 Data management (Add, Get, Update, Delete)

    Helps CRUD.

    # Add
    id = vss.add("The difference between eel and conger eel is that eel is more expensive.")[0]
    # Get
    vss.get(id)
    # Update
    vss.update(id, "The difference between eel and conger eel is that eel is more expensive. Una-jiro is cheaper than both of them.")
    # Delete
    vss.delete(id)
    # Delete all
    vss.delete_all()

    Upload data. Accept Text, PDF, CSV and JSON for now.

    vss.upload("path/to/data.json")

    🍻 Asynchronous

    Use async methods when you use VSSLite in server apps.

    await vss.aadd("~~~")
    await vss.aupdate(id, "~~~")
    await vss.aget(id)
    await vss.adelete(id)
    await vss.aupdate_all()
    await vss.asearch("~~~")
    await vss.aupload("~~~")

    🧇 Namespace

    VSSLite supports namespaces for dividing the set of documents to search or update.

    vss = LangChainVSSLiteClient()
    
    # Search product documents
    vss.search("What is the difference between super size and ultra size?", namespace="product")
    # Search company documents
    vss.search("Who is the CTO of Unagiken?", namespace="company")

    🌐 Web UI

    You can quickly launch a Q&A web service based on documents 🚅

    Install dependency

    $ pip install streamlit
    $ pip install streamlit-chat

    Make a script

    This is an example for OpenAI terms of use (upload terms of use to VSSServer with namespace openai).
    Save this script as runui.py.

    import asyncio
    from vsslite.chat import (
        ChatUI,
        VSSQAFunction
    )
    
    # Setup QA function
    openai_qa_func = VSSQAFunction(
        name="get_openai_terms_of_use",
        description="Get information about terms of use of OpenAI services including ChatGPT.",
        parameters={"type": "object", "properties": {}},
        namespace="openai",
        # answer_lang="Japanese",  # <- Uncomment if you want to get answer in Japanese
        # is_always_on=True,  # <- Uncomment if you want to always fire this function
        verbose=True
    )
    
    # Start app
    chatui = ChatUI(temperature=0.5, functions=[openai_qa_func])
    asyncio.run(chatui.start())

    Start UI

    $ streamlit run runui.py

    See https://docs.streamlit.io to know more about Streamlit.

    💬 LINE Bot

    You can quickly launch a LINE Bot based on documents 🛫

    Install dependency

    $ pip install aiohttp line-bot-sdk

    Make a script

    This is an example for OpenAI terms of use (upload terms of use to VSSServer with namespace openai).
    Save this script as line.py.

    import os
    from vsslite.chatgpt_processor import VSSQAFunction
    from vsslite.line import LineBotServer
    
    # Setup QA function(s)
    from vsslite.chatgpt_processor import VSSQAFunction
    openai_qa_func = VSSQAFunction(
        name="get_openai_terms_of_use",
        description="Get information about terms of use of OpenAI services including ChatGPT.",
        parameters={"type": "object", "properties": {}},
        vss_url=os.getenv("VSS_URL") or "http://127.0.0.1:8000",
        namespace="openai",
        # answer_lang="Japanese",  # <- Uncomment if you want to get answer in Japanese
        # is_always_on=True,  # <- Uncomment if you want to always fire this function
        verbose=True
    )
    
    app = LineBotServer(
        channel_access_token=YOUR_CHANNEL_ACCESS_TOKEN,
        channel_secret=YOUR_CHANNEL_SECRET,
        endpoint_path="/linebot",   # <- Set "https://your_domain/linebot" to webhook url at LINE Developers
        functions=[openai_qa_func]
    ).app

    Start LINE Bot Webhook Server

    $ uvicorn line:app --host 0.0.0.0 --port 8002

    Set `https://your_domain/linebot“ to webhook url at LINE Developers.

    🐳 Docker

    If you want to start VSSLite API with chat console, use docker-compose.yml in examples.

    Set your OpenAI API Key in vsslite.env and execute the command below:

    $ docker-compose -p vsslite --env-file vsslite.env up -d --build

    Or, use Dockerfile to start each service separately.

    $ docker build -t vsslite-api -f Dockerfile.api .
    $ docker run --name vsslite-api --mount type=bind,source="$(pwd)"/vectorstore,target=/app/vectorstore -d -p 8000:8000 -e OPENAI_API_KEY=$OPENAI_API_KEY vsslite-api:latest

    $ docker build -t vsslite-chat -f Dockerfile.chat .
    $ docker run --name vsslite-chat -d -p 8001:8000 -e OPENAI_API_KEY=$OPENAI_API_KEY vsslite-chat:latest

    🌊 Using Azure OpenAI Service

    VSSLite supports Azure OpenAI Service👍

    API Server

    Use OpenAIEmbeddings configured for Azure.

    from langchain.embeddings import OpenAIEmbeddings
    azure_embeddings = OpenAIEmbeddings(
        openai_api_type="azure",
        openai_api_base="https://your-endpoint.openai.azure.com/",
        openai_api_version="2023-08-01-preview",
        deployment="your-embeddings-deployment-name"
    )
    
    app = LangChainVSSLiteServer(
        apikey=YOUR_API_KEY or os.getenv("OPENAI_API_KEY"),
        persist_directory="./vectorstore",
        chunk_size=500,
        chunk_overlap=0,
        embedding_function=azure_embeddings
    ).app

    Chat UI

    Create ChatUI with Azure OpenAI Service configurations.

    chatui = ChatUI(
        apikey=YOUR_API_KEY or os.getenv("OPENAI_API_KEY"),
        temperature=0.5,
        functions=[openai_qa_func],
        # Config for Azure OpenAI Service
        api_type="azure",
        api_base="https://your-endpoint.openai.azure.com/",
        api_version="2023-08-01-preview",
        engine="your-embeddings-deployment-name"
    )

    See also the examples.

    🍪 Classic version (based on SQLite)

    See v0.3.0 README

    🥰 Special thanks

    Visit original content creator repository
    https://github.com/uezo/vsslite

  • child-care-check

    Child Care Check

    Ensure you find the best care.

    Image

    Reflecting on past experience as a preK teacher, the developer realized that licensing and citation info for CA child care facilities is not especially easy for the public to access and digest. Built off of data from California Dept of Social Services, Child Care Check enables a user to display facilities on a map & filter by adherence to state licensing, location, and center name/key words. Child Care Check is a resource that will help both parents & care providers find quality care environments for children.

    Project Tech Stack

    Python3, Flask, PostgreSQL, SQLAlchemy, HTML, CSS, Bootstrap, JavaScript, jQuery, AJAX, Jinja

    APIs Used

    Google Maps API, Google Geocoding API

    Roadmap

    Future features and fixes currently under considertion include:

    • functional filter form on /facilities
    • testing and refactoring front end to ensure mobile responsiveness
    • scheduled auto-updates to data

    Contributions

    Please log an issue if you have suggestions. Also feel free to make a pull request, if you like.

    Authors

    Created by Hannah Johnson. Visit her LinkedIn profile to learn more.

    Project Status

    This project is active.

    Visit original content creator repository https://github.com/hanndull/child-care-check
  • terraform-provider-berglas

    Terraform Berglas Provider

    This is a Terraform provider for interacting with
    Berglas.

    Secrets will be stored in plaintext in the Terraform state. You should only
    use this with provider with Terraform remote state. For more information, please
    see sensitive state.

    Installation

    1. Download the latest compiled binary from GitHub releases.

    2. Unzip/untar the archive.

    3. Move it into $HOME/.terraform.d/plugins:

      $ mkdir -p $HOME/.terraform.d/plugins
      $ mv terraform-provider-berglas $HOME/.terraform.d/plugins/terraform-provider-berglas
    4. Create your Terraform configurations as normal, and run terraform init:

      $ terraform init

      This will find the plugin locally.

    5. If you haven’t already, bootstrap berglas

    Optionally

    If using terraform v0.13+ you can create a versions.tf file to pull the plugin during terraform init without installing it locally:

    terraform {
      required_providers {
        berglas = {
          source  = "sethvargo/berglas"
          version = "~> 0.1"
        }
      }
    }

    Usage

    1. Create a Terraform configuration file:

      resource "berglas_secret" "demo" {
        bucket    = "my-bucket"
        key       = "projects/${var.project_id}/locations/global/keyRings/berglas/cryptoKeys/berglas-key"
        name      = "demo"
        plaintext = "p@s$w0rd!"
      }
    2. Run terraform init to pull in the provider:

      $ terraform init
    3. Run terraform plan and terraform apply:

      $ terraform plan
      
      $ terraform apply

    Examples

    For more examples, please see the examples folder in this
    repository.

    Reference

    See the documentation.

    Visit original content creator repository
    https://github.com/sethvargo/terraform-provider-berglas

  • sftp-deployer

    sftp-deployer

    Build status

    Version

    A command-line tool for lightning-fast SFTP deployments.

    • Transfers a directory as a single compressed file
    • Minimizes downtime of target directory with blue/green deployment

    SFTP deployer demo

    Install

    You need Node.JS to use sftp-deployer.

    npm install -g sftp-deployer
    

    Usage

    The following command uploads the contents of the ./build directory to a remote SSH host, to /var/www/build:

    sftp-deployer --host example.com \
      --user bob \
      --key private_key.pem \
      --local ./build \
      --target /var/www/build
    

    Available options:

      -V, --version                output the version number
      -c, --config <config file>   configuration file to use (default: ".sftp.json")
      -h, --host <host>            hostname to connect to
      -p, --port <port>            SSH port to use (defaults to 22)
      -u, --user <username>        the ssh username
      -k, --key <key_or_file>      path to private key file, or private key itself
      --password <password>        the password to the private key
      -l, --local <path>           directory to upload
      -t, --target <target_dir>    target directory on remote host
      -s, --staging <staging_dir>  staging directory on remote host
                                   (defaults to the target directory + .staging)
      -u, --upload <upload_dir>    upload directory on remote host
                                   (default: "/var/tmp")
      --help                       display help for command
    

    Using a configuration file

    Each of the options listed above may also be specified in a configuration file called .sftp.json. You may override this filename by using the -c option (see above).

    For example:

    {
      "host": "example.com",
      "port": 1234, /* Optional, defaults to 22 */
      "user": "bob"
      "key": "private_key.pem"
      "password": "super_secure", /* Optional, only needed if the key is encrypted */
      "local": "./build",
      "target": "/var/www/build",
      "staging": "/var/www/incoming/uploads", /* Optional, defaults to target directory + .staging */
      "upload": "/my/upload/dir" /* Optional, defaults to /var/tmp */
    }

    You may then simply invoke sftp-deployer and it will take its input from the .sftp.json file in the current working directory.

    Blue/green deployment

    When a directory is uploaded but a target directory already exists, the following steps are taken to minimize downtime:

    • Deploy new directory to a staging location
    • Swap staging location and target location

    This makes sure that the target directory is only down for a couple of milliseconds.

    Visit original content creator repository https://github.com/svandriel/sftp-deployer
  • aoc2019

    Advent Of Code 2019 – Golang

    I’ll try to squeeze in code every day
    https://adventofcode.com/2019

    Because each “day” is published at 9pm PST, there’s a crush on quality vs. sleep and a day-job. I’m primarily focused deepening my Go skills while “getting ‘er done” with crude beauty :). I’ve taken writing unit-tests to assert samples initially, then separate tests per “part” of each challenge.

    LMK if you’re enjoying or loathing pawing over my code and approach: stephbu@gmail.com

    Day Source Package Puzzle Rubric Notes
    1 day1 day1 Good warmup exercise
    2 day2 day2 Interesting problem that had a pseudo-CPU instruction processor/emulator Go functions made the solution quite interesting
    3 day3 day3 Computationally intensive tortoise/hare path enumerator – the brute force approach made Part 2 pretty easy
    4 day4 day4 Probably the trickiest to-date because state-machine needed additional test cases to catch some interesting corner cases
    5 day5 day5 The investment in writing a pseudo-CPU on day 2 just paid back, adding instructions and operating modes was pretty easy, albeit needed a few test cases for things like the parameter masking
    6 day6 day6 Stalled for a while because I missed the test data/samples being ordered, but unordered in the puzzle. This caused problems in missing large chunks of data during the expansion of direct orbits into indirect orbits, and undercounting the dataset (~7300 vs ~203000). Rectified the mistake by taking two passes at the data, one to load the direct orbits, and second to recursively scan and expand each indirect orbit. Part two just needed to retro-fit hop-counting in the indirect expansion phase, to enable fast finding of common-root brute-force list comparison to extract least hops
    7 day7 day7 Third day of Intcode CPU, after starting Part 1 a little late, I made good progress and took less than 30mins to get to answer. Part 2 not so good, managed to miss the fact that I was using a ref-copy of memory, so go-routines were corrupting each other. Figured it out in the end.
    8 day8 day8 Simpler day, easier problem, less satisfying outcome with weaker tests because of the shape fo the results require visual interpretation. I used GSheets conditional formatting to make Part 2 answer really clear.
    9 day9 day9 More use of the IntCode Processor, adding modes for parameters working ok
    10 day10 day10 Lots of geometry – rusty as heck. Missed the occlusion at any angle clause, ended up writing a masking system that I canned when I RTFM. The Hashmap/SortedList worked really well in the second part. Most of the code was mainly assertives test cases. Almost went to bed to sleep on Part 2, transforming the X-oriented geometry to bearings. Had a brainwave literally just before shutdown, and got ‘er done.
    11 day11 day11 Multidimensional Arrays suck lots in Golang – untuitive syntax, initialization, consumption, the works. Got there in the end.

    Getting Started

    I’ve broken out the project into packages of code and tests per day. Clone the repo, then use

    go get github.com/stephbu/aoc2019
    cd $GOROOT/src/github.com/stephbu/aoc2019
    dep ensure       
    go test ./... -v   # test all days
    ...
    go test ./day6 -v  # test specific day
    

    I’ve taken writing unit-tests to assert samples initially, then separate tests per “part” of each challenge.

    DevLog Day 7

    Really tired after a late night and early start at work. Part 1 done reasonably quickly. Part 2, made a wrong turn that wasted ~3hrs on a go-routine-on-go-routine corruption because I forgot to copy IntCode program memory. Crawled into bed at 3am, not super good. Probably the biggest takeaway is debugging go-routines in Goland is getting better, but isn’t great. It was really difficult to find the accidental shared pointer, ended up going back to sprintf debug.

    DevLog Day 11

    So I made it to the brink of day 11. On track at 20 stars and just waiting for the clock to to get another couple. Made a tonne of use of the IntCode interpreter. I think all those days of Z80 are starting to pay off 42 years later. I’m sitting at 5.3KLoC, not bad for 10 nights of hacking away. If you’d missed some of the previous days, I’d suggest going back, especially to Day 10 which has a full IntCode validator as the final puzzle. Not sure if I’ll get time code Thur/Fri, I’m day-tripping SFO in a couple of days time, then company Xmas party the day after.

    Visit original content creator repository
    https://github.com/stephbu/aoc2019

  • geany-dark-scheme

    geany-dark-scheme

    Geany Dark Scheme Icon

    This is a dark syntax colouring theme for the Geany text editor.

    Screenshot of Geany Dark Scheme

    Please help us extend the geany-dark theme to support new languages! Please extend the current theme by using the colours from one of the existing syntax files – that way they all play nice together.

    Language Support

    The scheme currently supports highlighting for these languages:

    • .c – C languages files (contributed by Paulo Cabido)
    • .cs – C# language files (contributed by Duncan Lock)
    • .cpp – C++ (contributed by gtk.monkey)
    • .conf – Apache (and Geany) style .conf files (contributed by Duncan Lock)
    • .css – Cascading Stylesheet files (contributed by Roman Snitko)
    • .d – d language files (contributed by gtk.monkey)
    • .docbook – Docbook mark-up files (contributed by gmunkhbaatarmn)
    • .haskel – Haskel code (contributed by Dave.Sarman)
    • .html – Hypertext Markup Language file – web pages (contributed by Roman Snitko, Javascript support added by Daniel Mlodecki)
    • .java – Java language files (contributed by Paulo Cabido)
    • .javascript – Javascript scripts (Duncan Lock, partially based on GeanyDarkTango?)
    • .latex – Latex files (contributed by Enrico Tröger)
    • .lua – Lua script files (contributed by curtstrangward)
    • .markdown – Markdown text files (contributed by pho3nixf1re84)
    • .NSIS – Nullsoft Scriptable Installer System scripts (contributed by mr.soup12, modified by Duncan Lock)
    • .pascal – Pascal code (contributed by gtk.monkey)
    • .perl – Perl language files (contributed by Roman Snitko)
    • .php (contributed by Roman Snitko, improved by s5n43K3s)
    • .py – Python language files (contributed by Nicolas Hainaux)
    • .r – R stats language (contributed by weibullguy)
    • .rb – Ruby language files (contributed by Roman Snitko)
    • .sh – Bash shell scripts (contributed by Duncan Lock)
    • .sql – SQL database query files (contributed by Duncan Lock)
    • .yaml – YAML files (contributed by pho3nixf1re84)
    • .vala – Vala language files (contributed by boromil)
    • .xml – Extensible Markup Language files (contributed by Roman Snitko)

    How to Install the Theme

    Linux: (Ubuntu)

    Local User (just for you):

    The simplest way to do this is to copy the contents of the filedefs folder into the ~/.config/geany/filedefs/ folder. This means that you can only have one theme installed at a time, though.

    A better way, is to copy the contents filedefs folder into a ~/.config/geany/geany_dark_filedefs/ folder, creating the folder if it doesn’t already exist. Then create a symlink to that folder:

    ln -s ~/.config/geany/geany_dark_filedefs/ ~/.config/geany/filedefs

    This allows you to have several themes stored in your ~/.config/geany/ folder, and to change which one you’re using by changing where the ~/.config/geany/filedefs symlink points.

    System Wide:

    BE SURE TO BACK UP THE EXISTING FILEDEFS IF YOU DON’T WANT TO LOSE THEM!

    Copy the filedefs folder into /usr/share/geany/

    NOTE: Geany may be installed in /usr/local/geany/ or /opt/geany/ depending on your OS or your installation method. Be sure to choose the correct directory. This method means that your filedef files will get overwritten when you upgrade Geany and also means that you can only have one theme installed at a time.

    Windows:

    Copy the contents of the filedefs folder to…

    Current User only:

    %APPDATA%\geany\filedefs

    System Wide:

    BE SURE TO BACK UP THE EXISTING FILEDEFS IF YOU DON’T WANT TO LOSE THEM!

    C:\Program Files\Geany\data

    NOTE: This method means that your filedef files will get overwritten when you upgrade Geany and also means that you can only have one theme installed at a time.

    Visit original content creator repository https://github.com/Wayn0/geany-dark-scheme
  • geany-dark-scheme

    geany-dark-scheme

    Geany Dark Scheme Icon

    This is a dark syntax colouring theme for the Geany text editor.

    Screenshot of Geany Dark Scheme

    Please help us extend the geany-dark theme to support new languages! Please extend the current theme by using the colours from one of the existing syntax files – that way they all play nice together.

    Language Support

    The scheme currently supports highlighting for these languages:

    • .c – C languages files (contributed by Paulo Cabido)
    • .cs – C# language files (contributed by Duncan Lock)
    • .cpp – C++ (contributed by gtk.monkey)
    • .conf – Apache (and Geany) style .conf files (contributed by Duncan Lock)
    • .css – Cascading Stylesheet files (contributed by Roman Snitko)
    • .d – d language files (contributed by gtk.monkey)
    • .docbook – Docbook mark-up files (contributed by gmunkhbaatarmn)
    • .haskel – Haskel code (contributed by Dave.Sarman)
    • .html – Hypertext Markup Language file – web pages (contributed by Roman Snitko, Javascript support added by Daniel Mlodecki)
    • .java – Java language files (contributed by Paulo Cabido)
    • .javascript – Javascript scripts (Duncan Lock, partially based on GeanyDarkTango?)
    • .latex – Latex files (contributed by Enrico Tröger)
    • .lua – Lua script files (contributed by curtstrangward)
    • .markdown – Markdown text files (contributed by pho3nixf1re84)
    • .NSIS – Nullsoft Scriptable Installer System scripts (contributed by mr.soup12, modified by Duncan Lock)
    • .pascal – Pascal code (contributed by gtk.monkey)
    • .perl – Perl language files (contributed by Roman Snitko)
    • .php (contributed by Roman Snitko, improved by s5n43K3s)
    • .py – Python language files (contributed by Nicolas Hainaux)
    • .r – R stats language (contributed by weibullguy)
    • .rb – Ruby language files (contributed by Roman Snitko)
    • .sh – Bash shell scripts (contributed by Duncan Lock)
    • .sql – SQL database query files (contributed by Duncan Lock)
    • .yaml – YAML files (contributed by pho3nixf1re84)
    • .vala – Vala language files (contributed by boromil)
    • .xml – Extensible Markup Language files (contributed by Roman Snitko)

    How to Install the Theme

    Linux: (Ubuntu)

    Local User (just for you):

    The simplest way to do this is to copy the contents of the filedefs folder into the ~/.config/geany/filedefs/ folder. This means that you can only have one theme installed at a time, though.

    A better way, is to copy the contents filedefs folder into a ~/.config/geany/geany_dark_filedefs/ folder, creating the folder if it doesn’t already exist. Then create a symlink to that folder:

    ln -s ~/.config/geany/geany_dark_filedefs/ ~/.config/geany/filedefs

    This allows you to have several themes stored in your ~/.config/geany/ folder, and to change which one you’re using by changing where the ~/.config/geany/filedefs symlink points.

    System Wide:

    BE SURE TO BACK UP THE EXISTING FILEDEFS IF YOU DON’T WANT TO LOSE THEM!

    Copy the filedefs folder into /usr/share/geany/

    NOTE: Geany may be installed in /usr/local/geany/ or /opt/geany/ depending on your OS or your installation method. Be sure to choose the correct directory. This method means that your filedef files will get overwritten when you upgrade Geany and also means that you can only have one theme installed at a time.

    Windows:

    Copy the contents of the filedefs folder to…

    Current User only:

    %APPDATA%\geany\filedefs

    System Wide:

    BE SURE TO BACK UP THE EXISTING FILEDEFS IF YOU DON’T WANT TO LOSE THEM!

    C:\Program Files\Geany\data

    NOTE: This method means that your filedef files will get overwritten when you upgrade Geany and also means that you can only have one theme installed at a time.

    Visit original content creator repository https://github.com/Wayn0/geany-dark-scheme