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 / 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 / 002-single-url-plugin.patch
Last active August 29, 2015 14:15
Draft for a single URL plugin in Glowing Bear
diff --git a/js/plugins.js b/js/plugins.js
index 839df4c..b5559b8 100644
--- a/js/plugins.js
+++ b/js/plugins.js
@@ -94,6 +94,44 @@ var UrlPlugin = function(name, urlCallback) {
};
};
+var urlHandlers = [{
+ /*
@vivien
vivien / 001-hash-urls.patch
Created February 18, 2015 16:31
Draft to hash URLs in Glowing Bear plugins
diff --git a/js/plugins.js b/js/plugins.js
index b282d13..839df4c 100644
--- a/js/plugins.js
+++ b/js/plugins.js
@@ -21,6 +21,50 @@ var Plugin = function(name, contentForMessage) {
};
};
+var parseURL = function(url) {
+ var regexp = /(https?):\/\/(?:www\.)?([^\/\?#]+)(\/[^\?#]+)?(#|\?)?(.*)/;
From 87d6bfd5fe53c64ab2f3bb860484d741dc9b5572 Mon Sep 17 00:00:00 2001
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Date: Wed, 14 Jan 2015 18:55:45 -0500
Subject: [PATCH] net: dsa: review hwmon attributes visibility
Instead of setting a minimal mode for the temp_max sysfs attribute and
adding write permission in the is_visible function, use the
DEVICE_ATTR_RW macro to reduce boiler plate and remove write permission
if the set_temp_limit function is missing.
@vivien
vivien / ipaddr.sh
Created January 9, 2015 06:11
ip address blocklet
#!/bin/bash
# use the provided interface, otherwise the first default device
if [[ -n $BLOCK_INSTANCE ]]
then
IF=$BLOCK_INSTANCE
else
IF=$( ip route | awk '/^default/ { print $5 ; exit }' )
fi
@vivien
vivien / openmw.ini
Last active August 29, 2015 14:11
i3blocks bocklet to fetch the latest OpenMW version and progress percentage
[openmw]
command=curl -s https://gist.githubusercontent.com/vivien/7535f85928558fffb11d/raw/openmw.rb | ruby
interval=3600
@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
@vivien
vivien / i3-msg-subscribe.patch
Created October 7, 2014 04:17
i3-msg hack to implement the "SUBSCRIBE" message type
diff --git a/i3-msg/main.c b/i3-msg/main.c
index 354e8af..a1af25c 100644
--- a/i3-msg/main.c
+++ b/i3-msg/main.c
@@ -124,16 +124,18 @@ int main(int argc, char *argv[]) {
uint32_t message_type = I3_IPC_MESSAGE_TYPE_COMMAND;
char *payload = NULL;
bool quiet = false;
+ bool monitor = false;
@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 / i3-next-workspace.sh
Last active March 23, 2018 11:05
Jump to the next available workspace, on the current screen. If you use 1, 2 and 5, it'll jump to workspace 3.
#!/bin/bash
map_num () {
tr , '\n' | grep '"num":' | cut -d: -f2
# equivalent to jshon -a -e num
echo 11
}
next_min () {
sort -n | cat -n | awk '{ if ($1 != $2) { print $1; exit } }'