summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbspwm/.config/bspwm/bspwmrc5
-rwxr-xr-xpolybar/.config/polybar/config18
-rwxr-xr-xpolybar/.config/polybar/spotify.py123
-rwxr-xr-xsxhkd/.config/sxhkd/sxhkdrc4
-rwxr-xr-xx/.Xresources11
-rwxr-xr-xx/.xinitrc3
-rwxr-xr-xzsh/.zshrc2
7 files changed, 19 insertions, 147 deletions
diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc
index 6a4dc7d..d88582c 100755
--- a/bspwm/.config/bspwm/bspwmrc
+++ b/bspwm/.config/bspwm/bspwmrc
@@ -10,7 +10,7 @@ bspc config borderless_monocle true
10bspc config gapless_monocle true 10bspc config gapless_monocle true
11 11
12# rules 12# rules
13bspc rule -a Chromium desktop='^2' 13bspc rule -a Brave-browser desktop='^2'
14bspc rule -a Steam desktop='^6' 14bspc rule -a Steam desktop='^6'
15bspc rule -a "VirtualBox Manager" desktop='^6' 15bspc rule -a "VirtualBox Manager" desktop='^6'
16 16
@@ -18,7 +18,7 @@ bspc rule -a "VirtualBox Manager" desktop='^6'
18xrdb -merge ~/.Xresources & 18xrdb -merge ~/.Xresources &
19xsetroot -cursor_name left_ptr & 19xsetroot -cursor_name left_ptr &
20sxhkd & 20sxhkd &
21#xss-lock -- slock & 21xss-lock -- slock &
22xset b off & 22xset b off &
23xset s 300 & 23xset s 300 &
24~/.fehbg & 24~/.fehbg &
@@ -26,3 +26,4 @@ urxvtd &
26~/.local/bin/bat_check.sh & 26~/.local/bin/bat_check.sh &
27picom & 27picom &
28dunst & 28dunst &
29~/.config/polybar/launch.sh
diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config
index bb61b5a..82573d1 100755
--- a/polybar/.config/polybar/config
+++ b/polybar/.config/polybar/config
@@ -1,5 +1,6 @@
1[settings] 1[settings]
2screenchange-reload = true 2screenchange-reload = true
3# wm-restack = bspwm
3 4
4[colors] 5[colors]
5#background = ${xrdb:color0:#222} 6#background = ${xrdb:color0:#222}
@@ -31,10 +32,10 @@ padding-left = 2
31padding-right = 2 32padding-right = 2
32module-margin-left = 1.5 33module-margin-left = 1.5
33module-margin-right = 1.5 34module-margin-right = 1.5
34font-0 = Hermit:style=medium:size=9;1 35font-0 = JetBrains Mono Nerd Font Mono:style=medium:pixelsize=10:antialias=true:autohint=true:lcdfilter=lcddefault:rgba=rgb
35modules-left = pulseaudio battery date time bspwm 36modules-left = pulseaudio battery date time cmus
36modules-center = 37modules-center =
37modules-right = cmus 38modules-right = bspwm
38tray-position = right 39tray-position = right
39cursor-click = pointer 40cursor-click = pointer
40cursor-scroll = ns-resize 41cursor-scroll = ns-resize
@@ -43,7 +44,6 @@ cursor-scroll = ns-resize
43type = internal/xwindow 44type = internal/xwindow
44label = %title:0:20:...% 45label = %title:0:20:...%
45 46
46
47[module/bspwm] 47[module/bspwm]
48type = internal/bspwm 48type = internal/bspwm
49format = <label-state> <label-mode> 49format = <label-state> <label-mode>
@@ -122,7 +122,7 @@ battery = BAT0
122adapter = ADP1 122adapter = ADP1
123poll-interval = 1 123poll-interval = 1
124;full-at = 98 124;full-at = 98
125label-discharging = -bat %percentage%% 125label-discharging = bat %percentage%%
126label-charging = +bat %percentage%% 126label-charging = +bat %percentage%%
127label-full = ^bat %percentage%% 127label-full = ^bat %percentage%%
128format-discharging = <label-discharging> 128format-discharging = <label-discharging>
@@ -135,14 +135,6 @@ format-volume = vol <label-volume>
135label-volume = %percentage%% 135label-volume = %percentage%%
136label-muted = muted 136label-muted = muted
137 137
138[module/spotify]
139type = custom/script
140interval = 1
141format-prefix = " "
142format = <label>
143format-foreground = #7b8c58
144exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}'
145
146[module/cmus] 138[module/cmus]
147type = custom/script 139type = custom/script
148exec = ~/.config/polybar/cmus.sh 140exec = ~/.config/polybar/cmus.sh
diff --git a/polybar/.config/polybar/spotify.py b/polybar/.config/polybar/spotify.py
deleted file mode 100755
index aae6d81..0000000
--- a/polybar/.config/polybar/spotify.py
+++ /dev/null
@@ -1,123 +0,0 @@
1#!/bin/python
2
3import sys
4import dbus
5import argparse
6
7
8parser = argparse.ArgumentParser()
9parser.add_argument(
10 '-t',
11 '--trunclen',
12 type=int,
13 metavar='trunclen'
14)
15parser.add_argument(
16 '-f',
17 '--format',
18 type=str,
19 metavar='custom format',
20 dest='custom_format'
21)
22parser.add_argument(
23 '-p',
24 '--playpause',
25 type=str,
26 metavar='play-pause indicator',
27 dest='play_pause'
28)
29parser.add_argument(
30 '--font',
31 type=str,
32 metavar='the index of the font to use for the main label',
33 dest='font'
34)
35parser.add_argument(
36 '--playpause-font',
37 type=str,
38 metavar='the index of the font to use to display the playpause indicator',
39 dest='play_pause_font'
40)
41
42
43args = parser.parse_args()
44
45def fix_string(string):
46 # corrects encoding for the python version used
47 if sys.version_info.major == 3:
48 return string
49 else:
50 return string.encode('utf-8')
51
52# Default parameters
53output = fix_string(u'{play_pause} {artist}: {song}')
54trunclen = 25
55play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused
56
57label_with_font = '%{{T{font}}}{label}%{{T-}}'
58font = args.font
59play_pause_font = args.play_pause_font
60
61# parameters can be overwritten by args
62if args.trunclen is not None:
63 trunclen = args.trunclen
64if args.custom_format is not None:
65 output = args.custom_format
66if args.play_pause is not None:
67 play_pause = args.play_pause
68
69try:
70 session_bus = dbus.SessionBus()
71 spotify_bus = session_bus.get_object(
72 'org.mpris.MediaPlayer2.spotify',
73 '/org/mpris/MediaPlayer2'
74 )
75
76 spotify_properties = dbus.Interface(
77 spotify_bus,
78 'org.freedesktop.DBus.Properties'
79 )
80
81 metadata = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'Metadata')
82 status = spotify_properties.Get('org.mpris.MediaPlayer2.Player', 'PlaybackStatus')
83
84 # Handle play/pause label
85
86 play_pause = play_pause.split(',')
87
88 if status == 'Playing':
89 play_pause = play_pause[0]
90 elif status == 'Paused':
91 play_pause = play_pause[1]
92 else:
93 play_pause = str()
94
95 if play_pause_font:
96 play_pause = label_with_font.format(font=play_pause_font, label=play_pause)
97
98 # Handle main label
99
100 artist = fix_string(metadata['xesam:artist'][0]) if metadata['xesam:artist'] else ''
101 song = fix_string(metadata['xesam:title']) if metadata['xesam:title'] else ''
102
103 if not artist and not song:
104 print('')
105 else:
106 if len(song) > trunclen:
107 song = song[0:trunclen]
108 song += '...'
109 if ('(' in song) and (')' not in song):
110 song += ')'
111
112 if font:
113 artist = label_with_font.format(font=font, label=artist)
114 song = label_with_font.format(font=font, label=song)
115
116 print(output.format(artist=artist, song=song, play_pause=play_pause))
117
118except Exception as e:
119 if isinstance(e, dbus.exceptions.DBusException):
120 print('')
121 else:
122 print(e)
123
diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc
index 1b03a08..11088b8 100755
--- a/sxhkd/.config/sxhkd/sxhkdrc
+++ b/sxhkd/.config/sxhkd/sxhkdrc
@@ -5,11 +5,11 @@ super + shift + Return
5super + @space 5super + @space
6 dmenu_run -i -fn "JetBrains Mono Nerd Font Mono:style=medium:pixelsize=12.5" -nb "#f3f4f5" -nf "#2f2f2f" -sb "#626868" -sf "#ffffff" 6 dmenu_run -i -fn "JetBrains Mono Nerd Font Mono:style=medium:pixelsize=12.5" -nb "#f3f4f5" -nf "#2f2f2f" -sb "#626868" -sf "#ffffff"
7super + shift + w 7super + shift + w
8 brave 8 /opt/brave/brave
9control + alt + l 9control + alt + l
10 xset s activate 10 xset s activate
11super + shift + f 11super + shift + f
12 urxvtc -e ranger 12 urxvtc -e lf
13super + n 13super + n
14 urxvtc -e nvim ~/.cache/bujo/todo.md 14 urxvtc -e nvim ~/.cache/bujo/todo.md
15Print 15Print
diff --git a/x/.Xresources b/x/.Xresources
index 644860b..96e845e 100755
--- a/x/.Xresources
+++ b/x/.Xresources
@@ -58,8 +58,9 @@ URxvt.font-size.step: 1
58URxvt.url-launcher : chromium 58URxvt.url-launcher : chromium
59URxvt.matcher.button : 1 59URxvt.matcher.button : 1
60 60
61Xft.autohint: true 61Xft.antialias: 1
62Xft.antialias: true 62Xft.hinting: 1
63Xft.lcdfilter: lcddefault 63Xft.autohint: 0
64Xft.rgba: rgb 64Xft.hintstyle: hintslight
65Xft.dpi: 96 65Xft.rgba: rgb
66Xft.lcdfilter: lcddefault
diff --git a/x/.xinitrc b/x/.xinitrc
index bf7bf3c..7d24b5e 100755
--- a/x/.xinitrc
+++ b/x/.xinitrc
@@ -5,4 +5,5 @@ setxkbmap -layout us -option caps:ctrl_modifier &
5xcape -e 'Caps_Lock=Escape' & 5xcape -e 'Caps_Lock=Escape' &
6# xrandr --setprovideroutputsource modesetting NVIDIA-0 6# xrandr --setprovideroutputsource modesetting NVIDIA-0
7# xrandr --auto 7# xrandr --auto
8exec bspwm 8# exec dbus-launch --exit-with-session bspwm
9exec dbus-run-session bspwm
diff --git a/zsh/.zshrc b/zsh/.zshrc
index 39fd7bf..0765b0d 100755
--- a/zsh/.zshrc
+++ b/zsh/.zshrc
@@ -8,7 +8,7 @@ setopt appendhistory hist_ignore_all_dups hist_ignore_space
8export VISUAL=nvim 8export VISUAL=nvim
9export EDITOR="$VISUAL" 9export EDITOR="$VISUAL"
10export BROWSER=brave 10export BROWSER=brave
11export PATH=$PATH:$HOME/.local/bin:$HOME/bin:/opt/brave 11export PATH=$PATH:$HOME/.local/bin:$HOME/bin
12export TERM=rxvt-unicode-256color 12export TERM=rxvt-unicode-256color
13export XDG_CURRENT_DESKTOP=bspwm 13export XDG_CURRENT_DESKTOP=bspwm
14 14