Skip to content

Instantly share code, notes, and snippets.

View blueyed's full-sized avatar
💭
❤️ not eating nor abusing animals 🍀

Daniel Hahler blueyed

💭
❤️ not eating nor abusing animals 🍀
View GitHub Profile
#!/bin/sh
# Experimental: rename a AwesomeWM tag, using Zenity for UI.
#
# Should be easier.
# Query current tag name
cur=$(echo 'return require("awful").tag.selected().name' | awesome-client | sed -nE 's/.*?"(.*)"$/\1/p')
echo "cur: $cur"
# Ask for the new name
@blueyed
blueyed / -
Created March 15, 2014 16:35
0
-- Rename tag
-- Reference: http://awesome.naquadah.org/doc/api/modules/awful.prompt.html
awful.key({ modkey, "Shift", }, "F2", function ()
awful.prompt.run({ prompt = "Rename tab: ", text = awful.tag.selected().name, },
mypromptbox[mouse.screen].widget,
function (s)
awful.tag.selected().name = s
end)
end),
client.connect_signal("request::activate", function(c)
if c:isvisible() then
client.focus = c
c:raise()
else
if not awesome_startup then
c.urgent = true
end
end
end)
### Keybase proof
I hereby claim:
* I am blueyed on github.
* I am blueyed (https://keybase.io/blueyed) on keybase.
* I have a public key whose fingerprint is B5A6 C220 829F AE5D 69EB 9CA3 7C02 BF85 3FE6 3E00
To claim this, I am signing this object:
--- Put a client relatively on the screen's workarea (sets floating state).
-- @param c A client.
-- @param x X position multipler (0.5 for center).
-- @param y Y position multiplier (0.5 for center).
-- @param width Width multiplier.
-- @param width Height multiplier.
local put_client = function(c, x, y, width, height)
local wa = capi.screen[c.screen].workarea
local geo = {
local ewmh = require("awful.ewmh")
client.disconnect_signal("request::activate", awful.ewmh.activate)
client.connect_signal("request::activate", function(c)
if not c:isvisible() then
-- Meant to handle opening a link from somewhere.
-- Causes Firefox to steal the focus on other events though!
-- Would need some magic flag being set via open-in-running-browser.
-- if c.class == "Firefox" and c.type == "normal" then
-- awful.client.jumpto(c)
-- -- awful.tag.viewonly(c:tags()[1])
-- Opacity handling.
local M = {}
M = {
opacity_unfocused_screen = 0.98,
opacity_unfocused_screen_last_client = 1,
}
local locked_opacity = {}
local capi = {
client = client,
-- Standard awesome library
local gears = require("gears")
local _dbus = dbus; dbus = nil
local naughty = require("naughty") -- XXX: if loaded (with dbus available), notifications do not go to dunst/notify-osd anymore
dbus = _dbus
-- Debug function. Set focusstyle.debug to activate it. {{{2
local gears = require("gears")
local bdebug_level = 10 -- display all
-- Autohide tags with no clients. {{{
-- Based on eminent (https://github.com/guotsuan/eminent), without monkey-patching viewidx.
local function autohidetags(screen)
for k, t in ipairs(awful.tag.gettags(screen)) do
if t.selected or #t:clients() > 0 then
awful.tag.setproperty(t, "hide", false)
else
awful.tag.setproperty(t, "hide", true)
end
end
--- django/django/contrib/admin/templates/admin/base_site.html 2014-05-15 01:20:54.977099539 +0200
+++ virtualenv/src/autocomplete-light/autocomplete_light/templates/admin/base_site.html 2014-04-30 16:10:30.881101635 +0200
@@ -1,10 +1,9 @@
{% extends "admin/base.html" %}
-{% load i18n %}
+{% load admin_static %}
-{% block title %}{{ title }} | {% trans 'Django site admin' %}{% endblock %}
+{% block extrahead %}
+<script>window.jQuery || document.write('<script src="{% static 'jquery.js' %}">\x3C/script>')</script>