Merge branch 'work'
This commit is contained in:
58
i3/config
58
i3/config
@@ -92,6 +92,24 @@
|
||||
|
||||
set $kill Shift+Q
|
||||
|
||||
|
||||
################################################################################
|
||||
### WORKSPACE ASSIGNMENTS ######################################################
|
||||
################################################################################
|
||||
|
||||
workspace $workspace1 output HDMI3
|
||||
workspace $workspace2 output HDMI3
|
||||
workspace $workspace3 output HDMI2
|
||||
workspace $workspace4 output HDMI2
|
||||
workspace $workspace5 output HDMI2
|
||||
workspace $workspace6 output HDMI2
|
||||
workspace $workspace7 output LVDS1
|
||||
workspace $workspace8 output LVDS1
|
||||
workspace $workspace9 output LVDS1
|
||||
workspace $workspace10 output LVDS1
|
||||
|
||||
assign [class="^Keepassx$"] $workspace8
|
||||
|
||||
################################################################################
|
||||
### KEYBINDINGS ################################################################
|
||||
##################9#############################################################
|
||||
@@ -238,7 +256,7 @@
|
||||
floating_minimum_size 0 x 0
|
||||
floating_maximum_size 0 x 0
|
||||
|
||||
font pango:Insonsolata 9
|
||||
font pango:Inconsolata 10
|
||||
|
||||
################################################################################
|
||||
### COLOR SETTINGS #############################################################
|
||||
@@ -254,12 +272,6 @@ client.urgent #2f343a #900000 #ffffff #900000
|
||||
### APPLICATION SPECIFIC SETTINGS ##############################################
|
||||
################################################################################
|
||||
|
||||
assign [class="^Mumble$"] $workspace6
|
||||
assign [class="^TeamSpeak 3$"] $workspace6
|
||||
assign [class="^Clementine$"] $workspace7
|
||||
assign [class="^quassel$"] $workspace8
|
||||
assign [class="^Thunderbird$"] $workspace9
|
||||
assign [class="^Evolution$"] $workspace9
|
||||
|
||||
bindsym $mod+F6 exec --no-startup-id mumble
|
||||
bindsym $mod+F7 exec --no-startup-id clementine
|
||||
@@ -270,23 +282,35 @@ bindsym $mod+F9 exec --no-startup-id evolution
|
||||
### SPECIAL KEYBINDS ###########################################################
|
||||
################################################################################
|
||||
|
||||
#bindsym XF86Sleep exec --no-stratup-id dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause ; exec --no-startup-id $scriptdir/i3exit suspend
|
||||
bindsym XF86Sleep exec --no-startup-id $scriptdir/i3exit suspend
|
||||
bindsym XF86AudioMute exec --no-startup-id amixer set Master toggle ; exec --no-startup-id $update-status
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +5 ; exec --no-startup-id $scriptdir/update-status
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -5 ; exec --no-startup-id $scriptdir/update-status
|
||||
bindsym XF86AudioMute exec --no-startup-id $scriptdir/pa-volume mute-toggle ; exec --no-startup-id $update-status
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id $scriptdir/pa-volume set-vol +3 ; exec --no-startup-id $scriptdir/update-status
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id $scriptdir/pa-volume set-vol -3 ; exec --no-startup-id $scriptdir/update-status
|
||||
|
||||
bindsym XF86AudioPlay exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
|
||||
bindsym XF86AudioNext exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
|
||||
bindsym XF86AudioPrev exec dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous
|
||||
|
||||
# keys seemingly switched
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -dec 5 ; exec --no-startup-id $scriptdir/update-status
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -inc 5 ; exec --no-startup-id $scriptdir/update-status
|
||||
|
||||
bindsym XF86AudioPlay exec --no-startup-id mpc toggle
|
||||
bindsym XF86AudioPrev exec --no-startup-id mpc prev
|
||||
bindsym XF86AudioNext exec --no-startup-id mpc next
|
||||
|
||||
bindsym $mod+o exec --no-startup-id xautorandr ; exec --no-startup-id kill -SIGUSR2 $(cat $RUNDIR/wallchanger.$XDG_SESSION_ID.pid)'"
|
||||
bindsym $mod+p exec --no-startup-id kill -SIGUSR1 $(cat $RUNDIR/wallchanger.$XDG_SESSION_ID.pid)
|
||||
|
||||
################################################################################
|
||||
|
||||
|
||||
|
||||
exec --no-startup-id autostart
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
###############################################################################
|
||||
### BARS #######################################################################
|
||||
################################################################################
|
||||
#
|
||||
@@ -294,6 +318,8 @@ bar {
|
||||
mode dock
|
||||
position top
|
||||
|
||||
|
||||
#tray_output HDMI3
|
||||
tray_output primary
|
||||
tray_padding 3
|
||||
|
||||
@@ -305,7 +331,7 @@ bar {
|
||||
|
||||
id bar-0
|
||||
|
||||
font pango:Inconsolata, Icons 9
|
||||
font pango:DejaVu Sans, Icons 10
|
||||
|
||||
colors {
|
||||
background #222222
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
i3-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -i -p '>' -nb '#000000' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
|
||||
rofi -show run
|
||||
#j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -i -p '>' -nb '#000000' -nf '#ffffff' -sb '#e16b40' -sf '#000000'"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
_logfile="$LOGDIR/i3/i3exit.log"
|
||||
LOCKSCREEN="$LIBDIR/wallpaper/lockscreen"
|
||||
|
||||
_fallback_color=000000
|
||||
_fallback_color="000000"
|
||||
|
||||
touch "$_logfile"
|
||||
|
||||
@@ -17,6 +17,13 @@ log()
|
||||
|
||||
lock()
|
||||
{
|
||||
set -x
|
||||
playing=0
|
||||
if dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|grep -q Playing ; then
|
||||
playing=1
|
||||
fi
|
||||
echo $playing
|
||||
(( $playing )) && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause
|
||||
if [[ -f "$LOCKSCREEN" ]] ; then
|
||||
i3lock --nofork --show-failed-attempts --ignore-empty-password \
|
||||
--pointer win --image "$LOCKSCREEN"
|
||||
@@ -24,9 +31,13 @@ lock()
|
||||
i3lock --nofork --show-failed-attempts --ignore-empty-password \
|
||||
--color "$_fallback_color"
|
||||
fi
|
||||
screen_off
|
||||
wait
|
||||
(( $playing )) && dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play
|
||||
}
|
||||
|
||||
screen_off() {
|
||||
:
|
||||
xset dpms force off
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# name of the sink. execute pactl list sinks to get a list
|
||||
SINKNAME="alsa_output.pci-0000_00_1b.0.analog-stereo"
|
||||
SINKNAME="$(pactl info | grep '^Default Sink:' | cut -d ' ' -f 3-)"
|
||||
|
||||
SINKNAME="alsa_output.usb-Logitech_Logitech_Wireless_Headset_88C626354D45-00.analog-stereo"
|
||||
# this is the worst
|
||||
SINK=$(( $(pactl list sinks | grep "Name: " | grep -n "${SINKNAME}"$ | grep -o "^[[:digit:]]*") -1))
|
||||
|
||||
|
||||
getvol() {
|
||||
echo $(pactl list sinks | grep "^[[:space:]]*Volume" | head -n $(( $SINK + 1 )) | tail -n 1 | grep -o "[[:digit:]]*%" | head -n 1 | cut -d "%" -f 1)
|
||||
}
|
||||
@@ -49,15 +51,15 @@ ismuted() {
|
||||
}
|
||||
|
||||
mute() {
|
||||
pactl set-sink-mute $SINK 1
|
||||
pactl set-sink-mute $SINKNAME 1
|
||||
}
|
||||
|
||||
unmute() {
|
||||
pactl set-sink-mute $SINK 0
|
||||
pactl set-sink-mute $SINKNAME 0
|
||||
}
|
||||
|
||||
mute-toggle() {
|
||||
pactl set-sink-mute $SINK toggle
|
||||
pactl set-sink-mute $SINKNAME toggle
|
||||
}
|
||||
|
||||
status() {
|
||||
@@ -76,6 +78,10 @@ usage() {
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"sink")
|
||||
echo $SINKNAME
|
||||
echo $SINK
|
||||
;;
|
||||
"get-vol")
|
||||
echo $(getvol)
|
||||
;;
|
||||
|
||||
@@ -14,6 +14,6 @@ output=$(
|
||||
for option in "${options[@]}"; do
|
||||
echo "($i) $option"
|
||||
(( i++ ))
|
||||
done | dmenu -fn 'DejaVu Sans Mono:size=11' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000')
|
||||
done | dmenu -fn 'DejaVu Sans Mono:size=10' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000')
|
||||
|
||||
[[ "$output" ]] && "$(dirname "$0")"/i3exit "${output#(*) }"
|
||||
|
||||
20
i3/scripts/spotify-current
Executable file
20
i3/scripts/spotify-current
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
import dbus
|
||||
session_bus = dbus.SessionBus()
|
||||
spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify",
|
||||
"/org/mpris/MediaPlayer2")
|
||||
spotify_properties = dbus.Interface(spotify_bus,
|
||||
"org.freedesktop.DBus.Properties")
|
||||
metadata = spotify_properties.Get("org.mpris.MediaPlayer2.Player", "Metadata")
|
||||
|
||||
# The property Metadata behaves like a python dict
|
||||
# for key, value in metadata.items():
|
||||
# print(key, value)
|
||||
|
||||
# To just print the title
|
||||
print("{}: {} - [{}]".format(
|
||||
metadata['xesam:artist'][0],
|
||||
metadata['xesam:title'],
|
||||
metadata['xesam:album']
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user