Skip to content

Instantly share code, notes, and snippets.

View vivien's full-sized avatar

Vivien Didelot vivien

  • Montréal
View GitHub Profile
@vivien
vivien / battery
Last active February 3, 2024 01:35
battery script for i3blocks
#!/usr/bin/perl
#
# Copyright 2014 Pierre Mavro <deimos@deimos.fr>
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
#
# Licensed under the terms of the GNU GPL v3, or any later version.
#
# This script is meant to use with i3blocks. It parses the output of the "acpi"
# command (often provided by a package of the same name) to read the status of
# the battery, and eventually its remaining time (to full charge or discharge).
@vivien
vivien / notify
Last active December 23, 2023 03:41
i3blocks integration with dunst
#!/bin/sh
#
# i3blocks integration with dunst.
# Author: Vivien Didelot <vivien.didelot@gmail.com>
#
# dunst caches a notification and signals i3blocks.
# i3blocks catches the signal and prints the cached notification.
#
# Put this rule at the end of your ~/.config/dunst/dunstrc:
#
@vivien
vivien / irccat
Created May 2, 2014 00:38
irccat - Using netcat with an IRC channel
#!/bin/sh
# Copyright 2014 Vivien Didelot <vivien@didelot.org>
# Licensed under the terms of the GNU GPL v3, or any later version.
NICK=irccat42
SERVER=irc.freenode.net
PORT=6667
CHAN="#irccat"
{
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="/webservices/catalog/xsl/searchRetrieveResponse.xsl"?>
<searchRetrieveResponse xmlns="http://www.loc.gov/zing/srw/" xmlns:oclcterms="http://purl.org/oclc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:diag="http://www.loc.gov/zing/srw/diagnostic/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<version>1.1</version>
<numberOfRecords>33587</numberOfRecords>
<records>
<record>
<recordSchema>info:srw/schema/1/dc</recordSchema>
<recordPacking>xml</recordPacking>
@vivien
vivien / custom-separator-trick.conf
Created March 4, 2014 04:32
Custom separator trick for i3blocks
# We use the global settings as a shortcut to define our own separator.
# Based on the default i3blocks config file.
full_text=〉
align=center
color=#666666
separator=false
separator_block_width=7
[volume]
command=/usr/libexec/i3blocks/volume
@vivien
vivien / imgur
Last active January 27, 2022 19:46
Shell script to upload image(s) to imgur.com
#!/bin/sh
#
# Upload image(s) to imgur.com
# Copyright (C) 2014 Vivien Didelot <vivien@didelot.org>
# Licensed under GPL version 3, see http://www.gnu.org/licenses/gpl.txt
#
# Requires "jshon":
# http://kmkeen.com/jshon/
#
# Alternatives, which suck:
@vivien
vivien / volume
Last active September 11, 2020 09:22
i3blocks default volume script
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@vivien
vivien / fossil.bash_completion
Created June 5, 2012 01:39
A bash_completion file for Fossil SCM, as /etc/bash_completion.d/git works for Git, providing a __fossil_ps1 bash function, and other tools.
# Bash completion support for Fossil.
# It is based on the Git Bash completion file.
# It best fits in /etc/bash_completion.d/fossil
#
# Copyright (C) 2011 Vivien Didelot <vivien@didelot.org>
# This file is distributed under the same terms as the license of the Fossil project.
#
# This file contains routine to change your PS1, and helper functions.
#
# For instance, add those options to your bashrc to customize PS1:
@vivien
vivien / rpi_genimage.patch
Last active May 1, 2019 20:25
[PATCH 0/2] board/raspberrypi: add a genimage config (based on 8d00fe4)
From 9c91753518e813ad96c3ec4d225f4545cff826e3 Mon Sep 17 00:00:00 2001
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Mon, 16 Mar 2015 00:21:31 -0400
Subject: [PATCH 1/2] board/raspberrypi: install Device Tree
Add a post-image script to Raspberry Pi configs with a Device Tree
(raspberrypi_dt and raspberrypi2), which calls the mkknlimg tool on the
resulting zImage kernel, in order to install the Device Tree as
described in the board readme file.
@vivien
vivien / network.sh
Created November 12, 2014 14:29
i3blocks network script
#!/bin/sh
# Copyright (C) 2014 Julien Bonjean <julien@bonjean.info>
# 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,
# but WITHOUT ANY WARRANTY; without even the implied warranty of