work
This commit is contained in:
70
i3/i3/config
70
i3/i3/config
@@ -38,15 +38,15 @@
|
||||
set $signal_reboot reboot
|
||||
set $signal_shutdown shutdown
|
||||
|
||||
set $workspace1 1:web
|
||||
set $workspace1 1
|
||||
set $workspace2 2
|
||||
set $workspace3 3
|
||||
set $workspace4 4
|
||||
set $workspace5 5
|
||||
set $workspace6 6:voip
|
||||
set $workspace7 7:music
|
||||
set $workspace8 8:irc
|
||||
set $workspace9 9:mail
|
||||
set $workspace6 6
|
||||
set $workspace7 7
|
||||
set $workspace8 8
|
||||
set $workspace9 9
|
||||
set $workspace10 10
|
||||
|
||||
set $key_workspace1 1
|
||||
@@ -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,9 +256,7 @@
|
||||
floating_minimum_size 0 x 0
|
||||
floating_maximum_size 0 x 0
|
||||
|
||||
smart_borders on
|
||||
|
||||
font pango:Insonsolata 11
|
||||
font pango:Inconsolata 10
|
||||
|
||||
################################################################################
|
||||
### COLOR SETTINGS #############################################################
|
||||
@@ -256,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
|
||||
@@ -272,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 #######################################################################
|
||||
################################################################################
|
||||
#
|
||||
@@ -296,6 +318,8 @@ bar {
|
||||
mode dock
|
||||
position top
|
||||
|
||||
|
||||
#tray_output HDMI3
|
||||
tray_output primary
|
||||
tray_padding 3
|
||||
|
||||
@@ -307,7 +331,7 @@ bar {
|
||||
|
||||
id bar-0
|
||||
|
||||
font pango:DejaVu Sans, Icons 11
|
||||
font pango:DejaVu Sans, Icons 10
|
||||
|
||||
colors {
|
||||
background #222222
|
||||
|
||||
@@ -1,28 +1,15 @@
|
||||
separator_block_width=33
|
||||
|
||||
[vpn-main]
|
||||
command=$HOME/.i3/scripts/openvpn main
|
||||
label=
|
||||
interval=5
|
||||
#[spotify]
|
||||
#command=$HOME/.i3/scripts/spotify-current
|
||||
#interval=1
|
||||
|
||||
[vpn-mgmt]
|
||||
command=$HOME/.i3/scripts/openvpn mgmt
|
||||
label=
|
||||
interval=5
|
||||
|
||||
[wifi]
|
||||
command=$HOME/.i3/scripts/wifi
|
||||
label=
|
||||
interval=30
|
||||
|
||||
[network]
|
||||
command=BLOCK_INSTANCE=wlp2s0 /usr/lib/i3blocks/iface
|
||||
label=
|
||||
interval=5
|
||||
# [wifi]
|
||||
# command=$HOME/.i3/scripts/wifi
|
||||
# interval=30
|
||||
|
||||
[load]
|
||||
command=$HOME/.i3/scripts/load
|
||||
label=
|
||||
interval=30
|
||||
|
||||
[volume]
|
||||
@@ -43,7 +30,7 @@ interval=once
|
||||
|
||||
[time]
|
||||
label=
|
||||
command=date "+%a %d.%m %H:%M"
|
||||
command=date "+[KW%V] %A %d.%m.%Y %H:%M:%S"
|
||||
interval=1
|
||||
separator=false
|
||||
separator_block_width=12
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
j4-dmenu-desktop --dmenu="dmenu -fn 'DejaVu Sans:size=11' -h 24 -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'"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
_logfile="$LOGDIR/i3/i3exit.log"
|
||||
|
||||
_fallback_color=000000
|
||||
_fallback_color="000000"
|
||||
|
||||
touch "$_logfile"
|
||||
|
||||
@@ -16,14 +16,25 @@ log()
|
||||
|
||||
lock()
|
||||
{
|
||||
if [[ "$LOCKSCREEN" ]] ; then
|
||||
i3lock --show-failed-attempts --image "$LOCKSCREEN"
|
||||
else
|
||||
i3lock --show-failed-attempts --color "$_fallback_color"
|
||||
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 [[ "$LOCKSCREEN" ]] ; then
|
||||
i3lock --nofork --show-failed-attempts --image "$LOCKSCREEN" &
|
||||
else
|
||||
i3lock --nofork --show-failed-attempts --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
|
||||
}
|
||||
|
||||
@@ -33,7 +44,7 @@ log "[I] Received signal \"$signal\"."
|
||||
case "$signal" in
|
||||
lock)
|
||||
log "[I] Locking session."
|
||||
lock && screen_off
|
||||
lock
|
||||
;;
|
||||
logout)
|
||||
log "[I] Exiting i3."
|
||||
|
||||
@@ -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' -w 200 -name 'shutdown-menu')
|
||||
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/i3/scripts/spotify-current
Executable file
20
i3/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