Skip to content

Commit

Permalink
use xfce4-notifyd instead of dunst
Browse files Browse the repository at this point in the history
  • Loading branch information
kovetskiy committed Jul 3, 2020
1 parent 69a17eb commit 31d0235
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 40 deletions.
1 change: 1 addition & 0 deletions .symlinks
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ bin
.Xresources.office
.yaourtrc
.zshrc
.themes/op/xfce-notify-4.0
49 changes: 49 additions & 0 deletions .themes/op/xfce-notify-4.0/gtk.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#XfceNotifyWindow {
font-family: "Ubuntu Mono";
}

#XfceNotifyWindow {
background-color: shade(#686868, 0.3);
color: #fcfcfc;
border: 1px solid shade(#686868, 0.6);
border-radius: 6px;
}

#XfceNotifyWindow button {
background-image: none;
background-color: shade(#686868, 0.3);
color: #fcfcfc;
border-color: shade(#fcfcfc, 0.35);
border-radius: 3px;
}

#XfceNotifyWindow button:hover {
background-color: shade(#686868, 0.4);
border-color: shade(#fcfcfc, 0.45);
}

#XfceNotifyWindow label#summary {
font-weight: bold;
}

#XfceNotifyWindow progressbar {
min-height: 6px;
border-radius: 3px;
}

#XfceNotifyWindow progressbar progress {
background-image: none;
background-color: #fcfcfc;
border: none;
box-shadow: none;
}

#XfceNotifyWindow progressbar trough {
background-image: linear-gradient(to bottom,
shade(#686868, 0.65),
shade(#686868, 1.25)
);
border: 1px solid shade(#686868, 0.2);
border-radius: 3px;
padding: 1px 0;
}
62 changes: 62 additions & 0 deletions .themes/op/xfce-notify-4.0/gtkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
style "notify-window"
{
XfceNotifyWindow::summary-bold = 1
XfceNotifyWindow::border-color = "#ffffff"
XfceNotifyWindow::border-color-hover = "#ffffff"
XfceNotifyWindow::border-radius = 10.0
XfceNotifyWindow::border-width = 0.1
XfceNotifyWindow::border-width-hover = 0.1
bg[NORMAL] = "#111"
}

style "notify-button"
{
bg[NORMAL] = "#202020"
bg[PRELIGHT] = "#303030"
bg[ACTIVE] = "#222222"
fg[NORMAL] = "#ffffff"
fg[PRELIGHT] = "#ffffff"
engine "murrine" {
border_shades = { 2.9, 2.6 }
shadow_shades = {2.4,2.4}
roundness = 4
}
}

style "notify-text"
{
fg[NORMAL] = "#ffffff"
fg[PRELIGHT] = "#ffffff"
GtkWidget::link-color = "#a7a7a7"
}

style "notify-summary"
{
font_name = "Bold"
}

style "notify-progressbar"
{
GtkProgressBar::min-horizontal-bar-height = 4
xthickness = 0
ythickness = 0

fg[PRELIGHT] = "#000000"
bg[NORMAL] = "#fefefe"
bg[SELECTED] = "#fefefe"
bg[ACTIVE] = "#696969"

engine "murrine" {
gradient_shades = { 1.0, 1.0, 1.0, 1.0 }
contrast = 0.5
border_shades = { 0.9, 0.9 }
progressbarstyle = 0
}
}

class "XfceNotifyWindow" style "notify-window"
widget "XfceNotifyWindow.*.summary" style "notify-summary"
widget_class "XfceNotifyWindow.*<GtkButton>" style "notify-button"
widget_class "XfceNotifyWindow.*.<GtkLabel>" style "notify-text"
widget_class "XfceNotifyWindow.*.<GtkProgress>" style "notify-progressbar"
widget_class "XfceNotifyWindow.*.<GtkProgressBar>" style "notify-progressbar"
2 changes: 1 addition & 1 deletion bin/chrome-profile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ fi
dir=~/.config/chrome-${profile}/
mkdir -p $dir

exec chromium --user-data-dir=$dir
exec firefox --profile $dir
4 changes: 2 additions & 2 deletions bin/dotfileit
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set -euo pipefail
fi

if [[ "$action" == "mv" ]]; then
install -DT "$target" "$dotfile"
rsync -av "$target" "$dotfile"
ask_rm=true
fi

Expand All @@ -39,7 +39,7 @@ set -euo pipefail
fi
else
echo ":: copying to dotfiles: $relative"
install -DT "$target" "$dotfile"
rsync -av "$target" "$dotfile"

ask_rm=true
fi
Expand Down
46 changes: 9 additions & 37 deletions bin/infobar
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

colorscheme=1

notify_id=""
:notify() {
notify-send.sh -r 1000 -t 1000 " " -- "$*"
arg=""
if [[ "$notify_id" ]]; then
arg="-r $notify_id"
fi

notify_id=$(notify-desktop $arg -t 1000 "INFORMATION" -- "$*")
}

:body-append() {
Expand All @@ -23,25 +29,13 @@ colorscheme=1
#printf '%-8s %s\n' "$section" "$content"

local token=(${section})
local section=$(
:span "${token[0]}" "$(printf '<b>%-8s</b>' "$section")"
)
local section=$(printf '<b>%-8s</b>' "$section")

append="$section $content"

body="${body}$append"
}

:span() {
local token="$1"
local content="$2"

local bg=$(:color "${token}" 0 $colorscheme)
local fg=$(:color "${token}" 1 $colorscheme)

:span-bg-fg "$bg" "$fg" "$content"
}

:span-bg-fg() {
local bg=$1
local fg=$2
Expand Down Expand Up @@ -111,9 +105,7 @@ colorscheme=1

:get-section-wifi() {
local wifi=$(wifi)
if [[ "$wifi" ]]; then
:span "$wifi" "$wifi"
fi
echo "$wifi"
}

:get-section-vpn() {
Expand All @@ -132,26 +124,6 @@ colorscheme=1
fi
}

:color() {
local text="$1"
local query="$(md5sum <<<"$text" | awk '{print $1}')"
local color="${2:-0}"
local scheme="${3:-0}"

# based upon http://jimlund.org/blog/pics/colortest_iTerm.png
local lookback=$((($color * 2) % (6 * 6)))
local seed=$((0x${query:1:2} + $scheme))
local base=$((16 + ($seed % (230 - 16))))
local block=$((($base - 16) / 6))
local index=$((($base - 16) % 6))
local next=$((((\
$block >= $lookback) ? (\
$block - $lookback) : (\
6 * 6 - $lookback + $block)) * \
6 + 16 + $index + 2))

color-to-hex "$next"
}

_bg=""
:body-save() {
Expand Down

0 comments on commit 31d0235

Please sign in to comment.