diff options
-rwxr-xr-x | bspwm/.config/bspwm/bspwmrc | 5 | ||||
-rwxr-xr-x | polybar/.config/polybar/config | 18 | ||||
-rwxr-xr-x | polybar/.config/polybar/spotify.py | 123 | ||||
-rwxr-xr-x | sxhkd/.config/sxhkd/sxhkdrc | 4 | ||||
-rwxr-xr-x | x/.Xresources | 11 | ||||
-rwxr-xr-x | x/.xinitrc | 3 | ||||
-rwxr-xr-x | zsh/.zshrc | 2 |
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 | |||
10 | bspc config gapless_monocle true | 10 | bspc config gapless_monocle true |
11 | 11 | ||
12 | # rules | 12 | # rules |
13 | bspc rule -a Chromium desktop='^2' | 13 | bspc rule -a Brave-browser desktop='^2' |
14 | bspc rule -a Steam desktop='^6' | 14 | bspc rule -a Steam desktop='^6' |
15 | bspc rule -a "VirtualBox Manager" desktop='^6' | 15 | bspc rule -a "VirtualBox Manager" desktop='^6' |
16 | 16 | ||
@@ -18,7 +18,7 @@ bspc rule -a "VirtualBox Manager" desktop='^6' | |||
18 | xrdb -merge ~/.Xresources & | 18 | xrdb -merge ~/.Xresources & |
19 | xsetroot -cursor_name left_ptr & | 19 | xsetroot -cursor_name left_ptr & |
20 | sxhkd & | 20 | sxhkd & |
21 | #xss-lock -- slock & | 21 | xss-lock -- slock & |
22 | xset b off & | 22 | xset b off & |
23 | xset s 300 & | 23 | xset s 300 & |
24 | ~/.fehbg & | 24 | ~/.fehbg & |
@@ -26,3 +26,4 @@ urxvtd & | |||
26 | ~/.local/bin/bat_check.sh & | 26 | ~/.local/bin/bat_check.sh & |
27 | picom & | 27 | picom & |
28 | dunst & | 28 | dunst & |
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] |
2 | screenchange-reload = true | 2 | screenchange-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 | |||
31 | padding-right = 2 | 32 | padding-right = 2 |
32 | module-margin-left = 1.5 | 33 | module-margin-left = 1.5 |
33 | module-margin-right = 1.5 | 34 | module-margin-right = 1.5 |
34 | font-0 = Hermit:style=medium:size=9;1 | 35 | font-0 = JetBrains Mono Nerd Font Mono:style=medium:pixelsize=10:antialias=true:autohint=true:lcdfilter=lcddefault:rgba=rgb |
35 | modules-left = pulseaudio battery date time bspwm | 36 | modules-left = pulseaudio battery date time cmus |
36 | modules-center = | 37 | modules-center = |
37 | modules-right = cmus | 38 | modules-right = bspwm |
38 | tray-position = right | 39 | tray-position = right |
39 | cursor-click = pointer | 40 | cursor-click = pointer |
40 | cursor-scroll = ns-resize | 41 | cursor-scroll = ns-resize |
@@ -43,7 +44,6 @@ cursor-scroll = ns-resize | |||
43 | type = internal/xwindow | 44 | type = internal/xwindow |
44 | label = %title:0:20:...% | 45 | label = %title:0:20:...% |
45 | 46 | ||
46 | |||
47 | [module/bspwm] | 47 | [module/bspwm] |
48 | type = internal/bspwm | 48 | type = internal/bspwm |
49 | format = <label-state> <label-mode> | 49 | format = <label-state> <label-mode> |
@@ -122,7 +122,7 @@ battery = BAT0 | |||
122 | adapter = ADP1 | 122 | adapter = ADP1 |
123 | poll-interval = 1 | 123 | poll-interval = 1 |
124 | ;full-at = 98 | 124 | ;full-at = 98 |
125 | label-discharging = -bat %percentage%% | 125 | label-discharging = bat %percentage%% |
126 | label-charging = +bat %percentage%% | 126 | label-charging = +bat %percentage%% |
127 | label-full = ^bat %percentage%% | 127 | label-full = ^bat %percentage%% |
128 | format-discharging = <label-discharging> | 128 | format-discharging = <label-discharging> |
@@ -135,14 +135,6 @@ format-volume = vol <label-volume> | |||
135 | label-volume = %percentage%% | 135 | label-volume = %percentage%% |
136 | label-muted = muted | 136 | label-muted = muted |
137 | 137 | ||
138 | [module/spotify] | ||
139 | type = custom/script | ||
140 | interval = 1 | ||
141 | format-prefix = " " | ||
142 | format = <label> | ||
143 | format-foreground = #7b8c58 | ||
144 | exec = python ~/.config/polybar/spotify.py -f '{artist}: {song}' | ||
145 | |||
146 | [module/cmus] | 138 | [module/cmus] |
147 | type = custom/script | 139 | type = custom/script |
148 | exec = ~/.config/polybar/cmus.sh | 140 | exec = ~/.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 | |||
3 | import sys | ||
4 | import dbus | ||
5 | import argparse | ||
6 | |||
7 | |||
8 | parser = argparse.ArgumentParser() | ||
9 | parser.add_argument( | ||
10 | '-t', | ||
11 | '--trunclen', | ||
12 | type=int, | ||
13 | metavar='trunclen' | ||
14 | ) | ||
15 | parser.add_argument( | ||
16 | '-f', | ||
17 | '--format', | ||
18 | type=str, | ||
19 | metavar='custom format', | ||
20 | dest='custom_format' | ||
21 | ) | ||
22 | parser.add_argument( | ||
23 | '-p', | ||
24 | '--playpause', | ||
25 | type=str, | ||
26 | metavar='play-pause indicator', | ||
27 | dest='play_pause' | ||
28 | ) | ||
29 | parser.add_argument( | ||
30 | '--font', | ||
31 | type=str, | ||
32 | metavar='the index of the font to use for the main label', | ||
33 | dest='font' | ||
34 | ) | ||
35 | parser.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 | |||
43 | args = parser.parse_args() | ||
44 | |||
45 | def 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 | ||
53 | output = fix_string(u'{play_pause} {artist}: {song}') | ||
54 | trunclen = 25 | ||
55 | play_pause = fix_string(u'\u25B6,\u23F8') # first character is play, second is paused | ||
56 | |||
57 | label_with_font = '%{{T{font}}}{label}%{{T-}}' | ||
58 | font = args.font | ||
59 | play_pause_font = args.play_pause_font | ||
60 | |||
61 | # parameters can be overwritten by args | ||
62 | if args.trunclen is not None: | ||
63 | trunclen = args.trunclen | ||
64 | if args.custom_format is not None: | ||
65 | output = args.custom_format | ||
66 | if args.play_pause is not None: | ||
67 | play_pause = args.play_pause | ||
68 | |||
69 | try: | ||
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 | |||
118 | except 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 | |||
5 | super + @space | 5 | super + @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" |
7 | super + shift + w | 7 | super + shift + w |
8 | brave | 8 | /opt/brave/brave |
9 | control + alt + l | 9 | control + alt + l |
10 | xset s activate | 10 | xset s activate |
11 | super + shift + f | 11 | super + shift + f |
12 | urxvtc -e ranger | 12 | urxvtc -e lf |
13 | super + n | 13 | super + n |
14 | urxvtc -e nvim ~/.cache/bujo/todo.md | 14 | urxvtc -e nvim ~/.cache/bujo/todo.md |
15 | 15 | ||
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 | |||
58 | URxvt.url-launcher : chromium | 58 | URxvt.url-launcher : chromium |
59 | URxvt.matcher.button : 1 | 59 | URxvt.matcher.button : 1 |
60 | 60 | ||
61 | Xft.autohint: true | 61 | Xft.antialias: 1 |
62 | Xft.antialias: true | 62 | Xft.hinting: 1 |
63 | Xft.lcdfilter: lcddefault | 63 | Xft.autohint: 0 |
64 | Xft.rgba: rgb | 64 | Xft.hintstyle: hintslight |
65 | Xft.dpi: 96 | 65 | Xft.rgba: rgb |
66 | Xft.lcdfilter: lcddefault | ||
@@ -5,4 +5,5 @@ setxkbmap -layout us -option caps:ctrl_modifier & | |||
5 | xcape -e 'Caps_Lock=Escape' & | 5 | xcape -e 'Caps_Lock=Escape' & |
6 | # xrandr --setprovideroutputsource modesetting NVIDIA-0 | 6 | # xrandr --setprovideroutputsource modesetting NVIDIA-0 |
7 | # xrandr --auto | 7 | # xrandr --auto |
8 | exec bspwm | 8 | # exec dbus-launch --exit-with-session bspwm |
9 | exec dbus-run-session bspwm | ||
@@ -8,7 +8,7 @@ setopt appendhistory hist_ignore_all_dups hist_ignore_space | |||
8 | export VISUAL=nvim | 8 | export VISUAL=nvim |
9 | export EDITOR="$VISUAL" | 9 | export EDITOR="$VISUAL" |
10 | export BROWSER=brave | 10 | export BROWSER=brave |
11 | export PATH=$PATH:$HOME/.local/bin:$HOME/bin:/opt/brave | 11 | export PATH=$PATH:$HOME/.local/bin:$HOME/bin |
12 | export TERM=rxvt-unicode-256color | 12 | export TERM=rxvt-unicode-256color |
13 | export XDG_CURRENT_DESKTOP=bspwm | 13 | export XDG_CURRENT_DESKTOP=bspwm |
14 | 14 | ||