Merge branch 'common'
This commit is contained in:
45
i3/config
45
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#############################################################
|
||||
@@ -174,12 +192,16 @@
|
||||
|
||||
bindsym $mod+d exec --no-startup-id ~/.i3/scripts/appmenu
|
||||
bindsym $mod+Return exec $terminal
|
||||
bindsym $mod+F1 exec firefox
|
||||
|
||||
bindsym Print exec --no-startup-id ~/.i3/scripts/shutdown-menu
|
||||
bindsym F1 exec --no-startup-id ~/.i3/scripts/shutdown-menu
|
||||
bindsym $mod+F1 exec --no-startup-id ~/.i3/scripts/i3exit lock
|
||||
bindsym $mod+Home exec --no-startup-id ~/.i3/scripts/shutdown-menu
|
||||
|
||||
bindsym $mod+Shift+v exec --no-startup-id redshift-toggle
|
||||
|
||||
bindsync $mod+Shift+$scratchpad move scratchpad
|
||||
bindsync $mod+$scratchpad scratchpad show
|
||||
|
||||
################################################################################
|
||||
### MODES ######################################################################
|
||||
################################################################################
|
||||
@@ -238,7 +260,7 @@
|
||||
floating_minimum_size 0 x 0
|
||||
floating_maximum_size 0 x 0
|
||||
|
||||
font pango:Insonsolata 9
|
||||
font pango:Inconsolata 10
|
||||
|
||||
################################################################################
|
||||
### COLOR SETTINGS #############################################################
|
||||
@@ -280,7 +302,18 @@ bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -inc 5 ; exec --no
|
||||
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 #######################################################################
|
||||
################################################################################
|
||||
#
|
||||
@@ -288,6 +321,8 @@ bar {
|
||||
mode dock
|
||||
position top
|
||||
|
||||
|
||||
#tray_output HDMI3
|
||||
tray_output primary
|
||||
tray_padding 3
|
||||
|
||||
@@ -299,7 +334,7 @@ bar {
|
||||
|
||||
id bar-0
|
||||
|
||||
font pango:Inconsolata, Icons 9
|
||||
font pango:Inconsolata, FontAwesome 10
|
||||
|
||||
colors {
|
||||
background #222222
|
||||
|
||||
@@ -50,9 +50,9 @@ wifi {
|
||||
|
||||
spotify {
|
||||
format = " {title} - {artist} "
|
||||
format_down = " off "
|
||||
cache_timeout = 1
|
||||
color_offline = '#FFFFFF'
|
||||
format_down = "no Spotify"
|
||||
}
|
||||
|
||||
online_status {
|
||||
@@ -60,7 +60,6 @@ online_status {
|
||||
}
|
||||
|
||||
volume_status {
|
||||
device = "12"
|
||||
cache_timeout = 10
|
||||
format = " {percentage}% "
|
||||
format_muted = " mute "
|
||||
|
||||
@@ -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'"
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -80,6 +82,10 @@ update_status_bar() {
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"sink")
|
||||
echo $SINKNAME
|
||||
echo $SINK
|
||||
;;
|
||||
"get-vol")
|
||||
echo $(getvol)
|
||||
;;
|
||||
@@ -111,5 +117,4 @@ case "$1" in
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -14,6 +14,6 @@ output=$(
|
||||
for option in "${options[@]}"; do
|
||||
echo "($i) $option"
|
||||
(( i++ ))
|
||||
done | dmenu -fn 'Inconsolata:size=9' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000')
|
||||
done | dmenu -fn 'Inconsolata:size=10' -b -i -l 10 -p '>' -nb '#222222' -nf '#ffffff' -sb '#e16b40' -sf '#000000')
|
||||
|
||||
[[ "$output" ]] && "$(dirname "$0")"/i3exit "${output#(*) }"
|
||||
|
||||
@@ -17,3 +17,4 @@ previous)
|
||||
esac
|
||||
|
||||
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player."${cmd}"
|
||||
~/.i3/scripts/bar-update spotify
|
||||
|
||||
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