1
0
Fork 0
mirror of https://github.com/lcpz/awesome-copycats.git synced 2024-12-22 19:22:32 +00:00

blackburn: png taskbar

This commit is contained in:
luke bonham 2013-04-16 21:29:22 +02:00
parent 2949f9a176
commit 35d9a61017
4 changed files with 28 additions and 57 deletions

View file

@ -97,8 +97,8 @@ layouts =
{ {
awful.layout.suit.floating, -- 1 awful.layout.suit.floating, -- 1
awful.layout.suit.tile, -- 2 awful.layout.suit.tile, -- 2
awful.layout.suit.tile.left, -- 3 awful.layout.suit.fair, -- 3
awful.layout.suit.tile.bottom, -- 4 awful.layout.suit.tile.left, -- 4
awful.layout.suit.tile.top, -- 5 awful.layout.suit.tile.top, -- 5
} }
@ -361,7 +361,15 @@ function(widget, args)
if( args["{Title}"] ~= curr_track ) if( args["{Title}"] ~= curr_track )
then then
curr_track = args["{Title}"] curr_track = args["{Title}"]
run_once(scriptdir .. "mpdinfo") os.execute(scriptdir .. "mpdinfo")
old_id = naughty.notify({
title = "Now playing",
text = args["{Artist}"] .. " (" .. args["{Album}"] .. ")\n" .. args["{Title}"],
icon = "/tmp/mpdnotify_cover.png",
bg = "#060606",
timeout = 5,
replaces_id = old_id
}).id
end end
return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. coldef return gray .. args["{Artist}"] .. coldef .. white .. " " .. args["{Title}"] .. coldef
elseif (args["{state}"] == "Pause") then elseif (args["{state}"] == "Pause") then
@ -861,10 +869,7 @@ awful.rules.rules = {
properties = { floating = true } }, properties = { floating = true } },
{ rule = { class = "Dwb" }, { rule = { class = "Dwb" },
properties = { tag = tags[1][1], properties = { tag = tags[1][1] } },
x = 0, y = 20,
width = 1364,
height = 748 } },
{ rule = { class = "Gvim" }, { rule = { class = "Gvim" },
properties = { tag = tags[1][2] } }, properties = { tag = tags[1][2] } },

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View file

@ -3,16 +3,6 @@
# A simple notify script for now-playing songs on mpd. This script uses # A simple notify script for now-playing songs on mpd. This script uses
# notify-send and mpc to get the current song information. # notify-send and mpc to get the current song information.
# Requirements (* = optional)
# - mpd
# - mpc
# - notify-send (libnotify)
# * ImageMagick (convert)
# Author : Wolfgang Mueller
# You can use, edit and redistribute this script in any way you like.
# (Just make sure not to hurt any kittens)
# Configuration------------------------------------------------------- # Configuration-------------------------------------------------------
# The music directory that contains the music and cover files # The music directory that contains the music and cover files
@ -21,22 +11,9 @@ MUSIC_DIR="$HOME/Musica"
# The default cover to use (optional) # The default cover to use (optional)
DEFAULT_ART="" DEFAULT_ART=""
# The following track metadata delimiters can be changed.
# You can find all possible delimiters in the 'mpc' manpage.
# It's also possible to use pango markup like <u></u> and <i></i>
# How to format artist/album information
A_FORMAT="%artist%[ (%album%)] - %date%"
# How to format title information
T_FORMAT="%title%"
# Regex expression used for image search # Regex expression used for image search
IMG_REG="(front|cover|art|Folder|folder)\.(jpg|jpeg|png|gif)$" IMG_REG="(front|cover|art|Folder|folder)\.(jpg|jpeg|png|gif)$"
# Title of the notification
NOTIFY_TITLE="Now Playing"
# Path of temporary resized cover # Path of temporary resized cover
TEMP_PATH="/tmp/mpdnotify_cover.png" TEMP_PATH="/tmp/mpdnotify_cover.png"
@ -46,9 +23,6 @@ COVER_RESIZE="100x100"
# Thumbnail background (transparent by default) # Thumbnail background (transparent by default)
COVER_BACKGROUND="none" COVER_BACKGROUND="none"
# Logfile
LOGFILE="$HOME/.mpdnotify.log"
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# determine file # determine file
@ -57,12 +31,6 @@ file="$(mpc current -f %file%)"
# check if anything is playing at all # check if anything is playing at all
[[ -z $file ]] && exit 1 [[ -z $file ]] && exit 1
# Get title info
title="$(mpc current -f "$A_FORMAT")"
# Get song info
song="$(mpc current -f "$T_FORMAT")"
# Art directory # Art directory
art="$MUSIC_DIR/${file%/*}" art="$MUSIC_DIR/${file%/*}"
@ -75,14 +43,10 @@ cover="${cover:=$DEFAULT_ART}"
# check if art is available # check if art is available
if [[ -n $cover ]]; then if [[ -n $cover ]]; then
if [[ -n $COVER_RESIZE ]]; then if [[ -n $COVER_RESIZE ]]; then
convert "$cover" -thumbnail $COVER_RESIZE -gravity center \ convert "$cover" -thumbnail $COVER_RESIZE -gravity center -background "$COVER_BACKGROUND" -extent $COVER_RESIZE "$TEMP_PATH"
-background "$COVER_BACKGROUND" -extent $COVER_RESIZE "$TEMP_PATH" >> "$LOGFILE" 2>&1
cover="$TEMP_PATH" cover="$TEMP_PATH"
fi fi
notify-send -t 5000 --hint=int:transient:1 "$NOTIFY_TITLE" "$title\n$song" -i "$cover" >> "$LOGFILE" 2>&1
else
notify-send -t 5000 --hint=int:transient:1 "$NOTIFY_TITLE" "$title\n$song" >> "$LOGFILE" 2>&1
fi fi
exit 0

View file

@ -9,29 +9,30 @@
theme = {} theme = {}
themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/blackburn" themes_dir = os.getenv("HOME") .. "/.config/awesome/themes/blackburn"
themes_bg_normal = "png:" .. themes_dir .. "/taskbar/bg_normal.png"
themes_bg_focus = "png:" .. themes_dir .. "/taskbar/bg_focus.png"
theme.wallpaper = themes_dir .. "/wall.png" theme.wallpaper = themes_dir .. "/wall.png"
theme.font = "Tamsyn 10" theme.font = "Tamsyn 10"
theme.taglist_font = "Termsyn 10" theme.taglist_font = "Termsyn 10"
theme.fg_normal = "#AAAAAA" theme.fg_normal = "#AAAAAA"
theme.fg_focus = "#D79D38" theme.fg_focus = "#D79D38"
theme.bg_normal = themes_bg_normal
theme.bg_focus = "#060606"
theme.fg_urgent = "#CC9393" theme.fg_urgent = "#CC9393"
theme.bg_normal = "#000000" theme.bg_urgent = "#2A1F1E"
theme.bg_focus = "#000000"
theme.bg_urgent = "#2A1f1E"
theme.border_width = "1" theme.border_width = "1"
theme.border_normal = "#101010" theme.border_normal = "#0E0E0E"
theme.border_focus = "#606060" theme.border_focus = "#404040"
theme.border_marked = "#CC9393" theme.border_marked = "#CC9393"
theme.titlebar_bg_focus = "#FFFFFF" theme.titlebar_bg_focus = "#FFFFFF"
theme.titlebar_bg_normal = "#FFFFFF" theme.titlebar_bg_normal = "#FFFFFF"
theme.taglist_fg_focus = "#F6784F" theme.taglist_fg_focus = "#F6784F"
theme.tasklist_bg_focus = "#000000" theme.taglist_bg_focus = themes_bg_focus
theme.tasklist_fg_focus = "#F6784F" theme.tasklist_fg_focus = "#F6784F"
theme.tasklist_bg_focus = themes_bg_normal
theme.textbox_widget_margin_top = 1 theme.textbox_widget_margin_top = 1
theme.notify_fg = theme.fg_normal
theme.notify_bg = theme.bg_normal
theme.notify_border = theme.border_focus
theme.awful_widget_height = 14 theme.awful_widget_height = 14
theme.awful_widget_margin_top = 2 theme.awful_widget_margin_top = 2
theme.mouse_finder_color = "#CC9393" theme.mouse_finder_color = "#CC9393"
@ -54,6 +55,7 @@ theme.layout_max = themes_dir .. "/icons/max.png"
theme.layout_fullscreen = themes_dir .. "/icons/fullscreen.png" theme.layout_fullscreen = themes_dir .. "/icons/fullscreen.png"
theme.layout_magnifier = themes_dir .. "/icons/magnifier.png" theme.layout_magnifier = themes_dir .. "/icons/magnifier.png"
theme.layout_floating = themes_dir .. "/icons/floating.png" theme.layout_floating = themes_dir .. "/icons/floating.png"
theme.tasklist_floating = "" theme.tasklist_floating = ""
theme.tasklist_maximized_horizontal = "" theme.tasklist_maximized_horizontal = ""
theme.tasklist_maximized_vertical = "" theme.tasklist_maximized_vertical = ""