├── README.md ├── alacritty.yml ├── autostarts ├── autostart.sh ├── autostart_blocking.sh └── dwmrc ├── dunst └── dunstrc ├── dwm ├── LICENSE ├── Makefile ├── README ├── config.def.h ├── config.h ├── config.mk ├── drw.c ├── drw.h ├── drw.o ├── dwm ├── dwm.1 ├── dwm.c ├── dwm.o ├── dwm.png ├── patches │ ├── drw-patch-6.2.diff │ ├── dwm-activetagindicatorbar-6.2.diff │ ├── dwm-alpha-20180613-b69c870.diff │ ├── dwm-autostart-20200610-cb3f58a.diff │ ├── dwm-bar-height-6.2.diff │ ├── dwm-barpadding-6.2.diff │ ├── dwm-colorbar-6.2.diff │ ├── dwm-cropwindows-20170709-ceac8c9.diff │ ├── dwm-fullgaps-6.2.diff │ ├── dwm-hide_vacant_tags-6.2.diff │ └── dwm-removeborder-20200520-f09418b.diff ├── transient.c ├── util.c ├── util.h └── util.o ├── myscripts ├── bar │ ├── dwm_battery.sh │ ├── dwm_date.sh │ ├── dwm_inhibitor.sh │ └── dwm_networkmanager.sh ├── deactivate_inhibitor.sh ├── inhibitor.sh └── lock.sh ├── rofi-spotlight ├── LICENSE ├── README.md ├── history.txt ├── icons │ ├── ddg.svg │ ├── google.svg │ ├── history.svg │ └── result.svg ├── rofi-spotlight.sh ├── rofi.rasi └── web-search.py ├── screenshots ├── image.png └── imgonline-com-ua-twotoone-byNO7a5jIbXGHq.jpg ├── vimrc ├── wallpaper └── nordnight.jpg └── zshrc /README.md: -------------------------------------------------------------------------------- 1 | # dotfiles 2 | My DWM configs 3 |

The above are my DWM configs.

4 |

Installation

5 | Copy the files to their respective places, edit the `config.h` file to suit your needs. 6 |

EDIT ALL `.sh` FILES TO SUIT YOUR PATHS ELSE STUFF WILL NOT WORK.

7 | For Firefox theme, get the blurredfox theme. 8 | For rofi configs, get rofi menu. 9 | The bar script is from the following repo:https://github.com/joestandring/dwm-bar
10 |

Note: Any mentions of foo.sh or unfoo.sh refer to the idle inhibiting function (which is just a neat trick which presses the Left Shift key every 30 seconds to prevent screen locking when watching a video, attending a meeting and such.) Please change the occurences of the names foo.sh and unfoo.sh to inhibitor.sh and deactivate_inhibitor.sh in the dwm config file. The scripts are in the myscripts directory above.

11 | (All credits go to him and I take NO credit on the scripts except 'improving' the battery script.)
12 | The fonts I recommend are: 13 | 20 | 21 | -------------------------------------------------------------------------------- /alacritty.yml: -------------------------------------------------------------------------------- 1 | #Alacritty: 2 | 3 | env: 4 | TERM: alacritty 5 | 6 | window: 7 | padding: 8 | x: 9 9 | y: 4 10 | 11 | dynamic_padding: true 12 | decoration: none 13 | 14 | font: 15 | normal: 16 | family: Fira Code 17 | 18 | bold: 19 | family: Fira Code 20 | 21 | italic: 22 | family: Fira Code 23 | 24 | bold_italic: 25 | family: Fira Code 26 | 27 | size: 9 28 | 29 | # colors: 30 | # # Default colors 31 | # primary: 32 | # background: '0x0c0e17' 33 | # foreground: '0xc9cbda' 34 | 35 | # # Normal colors 36 | # normal: 37 | # black: '0x151723' 38 | # red: '0x1d1f2f' 39 | # green: '0x2d3046' 40 | # yellow: '0x434764' 41 | # blue: '0x5e648b' 42 | # magenta: '0x8388ab' 43 | # cyan: '0xafb2c9' 44 | # white: '0xe1e2ea' 45 | 46 | # # Bright colors 47 | # bright: 48 | # black: '0xce98c0' 49 | # red: '0xca89b9' 50 | # green: '0xb86da6' 51 | # yellow: '0xb8b377' 52 | # blue: '0x76ca95' 53 | # magenta: '0xd565bc' 54 | # cyan: '0xbeb878' 55 | # white: '0x5fa479' 56 | colors: 57 | primary: 58 | # background: '#2e3440' 59 | # foreground: '#d8dee9' 60 | background: '0x0c0e17' 61 | foreground: '0xc9cbda' 62 | dim_foreground: '#a5abb6' 63 | cursor: 64 | text: '#2e3440' 65 | cursor: '#d8dee9' 66 | vi_mode_cursor: 67 | text: '#2e3440' 68 | cursor: '#d8dee9' 69 | selection: 70 | # text: CellForeground 71 | background: '#4c566a' 72 | search: 73 | matches: 74 | # foreground: CellBackground 75 | background: '#88c0d0' 76 | bar: 77 | background: '#434c5e' 78 | foreground: '#d8dee9' 79 | normal: 80 | black: '#3b4252' 81 | red: '#bf616a' 82 | green: '#a3be8c' 83 | yellow: '#ebcb8b' 84 | blue: '#81a1c1' 85 | magenta: '#b48ead' 86 | cyan: '#88c0d0' 87 | white: '#e5e9f0' 88 | bright: 89 | black: '#4c566a' 90 | red: '#bf616a' 91 | green: '#a3be8c' 92 | yellow: '#ebcb8b' 93 | blue: '#81a1c1' 94 | magenta: '#b48ead' 95 | cyan: '#8fbcbb' 96 | white: '#eceff4' 97 | dim: 98 | black: '#373e4d' 99 | red: '#94545d' 100 | green: '#809575' 101 | yellow: '#b29e75' 102 | blue: '#68809a' 103 | magenta: '#8c738c' 104 | cyan: '#6d96a5' 105 | white: '#aeb3bb' 106 | 107 | 108 | 109 | background_opacity: 1 110 | 111 | # cursor: 112 | # style: Underline 113 | 114 | # unfocused_hollow: false 115 | 116 | live_config_reload: true 117 | 118 | 119 | key_bindings: 120 | 121 | - { key: Key0, mods: Control, action: ResetFontSize } 122 | 123 | - { key: Equals, mods: Control, action: IncreaseFontSize } 124 | 125 | - { key: Add, mods: Control, action: IncreaseFontSize } 126 | 127 | - { key: Subtract, mods: Control, action: DecreaseFontSize } 128 | 129 | - { key: Minus, mods: Control, action: DecreaseFontSize } 130 | -------------------------------------------------------------------------------- /autostarts/autostart.sh: -------------------------------------------------------------------------------- 1 | exec feh --bg-scale /home/axarva/wallpapers/nordnight.jpg & 2 | picom -f & 3 | flameshot & 4 | dunst & 5 | exec /home/axarva/dwm/dwm-bar/dwm_bar.sh & 6 | exec /home/axarva/bin/lock.sh & 7 | exec /usr/libexec/polkit-gnome-authentication-agent-1 & 8 | exec greenclip daemon 9 | -------------------------------------------------------------------------------- /autostarts/autostart_blocking.sh: -------------------------------------------------------------------------------- 1 | exec /home/axarva/dwm-bar/dwm_bar.sh & 2 | -------------------------------------------------------------------------------- /autostarts/dwmrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/autostarts/dwmrc -------------------------------------------------------------------------------- /dunst/dunstrc: -------------------------------------------------------------------------------- 1 | [global] 2 | ### Display ### 3 | 4 | # Which monitor should the notifications be displayed on. 5 | monitor = 0 6 | 7 | # Display notification on focused monitor. Possible modes are: 8 | # mouse: follow mouse pointer 9 | # keyboard: follow window with keyboard focus 10 | # none: don't follow anything 11 | # 12 | # "keyboard" needs a window manager that exports the 13 | # _NET_ACTIVE_WINDOW property. 14 | # This should be the case for almost all modern window managers. 15 | # 16 | # If this option is set to mouse or keyboard, the monitor option 17 | # will be ignored. 18 | follow = mouse 19 | 20 | # The geometry of the window: 21 | # [{width}]x{height}[+/-{x}+/-{y}] 22 | # The geometry of the message window. 23 | # The height is measured in number of notifications everything else 24 | # in pixels. If the width is omitted but the height is given 25 | # ("-geometry x2"), the message window expands over the whole screen 26 | # (dmenu-like). If width is 0, the window expands to the longest 27 | # message displayed. A positive x is measured from the left, a 28 | # negative from the right side of the screen. Y is measured from 29 | # the top and down respectively. 30 | # The width can be negative. In this case the actual width is the 31 | # screen width minus the width defined in within the geometry option. 32 | geometry = "300x5-20+40" 33 | 34 | # Show how many messages are currently hidden (because of geometry). 35 | indicate_hidden = yes 36 | 37 | # Shrink window if it's smaller than the width. Will be ignored if 38 | # width is 0. 39 | shrink = no 40 | 41 | # The transparency of the window. Range: [0; 100]. 42 | # This option will only work if a compositing window manager is 43 | # present (e.g. xcompmgr, compiz, etc.). 44 | transparency = 10 45 | 46 | # The height of the entire notification. If the height is smaller 47 | # than the font height and padding combined, it will be raised 48 | # to the font height and padding. 49 | notification_height = 0 50 | 51 | # Draw a line of "separator_height" pixel height between two 52 | # notifications. 53 | # Set to 0 to disable. 54 | separator_height = 2 55 | 56 | # Padding between text and separator. 57 | padding = 8 58 | 59 | # Horizontal padding. 60 | horizontal_padding = 8 61 | 62 | # Defines width in pixels of frame around the notification window. 63 | # Set to 0 to disable. 64 | frame_width = 3 65 | 66 | # Defines color of the frame around the notification window. 67 | frame_color = "#aaaaaa" 68 | 69 | # Define a color for the separator. 70 | # possible values are: 71 | # * auto: dunst tries to find a color fitting to the background; 72 | # * foreground: use the same color as the foreground; 73 | # * frame: use the same color as the frame; 74 | # * anything else will be interpreted as a X color. 75 | separator_color = frame 76 | 77 | # Sort messages by urgency. 78 | sort = yes 79 | 80 | # Don't remove messages, if the user is idle (no mouse or keyboard input) 81 | # for longer than idle_threshold seconds. 82 | # Set to 0 to disable. 83 | # A client can set the 'transient' hint to bypass this. See the rules 84 | # section for how to disable this if necessary 85 | idle_threshold = 120 86 | 87 | ### Text ### 88 | 89 | font = Iosevka Nerd Font 10 90 | 91 | # The spacing between lines. If the height is smaller than the 92 | # font height, it will get raised to the font height. 93 | line_height = 0 94 | 95 | # Possible values are: 96 | # full: Allow a small subset of html markup in notifications: 97 | # bold 98 | # italic 99 | # strikethrough 100 | # underline 101 | # 102 | # For a complete reference see 103 | # . 104 | # 105 | # strip: This setting is provided for compatibility with some broken 106 | # clients that send markup even though it's not enabled on the 107 | # server. Dunst will try to strip the markup but the parsing is 108 | # simplistic so using this option outside of matching rules for 109 | # specific applications *IS GREATLY DISCOURAGED*. 110 | # 111 | # no: Disable markup parsing, incoming notifications will be treated as 112 | # plain text. Dunst will not advertise that it has the body-markup 113 | # capability if this is set as a global setting. 114 | # 115 | # It's important to note that markup inside the format option will be parsed 116 | # regardless of what this is set to. 117 | markup = full 118 | 119 | # The format of the message. Possible variables are: 120 | # %a appname 121 | # %s summary 122 | # %b body 123 | # %i iconname (including its path) 124 | # %I iconname (without its path) 125 | # %p progress value if set ([ 0%] to [100%]) or nothing 126 | # %n progress value if set without any extra characters 127 | # %% Literal % 128 | # Markup is allowed 129 | format = "%s\n%b" 130 | 131 | # Alignment of message text. 132 | # Possible values are "left", "center" and "right". 133 | alignment = left 134 | 135 | # Show age of message if message is older than show_age_threshold 136 | # seconds. 137 | # Set to -1 to disable. 138 | show_age_threshold = 60 139 | 140 | # Split notifications into multiple lines if they don't fit into 141 | # geometry. 142 | word_wrap = yes 143 | 144 | # When word_wrap is set to no, specify where to make an ellipsis in long lines. 145 | # Possible values are "start", "middle" and "end". 146 | ellipsize = middle 147 | 148 | # Ignore newlines '\n' in notifications. 149 | ignore_newline = no 150 | 151 | # Stack together notifications with the same content 152 | stack_duplicates = true 153 | 154 | # Hide the count of stacked notifications with the same content 155 | hide_duplicate_count = false 156 | 157 | # Display indicators for URLs (U) and actions (A). 158 | show_indicators = yes 159 | 160 | ### Icons ### 161 | 162 | # Align icons left/right/off 163 | icon_position = off 164 | 165 | # Scale larger icons down to this size, set to 0 to disable 166 | max_icon_size = 32 167 | 168 | # Paths to default icons. 169 | icon_path = /usr/share/icons/gnome/16x16/status/:/usr/share/icons/gnome/16x16/devices/ 170 | 171 | ### History ### 172 | 173 | # Should a notification popped up from history be sticky or timeout 174 | # as if it would normally do. 175 | sticky_history = yes 176 | 177 | # Maximum amount of notifications kept in history 178 | history_length = 20 179 | 180 | ### Misc/Advanced ### 181 | 182 | # dmenu path. 183 | dmenu = /usr/bin/dmenu -p dunst: 184 | 185 | # Browser for opening urls in context menu. 186 | browser = /usr/bin/firefox -new-tab 187 | 188 | # Always run rule-defined scripts, even if the notification is suppressed 189 | always_run_script = true 190 | 191 | # Define the title of the windows spawned by dunst 192 | title = Dunst 193 | 194 | # Define the class of the windows spawned by dunst 195 | class = Dunst 196 | 197 | # Print a notification on startup. 198 | # This is mainly for error detection, since dbus (re-)starts dunst 199 | # automatically after a crash. 200 | startup_notification = false 201 | 202 | # Manage dunst's desire for talking 203 | # Can be one of the following values: 204 | # crit: Critical features. Dunst aborts 205 | # warn: Only non-fatal warnings 206 | # mesg: Important Messages 207 | # info: all unimportant stuff 208 | # debug: all less than unimportant stuff 209 | verbosity = mesg 210 | 211 | # Define the corner radius of the notification window 212 | # in pixel size. If the radius is 0, you have no rounded 213 | # corners. 214 | # The radius will be automatically lowered if it exceeds half of the 215 | # notification height to avoid clipping text and/or icons. 216 | corner_radius = 0 217 | 218 | ### Legacy 219 | 220 | # Use the Xinerama extension instead of RandR for multi-monitor support. 221 | # This setting is provided for compatibility with older nVidia drivers that 222 | # do not support RandR and using it on systems that support RandR is highly 223 | # discouraged. 224 | # 225 | # By enabling this setting dunst will not be able to detect when a monitor 226 | # is connected or disconnected which might break follow mode if the screen 227 | # layout changes. 228 | force_xinerama = false 229 | 230 | ### mouse 231 | 232 | # Defines action of mouse event 233 | # Possible values are: 234 | # * none: Don't do anything. 235 | # * do_action: If the notification has exactly one action, or one is marked as default, 236 | # invoke it. If there are multiple and no default, open the context menu. 237 | # * close_current: Close current notification. 238 | # * close_all: Close all notifications. 239 | mouse_left_click = close_current 240 | mouse_middle_click = do_action 241 | mouse_right_click = close_all 242 | 243 | # Experimental features that may or may not work correctly. Do not expect them 244 | # to have a consistent behaviour across releases. 245 | [experimental] 246 | # Calculate the dpi to use on a per-monitor basis. 247 | # If this setting is enabled the Xft.dpi value will be ignored and instead 248 | # dunst will attempt to calculate an appropriate dpi value for each monitor 249 | # using the resolution and physical size. This might be useful in setups 250 | # where there are multiple screens with very different dpi values. 251 | per_monitor_dpi = false 252 | 253 | [shortcuts] 254 | 255 | # Shortcuts are specified as [modifier+][modifier+]...key 256 | # Available modifiers are "ctrl", "mod1" (the alt-key), "mod2", 257 | # "mod3" and "mod4" (windows-key). 258 | # Xev might be helpful to find names for keys. 259 | 260 | # Close notification. 261 | close = ctrl+space 262 | 263 | # Close all notifications. 264 | close_all = ctrl+shift+space 265 | 266 | # Redisplay last message(s). 267 | # On the US keyboard layout "grave" is normally above TAB and left 268 | # of "1". Make sure this key actually exists on your keyboard layout, 269 | # e.g. check output of 'xmodmap -pke' 270 | history = ctrl+grave 271 | 272 | # Context menu. 273 | context = ctrl+shift+period 274 | 275 | [urgency_low] 276 | # IMPORTANT: colors have to be defined in quotation marks. 277 | # Otherwise the "#" and following would be interpreted as a comment. 278 | foreground = "#94d3f7" 279 | background = "#555555" 280 | frame_color = "#000000" 281 | timeout = 10 282 | # Icon for notifications with low urgency, uncomment to enable 283 | #icon = /path/to/icon 284 | 285 | [urgency_normal] 286 | background = "#ffffff" 287 | foreground = "#285577" 288 | frame_color = "#000000 289 | timeout = 10 290 | # Icon for notifications with normal urgency, uncomment to enable 291 | #icon = /path/to/icon 292 | 293 | [urgency_critical] 294 | background = "#900000" 295 | foreground = "#ff0000" 296 | frame_color = "#285577" 297 | timeout = 0 298 | # Icon for notifications with critical urgency, uncomment to enable 299 | #icon = /path/to/icon 300 | 301 | # Every section that isn't one of the above is interpreted as a rules to 302 | # override settings for certain messages. 303 | # 304 | # Messages can be matched by 305 | # appname (discouraged, see desktop_entry) 306 | # body 307 | # category 308 | # desktop_entry 309 | # icon 310 | # match_transient 311 | # msg_urgency 312 | # stack_tag 313 | # summary 314 | # 315 | # and you can override the 316 | # background 317 | # foreground 318 | # format 319 | # frame_color 320 | # fullscreen 321 | # new_icon 322 | # set_stack_tag 323 | # set_transient 324 | # timeout 325 | # urgency 326 | # 327 | # Shell-like globbing will get expanded. 328 | # 329 | # Instead of the appname filter, it's recommended to use the desktop_entry filter. 330 | # GLib based applications export their desktop-entry name. In comparison to the appname, 331 | # the desktop-entry won't get localized. 332 | # 333 | # SCRIPTING 334 | # You can specify a script that gets run when the rule matches by 335 | # setting the "script" option. 336 | # The script will be called as follows: 337 | # script appname summary body icon urgency 338 | # where urgency can be "LOW", "NORMAL" or "CRITICAL". 339 | # 340 | # NOTE: if you don't want a notification to be displayed, set the format 341 | # to "". 342 | # NOTE: It might be helpful to run dunst -print in a terminal in order 343 | # to find fitting options for rules. 344 | 345 | # Disable the transient hint so that idle_threshold cannot be bypassed from the 346 | # client 347 | #[transient_disable] 348 | # match_transient = yes 349 | # set_transient = no 350 | # 351 | # Make the handling of transient notifications more strict by making them not 352 | # be placed in history. 353 | #[transient_history_ignore] 354 | # match_transient = yes 355 | # history_ignore = yes 356 | 357 | # fullscreen values 358 | # show: show the notifications, regardless if there is a fullscreen window opened 359 | # delay: displays the new notification, if there is no fullscreen window active 360 | # If the notification is already drawn, it won't get undrawn. 361 | # pushback: same as delay, but when switching into fullscreen, the notification will get 362 | # withdrawn from screen again and will get delayed like a new notification 363 | #[fullscreen_delay_everything] 364 | # fullscreen = delay 365 | #[fullscreen_show_critical] 366 | # msg_urgency = critical 367 | # fullscreen = show 368 | 369 | #[espeak] 370 | # summary = "*" 371 | # script = dunst_espeak.sh 372 | 373 | #[script-test] 374 | # summary = "*script*" 375 | # script = dunst_test.sh 376 | 377 | #[ignore] 378 | # # This notification will not be displayed 379 | # summary = "foobar" 380 | # format = "" 381 | 382 | #[history-ignore] 383 | # # This notification will not be saved in history 384 | # summary = "foobar" 385 | # history_ignore = yes 386 | 387 | #[skip-display] 388 | # # This notification will not be displayed, but will be included in the history 389 | # summary = "foobar" 390 | # skip_display = yes 391 | 392 | #[signed_on] 393 | # appname = Pidgin 394 | # summary = "*signed on*" 395 | # urgency = low 396 | # 397 | #[signed_off] 398 | # appname = Pidgin 399 | # summary = *signed off* 400 | # urgency = low 401 | # 402 | #[says] 403 | # appname = Pidgin 404 | # summary = *says* 405 | # urgency = critical 406 | # 407 | #[twitter] 408 | # appname = Pidgin 409 | # summary = *twitter.com* 410 | # urgency = normal 411 | # 412 | #[stack-volumes] 413 | # appname = "some_volume_notifiers" 414 | # set_stack_tag = "volume" 415 | # 416 | # vim: ft=cfg 417 | -------------------------------------------------------------------------------- /dwm/LICENSE: -------------------------------------------------------------------------------- 1 | MIT/X Consortium License 2 | 3 | © 2006-2019 Anselm R Garbe 4 | © 2006-2009 Jukka Salmi 5 | © 2006-2007 Sander van Dijk 6 | © 2007-2011 Peter Hartlich 7 | © 2007-2009 Szabolcs Nagy 8 | © 2007-2009 Christof Musik 9 | © 2007-2009 Premysl Hruby 10 | © 2007-2008 Enno Gottox Boland 11 | © 2008 Martin Hurton 12 | © 2008 Neale Pickett 13 | © 2009 Mate Nagy 14 | © 2010-2016 Hiltjo Posthuma 15 | © 2010-2012 Connor Lane Smith 16 | © 2011 Christoph Lohmann <20h@r-36.net> 17 | © 2015-2016 Quentin Rameau 18 | © 2015-2016 Eric Pruitt 19 | © 2016-2017 Markus Teich 20 | 21 | Permission is hereby granted, free of charge, to any person obtaining a 22 | copy of this software and associated documentation files (the "Software"), 23 | to deal in the Software without restriction, including without limitation 24 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 25 | and/or sell copies of the Software, and to permit persons to whom the 26 | Software is furnished to do so, subject to the following conditions: 27 | 28 | The above copyright notice and this permission notice shall be included in 29 | all copies or substantial portions of the Software. 30 | 31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 34 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 36 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 37 | DEALINGS IN THE SOFTWARE. 38 | -------------------------------------------------------------------------------- /dwm/Makefile: -------------------------------------------------------------------------------- 1 | # dwm - dynamic window manager 2 | # See LICENSE file for copyright and license details. 3 | 4 | include config.mk 5 | 6 | SRC = drw.c dwm.c util.c 7 | OBJ = ${SRC:.c=.o} 8 | 9 | all: options dwm 10 | 11 | options: 12 | @echo dwm build options: 13 | @echo "CFLAGS = ${CFLAGS}" 14 | @echo "LDFLAGS = ${LDFLAGS}" 15 | @echo "CC = ${CC}" 16 | 17 | .c.o: 18 | ${CC} -c ${CFLAGS} $< 19 | 20 | ${OBJ}: config.h config.mk 21 | 22 | config.h: 23 | cp config.def.h $@ 24 | 25 | dwm: ${OBJ} 26 | ${CC} -o $@ ${OBJ} ${LDFLAGS} 27 | 28 | clean: 29 | rm -f dwm ${OBJ} dwm-${VERSION}.tar.gz 30 | 31 | dist: clean 32 | mkdir -p dwm-${VERSION} 33 | cp -R LICENSE Makefile README config.def.h config.mk\ 34 | dwm.1 drw.h util.h ${SRC} dwm.png transient.c dwm-${VERSION} 35 | tar -cf dwm-${VERSION}.tar dwm-${VERSION} 36 | gzip dwm-${VERSION}.tar 37 | rm -rf dwm-${VERSION} 38 | 39 | install: all 40 | mkdir -p ${DESTDIR}${PREFIX}/bin 41 | cp -f dwm ${DESTDIR}${PREFIX}/bin 42 | chmod 755 ${DESTDIR}${PREFIX}/bin/dwm 43 | mkdir -p ${DESTDIR}${MANPREFIX}/man1 44 | sed "s/VERSION/${VERSION}/g" < dwm.1 > ${DESTDIR}${MANPREFIX}/man1/dwm.1 45 | chmod 644 ${DESTDIR}${MANPREFIX}/man1/dwm.1 46 | 47 | uninstall: 48 | rm -f ${DESTDIR}${PREFIX}/bin/dwm\ 49 | ${DESTDIR}${MANPREFIX}/man1/dwm.1 50 | 51 | .PHONY: all options clean dist install uninstall 52 | -------------------------------------------------------------------------------- /dwm/README: -------------------------------------------------------------------------------- 1 | dwm - dynamic window manager 2 | ============================ 3 | dwm is an extremely fast, small, and dynamic window manager for X. 4 | 5 | 6 | Requirements 7 | ------------ 8 | In order to build dwm you need the Xlib header files. 9 | 10 | 11 | Installation 12 | ------------ 13 | Edit config.mk to match your local setup (dwm is installed into 14 | the /usr/local namespace by default). 15 | 16 | Afterwards enter the following command to build and install dwm (if 17 | necessary as root): 18 | 19 | make clean install 20 | 21 | 22 | Running dwm 23 | ----------- 24 | Add the following line to your .xinitrc to start dwm using startx: 25 | 26 | exec dwm 27 | 28 | In order to connect dwm to a specific display, make sure that 29 | the DISPLAY environment variable is set correctly, e.g.: 30 | 31 | DISPLAY=foo.bar:1 exec dwm 32 | 33 | (This will start dwm on display :1 of the host foo.bar.) 34 | 35 | In order to display status info in the bar, you can do something 36 | like this in your .xinitrc: 37 | 38 | while xsetroot -name "`date` `uptime | sed 's/.*,//'`" 39 | do 40 | sleep 1 41 | done & 42 | exec dwm 43 | 44 | 45 | Configuration 46 | ------------- 47 | The configuration of dwm is done by creating a custom config.h 48 | and (re)compiling the source code. 49 | -------------------------------------------------------------------------------- /dwm/config.def.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | 4 | 5 | /* appearance */ 6 | static const unsigned int borderpx = 1; /* border pixel of windows */ 7 | static const unsigned int gappx = 12; /* gaps between windows */ 8 | static const unsigned int snap = 32; /* snap pixel */ 9 | static const int showbar = 1; /* 0 means no bar */ 10 | static const int topbar = 1; /* 0 means bottom bar */ 11 | static const int user_bh = 70; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ 12 | 13 | static const char *fonts[] = { "System San Francisco Display:size=10:style=heavy", "JoyPixels:pixelsize=10", "monospace:size=10" }; 14 | static const char dmenufont[] = "System San Francisco Display:size=10"; 15 | static const char col_gray1[] = "#222222"; 16 | static const char col_gray2[] = "#444444"; 17 | static const char col_gray3[] = "#faebd7"; 18 | static const char col_black[] = "#000000"; 19 | static const char col_border[] = "#ff79c6"; 20 | static const char col_cyan[] = "#005577"; 21 | static const char col_red[] = "#ff5555"; 22 | static const char col_yellow[] = "#ffff00"; 23 | static const char col_smthFG[] = "#f5fffa"; 24 | static const char col_SeparatorBG[] = "#707070"; 25 | static const char col_BGgreen[] = "#008000"; 26 | static const char col_smth[] = "#eee5de"; 27 | static const unsigned int baralpha = 0xd0; 28 | static const unsigned int borderalpha = OPAQUE; 29 | static const char *colors[][3] = { 30 | /* fg bg border */ 31 | // [SchemeNorm] = { col_gray3, col_gray1, col_black }, 32 | // [SchemeSel] = { col_black, col_border, col_border }, 33 | [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, 34 | [SchemeSel] = { OPAQUE, baralpha, borderalpha }, 35 | [SchemeWarn] = { col_black, col_yellow, col_red }, 36 | [SchemeUrgent] = { col_smthFG, col_red, col_red }, 37 | [SchemeTagUnderline] = { col_border, col_border, col_border }, 38 | [SchemeBGgreen] = { col_gray3, col_BGgreen, col_gray2 }, 39 | [SchemeWnameBG] = { col_border, col_gray1, col_red }, 40 | [SchemeBlockSeparator] = { col_cyan, col_SeparatorBG, col_red }, 41 | [SchemeCmusButton] = { col_smth, col_cyan, col_red }, 42 | }; 43 | 44 | static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL }; 45 | static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL }; 46 | static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL }; 47 | static const char *briup[] = { "/usr/bin/brightnessctl", "s", "+10%", NULL }; 48 | static const char *bridown[] = { "/usr/bin/brightnessctl", "s", "10%-", NULL }; 49 | static const char *previous[] = { "/usr/bin/playerctl", "previous", NULL }; 50 | static const char *playpause[] = { "/usr/bin/playerctl", "play-pause", NULL }; 51 | static const char *next[] = { "/usr/bin/playerctl", "next", NULL }; 52 | static const char *printflame[] = { "/usr/bin/flameshot", "gui", "-p", "/home/axarva/Desktop", NULL }; 53 | static const char *idleinhibit[] = { "/usr/bin/xdotool", "exec", "/home/axarva/bin/foo.sh", NULL }; 54 | static const char *noinhibit[] = { "/usr/bin/xdotool", "exec", "/home/axarva/bin/unfoo.sh", NULL }; 55 | static const char *goingout[] = { "/usr/bin/nwgbar", "-o", "0.2", "-t", "dwm.json", NULL }; 56 | 57 | /* tagging */ 58 | static const char *tags[] = { "", "", "", "", "", "", "", "", "" }; 59 | 60 | static const Rule rules[] = { 61 | /* xprop(1): 62 | * WM_CLASS(STRING) = instance, class 63 | * WM_NAME(STRING) = title 64 | */ 65 | /* class instance title tags mask isfloating monitor */ 66 | { "Gimp", NULL, NULL, 0, 1, -1 }, 67 | { "Firefox", NULL, NULL, 1 << 1, 0, -1 }, 68 | }; 69 | 70 | /* layout(s) */ 71 | static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 72 | static const int nmaster = 1; /* number of clients in master area */ 73 | static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 74 | 75 | static const Layout layouts[] = { 76 | /* symbol arrange function */ 77 | { "🕸️", tile }, /* first entry is default */ 78 | { "💭", NULL }, /* no layout function means floating behavior */ 79 | { "🧐", monocle }, 80 | }; 81 | 82 | /* key definitions */ 83 | #define MODKEY Mod4Mask 84 | #define TAGKEYS(KEY,TAG) \ 85 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 86 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 87 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 88 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 89 | 90 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 91 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 92 | 93 | /* commands */ 94 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 95 | static const char *dmenucmd[] = { "/bin/sh", "-c", "rofi -show drun -config ~/rofi-spotlight/rofi.rasi", NULL }; 96 | static const char *termcmd[] = { "alacritty", NULL }; 97 | 98 | static Key keys[] = { 99 | /* modifier key function argument */ 100 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 101 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 102 | { MODKEY, XK_b, togglebar, {0} }, 103 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 104 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 105 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 106 | { MODKEY, XK_d, incnmaster, {.i = -1 } }, 107 | { MODKEY, XK_h, setmfact, {.f = -0.05} }, 108 | { MODKEY, XK_l, setmfact, {.f = +0.05} }, 109 | { MODKEY, XK_Return, zoom, {0} }, 110 | { MODKEY, XK_Tab, view, {0} }, 111 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, 112 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 113 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 114 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 115 | { MODKEY, XK_space, setlayout, {0} }, 116 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 117 | { MODKEY, XK_0, view, {.ui = ~0 } }, 118 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 119 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 120 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 121 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 122 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 123 | { MODKEY, XK_minus, setgaps, {.i = -1 } }, 124 | { MODKEY, XK_equal, setgaps, {.i = +1 } }, 125 | { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, 126 | TAGKEYS( XK_1, 0) 127 | TAGKEYS( XK_2, 1) 128 | TAGKEYS( XK_3, 2) 129 | TAGKEYS( XK_4, 3) 130 | TAGKEYS( XK_5, 4) 131 | TAGKEYS( XK_6, 5) 132 | TAGKEYS( XK_7, 6) 133 | TAGKEYS( XK_8, 7) 134 | TAGKEYS( XK_9, 8) 135 | { MODKEY|ShiftMask, XK_q, spawn, {.v = goingout} }, 136 | { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } }, 137 | { 0, XF86XK_AudioMute, spawn, {.v = mutevol } }, 138 | { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } }, 139 | { 0, XF86XK_MonBrightnessUp, spawn, {.v = briup } }, 140 | { 0, XF86XK_MonBrightnessDown, spawn, {.v = bridown } }, 141 | { 0, XF86XK_AudioPrev, spawn, {.v = previous } }, 142 | { 0, XF86XK_AudioPlay, spawn, {.v = playpause } }, 143 | { 0, XF86XK_AudioNext, spawn, {.v = next } }, 144 | { 0, XK_Print, spawn, {.v = printflame } }, 145 | { MODKEY, XK_z, spawn, {.v = idleinhibit } }, 146 | { MODKEY|ShiftMask, XK_z, spawn, {.v = noinhibit } }, 147 | { MODKEY|ShiftMask, XK_a, spawn, SHCMD("rofi -modi \"clipboard:greenclip print\" -show clipboard -run-command '{cmd}'") }, 148 | }; 149 | 150 | /* button definitions */ 151 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 152 | static Button buttons[] = { 153 | /* click event mask button function argument */ 154 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 155 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 156 | { ClkWinTitle, 0, Button2, zoom, {0} }, 157 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 158 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 159 | { ClkClientWin, MODKEY|ShiftMask, Button1, movemouse, {.i = 1} }, 160 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 161 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 162 | { ClkClientWin, MODKEY|ShiftMask, Button3, resizemouse, {.i = 1} }, 163 | { ClkTagBar, 0, Button1, view, {0} }, 164 | { ClkTagBar, 0, Button3, toggleview, {0} }, 165 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 166 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 167 | }; 168 | 169 | -------------------------------------------------------------------------------- /dwm/config.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | 4 | 5 | /* appearance */ 6 | static const unsigned int borderpx = 1; /* border pixel of windows */ 7 | static const unsigned int gappx = 12; /* gaps between windows */ 8 | static const unsigned int snap = 32; /* snap pixel */ 9 | static const int showbar = 1; /* 0 means no bar */ 10 | static const int topbar = 1; /* 0 means bottom bar */ 11 | static const int vertpad = 10; /* vertical padding of bar */ 12 | static const int sidepad = 10; /* horizontal padding of bar */ 13 | static const int user_bh = 26; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ 14 | 15 | static const char *fonts[] = { "Iosevka Nerd Font:size=10:style=bold", "JoyPixels:pixelsize=10", "monospace:size=10" }; 16 | static const char dmenufont[] = "Iosevka Nerd Font:size=10"; 17 | static const char col_gray1[] = "#222222"; 18 | static const char col_gray2[] = "#444444"; 19 | static const char col_gray3[] = "#faebd7"; 20 | static const char col_gray4[] = "#eeeeee"; 21 | static const char col_black[] = "#000000"; 22 | static const char col_border[] = "#ff79c6"; 23 | static const char col_cyan[] = "#005577"; 24 | static const char col_red[] = "#ff5555"; 25 | static const char col_yellow[] = "#ffff00"; 26 | static const char col_smthFG[] = "#f5fffa"; 27 | static const char col_SeparatorBG[] = "#707070"; 28 | static const char col_BGgreen[] = "#008000"; 29 | static const char col_smth[] = "#eee5de"; 30 | static const unsigned int baralpha = 130; 31 | static const unsigned int borderalpha = 140; 32 | static const char col_navyblue[] = "#284b82"; 33 | static const char *colors[][3] = { 34 | /* fg bg border */ 35 | // [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 36 | // [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 37 | [SchemeNorm] = { "#ffffff", col_black, col_black }, 38 | [SchemeSel] = { "#94d3f7", col_black, col_black }, 39 | [SchemeStatus] = { "#94d3f7", col_black, "#000000" }, // Statusbar right {text,background,not used but cannot be empty} 40 | [SchemeTagsSel] = { col_navyblue, col_black, "#000000" }, // Tagbar left selected {text,background,not used but cannot be empty} 41 | [SchemeTagsNorm] = { "#94d3f7", col_black, "#000000" }, // Tagbar left unselected {text,background,not used but cannot be empty} 42 | [SchemeInfoSel] = { "#94d3f7", col_black, "#000000" }, // infobar middle selected {text,background,not used but cannot be empty} 43 | [SchemeInfoNorm] = { "#94d3f7", col_black, "#000000" }, // infobar middle unselected {text,background,not used but cannot be empty} 44 | 45 | // [SchemeWarn] = { col_black, col_yellow, col_red }, 46 | // [SchemeUrgent] = { col_smthFG, col_red, col_red }, 47 | // [SchemeTagUnderline] = { col_border, col_border, col_border }, 48 | // [SchemeBGgreen] = { col_gray3, col_BGgreen, col_gray2 }, 49 | // [SchemeWnameBG] = { col_border, col_gray1, col_red }, 50 | // [SchemeBlockSeparator] = { col_cyan, col_SeparatorBG, col_red }, 51 | // [SchemeCmusButton] = { col_smth, col_cyan, col_red }, 52 | }; 53 | static const unsigned int alphas[][3] = { 54 | /* fg bg border */ 55 | [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, 56 | [SchemeSel] = { OPAQUE, baralpha, borderalpha }, 57 | [SchemeStatus] = { OPAQUE, baralpha, borderalpha }, 58 | [SchemeTagsSel] = { OPAQUE, baralpha, borderalpha }, 59 | [SchemeTagsNorm] = { OPAQUE, baralpha, borderalpha }, 60 | [SchemeInfoSel] = { OPAQUE, baralpha, borderalpha }, 61 | [SchemeInfoNorm] = { OPAQUE, baralpha, borderalpha }, 62 | }; 63 | 64 | static const char *upvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "+5%", NULL }; 65 | static const char *downvol[] = { "/usr/bin/pactl", "set-sink-volume", "0", "-5%", NULL }; 66 | static const char *mutevol[] = { "/usr/bin/pactl", "set-sink-mute", "0", "toggle", NULL }; 67 | static const char *briup[] = { "/usr/bin/brightnessctl", "s", "+10%", NULL }; 68 | static const char *bridown[] = { "/usr/bin/brightnessctl", "s", "10%-", NULL }; 69 | static const char *previous[] = { "/usr/bin/playerctl", "previous", NULL }; 70 | static const char *playpause[] = { "/usr/bin/playerctl", "play-pause", NULL }; 71 | static const char *next[] = { "/usr/bin/playerctl", "next", NULL }; 72 | static const char *printflame[] = { "/usr/bin/flameshot", "gui", "-p", "/home/axarva/Desktop", NULL }; 73 | static const char *idleinhibit[] = { "/usr/bin/xdotool", "exec", "/home/axarva/bin/foo.sh", NULL }; 74 | static const char *noinhibit[] = { "/usr/bin/xdotool", "exec", "/home/axarva/bin/unfoo.sh", NULL }; 75 | static const char *goingout[] = { "/home/axarva/bin/powermenu", NULL }; 76 | static const char *lock[] = { "/usr/bin/betterlockscreen", "-l", NULL }; 77 | 78 | /* tagging */ 79 | static const char *tags[] = { "", "", "", "", "", "", "", "", "" }; 80 | 81 | static const Rule rules[] = { 82 | /* xprop(1): 83 | * WM_CLASS(STRING) = instance, class 84 | * WM_NAME(STRING) = title 85 | */ 86 | /* class instance title tags mask isfloating monitor */ 87 | { "Gimp", NULL, NULL, 0, 1, -1 }, 88 | { "Firefox", NULL, NULL, 1 << 1, 0, -1 }, 89 | /*{ "Spotify", "spotify", "Spotify Free", 1 << 8, 0, -1 }, This doesn't work unless you get smth like spotifywm*/ 90 | }; 91 | 92 | /* layout(s) */ 93 | static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */ 94 | static const int nmaster = 1; /* number of clients in master area */ 95 | static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */ 96 | 97 | static const Layout layouts[] = { 98 | /* symbol arrange function */ 99 | { "🕸️", tile }, /* first entry is default */ 100 | { "💭", NULL }, /* no layout function means floating behavior */ 101 | { "🧐", monocle }, 102 | }; 103 | 104 | /* key definitions */ 105 | #define MODKEY Mod4Mask 106 | #define TAGKEYS(KEY,TAG) \ 107 | { MODKEY, KEY, view, {.ui = 1 << TAG} }, \ 108 | { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \ 109 | { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \ 110 | { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} }, 111 | 112 | /* helper for spawning shell commands in the pre dwm-5.0 fashion */ 113 | #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } 114 | 115 | /* commands */ 116 | static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */ 117 | static const char *dmenucmd[] = { "/home/axarva/bin/appsmenu", NULL }; 118 | static const char *termcmd[] = { "alacritty", NULL }; 119 | 120 | static Key keys[] = { 121 | /* modifier key function argument */ 122 | { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 123 | { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 124 | { MODKEY, XK_b, togglebar, {0} }, 125 | { MODKEY, XK_j, focusstack, {.i = +1 } }, 126 | { MODKEY, XK_k, focusstack, {.i = -1 } }, 127 | { MODKEY, XK_i, incnmaster, {.i = +1 } }, 128 | { MODKEY, XK_d, incnmaster, {.i = -1 } }, 129 | { MODKEY, XK_h, setmfact, {.f = -0.05} }, 130 | { MODKEY, XK_l, setmfact, {.f = +0.05} }, 131 | { MODKEY, XK_Return, zoom, {0} }, 132 | { MODKEY, XK_Tab, view, {0} }, 133 | { MODKEY|ShiftMask, XK_c, killclient, {0} }, 134 | { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, 135 | { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, 136 | { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, 137 | { MODKEY, XK_space, setlayout, {0} }, 138 | { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, 139 | { MODKEY, XK_0, view, {.ui = ~0 } }, 140 | { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, 141 | { MODKEY, XK_comma, focusmon, {.i = -1 } }, 142 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 143 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 144 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 145 | { MODKEY, XK_minus, setgaps, {.i = -1 } }, 146 | { MODKEY, XK_equal, setgaps, {.i = +1 } }, 147 | { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, 148 | TAGKEYS( XK_1, 0) 149 | TAGKEYS( XK_2, 1) 150 | TAGKEYS( XK_3, 2) 151 | TAGKEYS( XK_4, 3) 152 | TAGKEYS( XK_5, 4) 153 | TAGKEYS( XK_6, 5) 154 | TAGKEYS( XK_7, 6) 155 | TAGKEYS( XK_8, 7) 156 | TAGKEYS( XK_9, 8) 157 | { MODKEY|ShiftMask, XK_q, spawn, {.v = goingout} }, 158 | { 0, XF86XK_AudioLowerVolume, spawn, {.v = downvol } }, 159 | { 0, XF86XK_AudioMute, spawn, {.v = mutevol } }, 160 | { 0, XF86XK_AudioRaiseVolume, spawn, {.v = upvol } }, 161 | { 0, XF86XK_MonBrightnessUp, spawn, {.v = briup } }, 162 | { 0, XF86XK_MonBrightnessDown, spawn, {.v = bridown } }, 163 | { 0, XF86XK_AudioPrev, spawn, {.v = previous } }, 164 | { 0, XF86XK_AudioPlay, spawn, {.v = playpause } }, 165 | { 0, XF86XK_AudioNext, spawn, {.v = next } }, 166 | { 0, XK_Print, spawn, {.v = printflame } }, 167 | { MODKEY, XK_z, spawn, {.v = idleinhibit } }, 168 | { MODKEY|ShiftMask, XK_z, spawn, {.v = noinhibit } }, 169 | { MODKEY|ShiftMask, XK_a, spawn, SHCMD("rofi -modi \"clipboard:greenclip print\" -show clipboard -run-command '{cmd}' -config ~/rofi-spotlight/rofi.rasi") }, 170 | { MODKEY, XK_F1, spawn, {.v = lock } }, 171 | }; 172 | 173 | /* button definitions */ 174 | /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */ 175 | static Button buttons[] = { 176 | /* click event mask button function argument */ 177 | { ClkLtSymbol, 0, Button1, setlayout, {0} }, 178 | { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} }, 179 | { ClkWinTitle, 0, Button2, zoom, {0} }, 180 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 181 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 182 | { ClkClientWin, MODKEY|ShiftMask, Button1, movemouse, {.i = 1} }, 183 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 184 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 185 | { ClkClientWin, MODKEY|ShiftMask, Button3, resizemouse, {.i = 1} }, 186 | { ClkTagBar, 0, Button1, view, {0} }, 187 | { ClkTagBar, 0, Button3, toggleview, {0} }, 188 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 189 | { ClkTagBar, MODKEY, Button3, toggletag, {0} }, 190 | }; 191 | 192 | -------------------------------------------------------------------------------- /dwm/config.mk: -------------------------------------------------------------------------------- 1 | # dwm version 2 | VERSION = 6.2 3 | 4 | # Customize below to fit your system 5 | 6 | # paths 7 | PREFIX = /usr/local 8 | MANPREFIX = ${PREFIX}/share/man 9 | 10 | X11INC = /usr/X11R6/include 11 | X11LIB = /usr/X11R6/lib 12 | 13 | # Xinerama, comment if you don't want it 14 | XINERAMALIBS = -lXinerama 15 | XINERAMAFLAGS = -DXINERAMA 16 | 17 | # freetype 18 | FREETYPELIBS = -lfontconfig -lXft 19 | FREETYPEINC = /usr/include/freetype2 20 | # OpenBSD (uncomment) 21 | #FREETYPEINC = ${X11INC}/freetype2 22 | 23 | # includes and libs 24 | INCS = -I${X11INC} -I${FREETYPEINC} 25 | LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender 26 | 27 | # flags 28 | CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 29 | #CFLAGS = -g -std=c99 -pedantic -Wall -O0 ${INCS} ${CPPFLAGS} 30 | CFLAGS = -std=c99 -pedantic -Wall -Wno-deprecated-declarations -Os ${INCS} ${CPPFLAGS} 31 | LDFLAGS = ${LIBS} 32 | 33 | # Solaris 34 | #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" 35 | #LDFLAGS = ${LIBS} 36 | 37 | # compiler and linker 38 | CC = cc 39 | -------------------------------------------------------------------------------- /dwm/drw.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "drw.h" 9 | #include "util.h" 10 | 11 | #define UTF_INVALID 0xFFFD 12 | #define UTF_SIZ 4 13 | 14 | static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; 15 | static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; 16 | static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000}; 17 | static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; 18 | 19 | static long 20 | utf8decodebyte(const char c, size_t *i) 21 | { 22 | for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) 23 | if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) 24 | return (unsigned char)c & ~utfmask[*i]; 25 | return 0; 26 | } 27 | 28 | static size_t 29 | utf8validate(long *u, size_t i) 30 | { 31 | if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) 32 | *u = UTF_INVALID; 33 | for (i = 1; *u > utfmax[i]; ++i) 34 | ; 35 | return i; 36 | } 37 | 38 | static size_t 39 | utf8decode(const char *c, long *u, size_t clen) 40 | { 41 | size_t i, j, len, type; 42 | long udecoded; 43 | 44 | *u = UTF_INVALID; 45 | if (!clen) 46 | return 0; 47 | udecoded = utf8decodebyte(c[0], &len); 48 | if (!BETWEEN(len, 1, UTF_SIZ)) 49 | return 1; 50 | for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { 51 | udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); 52 | if (type) 53 | return j; 54 | } 55 | if (j < len) 56 | return 0; 57 | *u = udecoded; 58 | utf8validate(u, len); 59 | 60 | return len; 61 | } 62 | 63 | Drw * 64 | drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) 65 | { 66 | Drw *drw = ecalloc(1, sizeof(Drw)); 67 | 68 | drw->dpy = dpy; 69 | drw->screen = screen; 70 | drw->root = root; 71 | drw->w = w; 72 | drw->h = h; 73 | drw->visual = visual; 74 | drw->depth = depth; 75 | drw->cmap = cmap; 76 | drw->drawable = XCreatePixmap(dpy, root, w, h, depth); 77 | drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); 78 | XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); 79 | 80 | return drw; 81 | } 82 | 83 | void 84 | drw_resize(Drw *drw, unsigned int w, unsigned int h) 85 | { 86 | if (!drw) 87 | return; 88 | 89 | drw->w = w; 90 | drw->h = h; 91 | if (drw->drawable) 92 | XFreePixmap(drw->dpy, drw->drawable); 93 | drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); 94 | } 95 | 96 | void 97 | drw_free(Drw *drw) 98 | { 99 | XFreePixmap(drw->dpy, drw->drawable); 100 | XFreeGC(drw->dpy, drw->gc); 101 | drw_fontset_free(drw->fonts); 102 | free(drw); 103 | } 104 | 105 | /* This function is an implementation detail. Library users should use 106 | * drw_fontset_create instead. 107 | */ 108 | static Fnt * 109 | xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern) 110 | { 111 | Fnt *font; 112 | XftFont *xfont = NULL; 113 | FcPattern *pattern = NULL; 114 | 115 | if (fontname) { 116 | /* Using the pattern found at font->xfont->pattern does not yield the 117 | * same substitution results as using the pattern returned by 118 | * FcNameParse; using the latter results in the desired fallback 119 | * behaviour whereas the former just results in missing-character 120 | * rectangles being drawn, at least with some fonts. */ 121 | if (!(xfont = XftFontOpenName(drw->dpy, drw->screen, fontname))) { 122 | fprintf(stderr, "error, cannot load font from name: '%s'\n", fontname); 123 | return NULL; 124 | } 125 | if (!(pattern = FcNameParse((FcChar8 *) fontname))) { 126 | fprintf(stderr, "error, cannot parse font name to pattern: '%s'\n", fontname); 127 | XftFontClose(drw->dpy, xfont); 128 | return NULL; 129 | } 130 | } else if (fontpattern) { 131 | if (!(xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { 132 | fprintf(stderr, "error, cannot load font from pattern.\n"); 133 | return NULL; 134 | } 135 | } else { 136 | die("no font specified."); 137 | } 138 | 139 | font = ecalloc(1, sizeof(Fnt)); 140 | font->xfont = xfont; 141 | font->pattern = pattern; 142 | font->h = xfont->ascent + xfont->descent; 143 | font->dpy = drw->dpy; 144 | 145 | return font; 146 | } 147 | 148 | static void 149 | xfont_free(Fnt *font) 150 | { 151 | if (!font) 152 | return; 153 | if (font->pattern) 154 | FcPatternDestroy(font->pattern); 155 | XftFontClose(font->dpy, font->xfont); 156 | free(font); 157 | } 158 | 159 | Fnt* 160 | drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount) 161 | { 162 | Fnt *cur, *ret = NULL; 163 | size_t i; 164 | 165 | if (!drw || !fonts) 166 | return NULL; 167 | 168 | for (i = 1; i <= fontcount; i++) { 169 | if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) { 170 | cur->next = ret; 171 | ret = cur; 172 | } 173 | } 174 | return (drw->fonts = ret); 175 | } 176 | 177 | void 178 | drw_fontset_free(Fnt *font) 179 | { 180 | if (font) { 181 | drw_fontset_free(font->next); 182 | xfont_free(font); 183 | } 184 | } 185 | 186 | void 187 | drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha) 188 | { 189 | if (!drw || !dest || !clrname) 190 | return; 191 | 192 | if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, 193 | clrname, dest)) 194 | die("error, cannot allocate color '%s'", clrname); 195 | 196 | dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); 197 | } 198 | 199 | /* Wrapper to create color schemes. The caller has to call free(3) on the 200 | * returned color scheme when done using it. */ 201 | Clr * 202 | drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount) 203 | { 204 | size_t i; 205 | Clr *ret; 206 | 207 | /* need at least two colors for a scheme */ 208 | if (!drw || !clrnames || clrcount < 2 || !(ret = ecalloc(clrcount, sizeof(XftColor)))) 209 | return NULL; 210 | 211 | for (i = 0; i < clrcount; i++) 212 | drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); 213 | return ret; 214 | } 215 | 216 | void 217 | drw_setfontset(Drw *drw, Fnt *set) 218 | { 219 | if (drw) 220 | drw->fonts = set; 221 | } 222 | 223 | void 224 | drw_setscheme(Drw *drw, Clr *scm) 225 | { 226 | if (drw) 227 | drw->scheme = scm; 228 | } 229 | 230 | void 231 | drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert) 232 | { 233 | if (!drw || !drw->scheme) 234 | return; 235 | XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme[ColBg].pixel : drw->scheme[ColFg].pixel); 236 | if (filled) 237 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 238 | else 239 | XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1); 240 | } 241 | 242 | int 243 | drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert) 244 | { 245 | char buf[1024]; 246 | int ty; 247 | unsigned int ew; 248 | XftDraw *d = NULL; 249 | Fnt *usedfont, *curfont, *nextfont; 250 | size_t i, len; 251 | int utf8strlen, utf8charlen, render = x || y || w || h; 252 | long utf8codepoint = 0; 253 | const char *utf8str; 254 | FcCharSet *fccharset; 255 | FcPattern *fcpattern; 256 | FcPattern *match; 257 | XftResult result; 258 | int charexists = 0; 259 | 260 | if (!drw || (render && !drw->scheme) || !text || !drw->fonts) 261 | return 0; 262 | 263 | if (!render) { 264 | w = ~w; 265 | } else { 266 | XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); 267 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 268 | d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); 269 | x += lpad; 270 | w -= lpad; 271 | } 272 | 273 | usedfont = drw->fonts; 274 | while (1) { 275 | utf8strlen = 0; 276 | utf8str = text; 277 | nextfont = NULL; 278 | while (*text) { 279 | utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ); 280 | for (curfont = drw->fonts; curfont; curfont = curfont->next) { 281 | charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint); 282 | if (charexists) { 283 | if (curfont == usedfont) { 284 | utf8strlen += utf8charlen; 285 | text += utf8charlen; 286 | } else { 287 | nextfont = curfont; 288 | } 289 | break; 290 | } 291 | } 292 | 293 | if (!charexists || nextfont) 294 | break; 295 | else 296 | charexists = 0; 297 | } 298 | 299 | if (utf8strlen) { 300 | drw_font_getexts(usedfont, utf8str, utf8strlen, &ew, NULL); 301 | /* shorten text if necessary */ 302 | for (len = MIN(utf8strlen, sizeof(buf) - 1); len && ew > w; len--) 303 | drw_font_getexts(usedfont, utf8str, len, &ew, NULL); 304 | 305 | if (len) { 306 | memcpy(buf, utf8str, len); 307 | buf[len] = '\0'; 308 | if (len < utf8strlen) 309 | for (i = len; i && i > len - 3; buf[--i] = '.') 310 | ; /* NOP */ 311 | 312 | if (render) { 313 | ty = y + (h - usedfont->h) / 2 + usedfont->xfont->ascent; 314 | XftDrawStringUtf8(d, &drw->scheme[invert ? ColBg : ColFg], 315 | usedfont->xfont, x, ty, (XftChar8 *)buf, len); 316 | } 317 | x += ew; 318 | w -= ew; 319 | } 320 | } 321 | 322 | if (!*text) { 323 | break; 324 | } else if (nextfont) { 325 | charexists = 0; 326 | usedfont = nextfont; 327 | } else { 328 | /* Regardless of whether or not a fallback font is found, the 329 | * character must be drawn. */ 330 | charexists = 1; 331 | 332 | fccharset = FcCharSetCreate(); 333 | FcCharSetAddChar(fccharset, utf8codepoint); 334 | 335 | if (!drw->fonts->pattern) { 336 | /* Refer to the comment in xfont_create for more information. */ 337 | die("the first font in the cache must be loaded from a font string."); 338 | } 339 | 340 | fcpattern = FcPatternDuplicate(drw->fonts->pattern); 341 | FcPatternAddCharSet(fcpattern, FC_CHARSET, fccharset); 342 | FcPatternAddBool(fcpattern, FC_SCALABLE, FcTrue); 343 | FcPatternAddBool(fcpattern, FC_COLOR, FcFalse); 344 | 345 | FcConfigSubstitute(NULL, fcpattern, FcMatchPattern); 346 | FcDefaultSubstitute(fcpattern); 347 | match = XftFontMatch(drw->dpy, drw->screen, fcpattern, &result); 348 | 349 | FcCharSetDestroy(fccharset); 350 | FcPatternDestroy(fcpattern); 351 | 352 | if (match) { 353 | usedfont = xfont_create(drw, NULL, match); 354 | if (usedfont && XftCharExists(drw->dpy, usedfont->xfont, utf8codepoint)) { 355 | for (curfont = drw->fonts; curfont->next; curfont = curfont->next) 356 | ; /* NOP */ 357 | curfont->next = usedfont; 358 | } else { 359 | xfont_free(usedfont); 360 | usedfont = drw->fonts; 361 | } 362 | } 363 | } 364 | } 365 | if (d) 366 | XftDrawDestroy(d); 367 | 368 | return x + (render ? w : 0); 369 | } 370 | 371 | void 372 | drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) 373 | { 374 | if (!drw) 375 | return; 376 | 377 | XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); 378 | XSync(drw->dpy, False); 379 | } 380 | 381 | unsigned int 382 | drw_fontset_getwidth(Drw *drw, const char *text) 383 | { 384 | if (!drw || !drw->fonts || !text) 385 | return 0; 386 | return drw_text(drw, 0, 0, 0, 0, 0, text, 0); 387 | } 388 | 389 | void 390 | drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h) 391 | { 392 | XGlyphInfo ext; 393 | 394 | if (!font || !text) 395 | return; 396 | 397 | XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); 398 | if (w) 399 | *w = ext.xOff; 400 | if (h) 401 | *h = font->h; 402 | } 403 | 404 | Cur * 405 | drw_cur_create(Drw *drw, int shape) 406 | { 407 | Cur *cur; 408 | 409 | if (!drw || !(cur = ecalloc(1, sizeof(Cur)))) 410 | return NULL; 411 | 412 | cur->cursor = XCreateFontCursor(drw->dpy, shape); 413 | 414 | return cur; 415 | } 416 | 417 | void 418 | drw_cur_free(Drw *drw, Cur *cursor) 419 | { 420 | if (!cursor) 421 | return; 422 | 423 | XFreeCursor(drw->dpy, cursor->cursor); 424 | free(cursor); 425 | } 426 | -------------------------------------------------------------------------------- /dwm/drw.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | typedef struct { 4 | Cursor cursor; 5 | } Cur; 6 | 7 | typedef struct Fnt { 8 | Display *dpy; 9 | unsigned int h; 10 | XftFont *xfont; 11 | FcPattern *pattern; 12 | struct Fnt *next; 13 | } Fnt; 14 | 15 | enum { ColFg, ColBg, ColBorder }; /* Clr scheme index */ 16 | typedef XftColor Clr; 17 | 18 | typedef struct { 19 | unsigned int w, h; 20 | Display *dpy; 21 | int screen; 22 | Window root; 23 | Visual *visual; 24 | unsigned int depth; 25 | Colormap cmap; 26 | Drawable drawable; 27 | GC gc; 28 | Clr *scheme; 29 | Fnt *fonts; 30 | } Drw; 31 | 32 | /* Drawable abstraction */ 33 | Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); 34 | void drw_resize(Drw *drw, unsigned int w, unsigned int h); 35 | void drw_free(Drw *drw); 36 | 37 | /* Fnt abstraction */ 38 | Fnt *drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount); 39 | void drw_fontset_free(Fnt* set); 40 | unsigned int drw_fontset_getwidth(Drw *drw, const char *text); 41 | void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); 42 | 43 | /* Colorscheme abstraction */ 44 | void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha); 45 | Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount); 46 | 47 | /* Cursor abstraction */ 48 | Cur *drw_cur_create(Drw *drw, int shape); 49 | void drw_cur_free(Drw *drw, Cur *cursor); 50 | 51 | /* Drawing context manipulation */ 52 | void drw_setfontset(Drw *drw, Fnt *set); 53 | void drw_setscheme(Drw *drw, Clr *scm); 54 | 55 | /* Drawing functions */ 56 | void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int invert); 57 | int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert); 58 | 59 | /* Map functions */ 60 | void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); 61 | -------------------------------------------------------------------------------- /dwm/drw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/dwm/drw.o -------------------------------------------------------------------------------- /dwm/dwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/dwm/dwm -------------------------------------------------------------------------------- /dwm/dwm.1: -------------------------------------------------------------------------------- 1 | .TH DWM 1 dwm\-VERSION 2 | .SH NAME 3 | dwm \- dynamic window manager 4 | .SH SYNOPSIS 5 | .B dwm 6 | .RB [ \-v ] 7 | .SH DESCRIPTION 8 | dwm is a dynamic window manager for X. It manages windows in tiled, monocle 9 | and floating layouts. Either layout can be applied dynamically, optimising the 10 | environment for the application in use and the task performed. 11 | .P 12 | In tiled layouts windows are managed in a master and stacking area. The master 13 | area on the left contains one window by default, and the stacking area on the 14 | right contains all other windows. The number of master area windows can be 15 | adjusted from zero to an arbitrary number. In monocle layout all windows are 16 | maximised to the screen size. In floating layout windows can be resized and 17 | moved freely. Dialog windows are always managed floating, regardless of the 18 | layout applied. 19 | .P 20 | Windows are grouped by tags. Each window can be tagged with one or multiple 21 | tags. Selecting certain tags displays all windows with these tags. 22 | .P 23 | Each screen contains a small status bar which displays all available tags, the 24 | layout, the title of the focused window, and the text read from the root window 25 | name property, if the screen is focused. A floating window is indicated with an 26 | empty square and a maximised floating window is indicated with a filled square 27 | before the windows title. The selected tags are indicated with a different 28 | color. The tags of the focused window are indicated with a filled square in the 29 | top left corner. The tags which are applied to one or more windows are 30 | indicated with an empty square in the top left corner. 31 | .P 32 | dwm draws a small border around windows to indicate the focus state. 33 | .P 34 | On start, dwm can start additional programs that may be specified in two special 35 | shell scripts (see the FILES section below), autostart_blocking.sh and 36 | autostart.sh. The former is executed first and dwm will wait for its 37 | termination before starting. The latter is executed in the background before 38 | dwm enters its handler loop. 39 | .P 40 | Either of these files may be omitted. 41 | .SH OPTIONS 42 | .TP 43 | .B \-v 44 | prints version information to stderr, then exits. 45 | .SH USAGE 46 | .SS Status bar 47 | .TP 48 | .B X root window name 49 | is read and displayed in the status text area. It can be set with the 50 | .BR xsetroot (1) 51 | command. 52 | .TP 53 | .B Button1 54 | click on a tag label to display all windows with that tag, click on the layout 55 | label toggles between tiled and floating layout. 56 | .TP 57 | .B Button3 58 | click on a tag label adds/removes all windows with that tag to/from the view. 59 | .TP 60 | .B Mod1\-Button1 61 | click on a tag label applies that tag to the focused window. 62 | .TP 63 | .B Mod1\-Button3 64 | click on a tag label adds/removes that tag to/from the focused window. 65 | .SS Keyboard commands 66 | .TP 67 | .B Mod1\-Shift\-Return 68 | Start 69 | .BR st(1). 70 | .TP 71 | .B Mod1\-p 72 | Spawn 73 | .BR dmenu(1) 74 | for launching other programs. 75 | .TP 76 | .B Mod1\-, 77 | Focus previous screen, if any. 78 | .TP 79 | .B Mod1\-. 80 | Focus next screen, if any. 81 | .TP 82 | .B Mod1\-Shift\-, 83 | Send focused window to previous screen, if any. 84 | .TP 85 | .B Mod1\-Shift\-. 86 | Send focused window to next screen, if any. 87 | .TP 88 | .B Mod1\-b 89 | Toggles bar on and off. 90 | .TP 91 | .B Mod1\-t 92 | Sets tiled layout. 93 | .TP 94 | .B Mod1\-f 95 | Sets floating layout. 96 | .TP 97 | .B Mod1\-m 98 | Sets monocle layout. 99 | .TP 100 | .B Mod1\-space 101 | Toggles between current and previous layout. 102 | .TP 103 | .B Mod1\-j 104 | Focus next window. 105 | .TP 106 | .B Mod1\-k 107 | Focus previous window. 108 | .TP 109 | .B Mod1\-i 110 | Increase number of windows in master area. 111 | .TP 112 | .B Mod1\-d 113 | Decrease number of windows in master area. 114 | .TP 115 | .B Mod1\-l 116 | Increase master area size. 117 | .TP 118 | .B Mod1\-h 119 | Decrease master area size. 120 | .TP 121 | .B Mod1\-Return 122 | Zooms/cycles focused window to/from master area (tiled layouts only). 123 | .TP 124 | .B Mod1\-Shift\-c 125 | Close focused window. 126 | .TP 127 | .B Mod1\-Shift\-space 128 | Toggle focused window between tiled and floating state. 129 | .TP 130 | .B Mod1\-Tab 131 | Toggles to the previously selected tags. 132 | .TP 133 | .B Mod1\-Shift\-[1..n] 134 | Apply nth tag to focused window. 135 | .TP 136 | .B Mod1\-Shift\-0 137 | Apply all tags to focused window. 138 | .TP 139 | .B Mod1\-Control\-Shift\-[1..n] 140 | Add/remove nth tag to/from focused window. 141 | .TP 142 | .B Mod1\-[1..n] 143 | View all windows with nth tag. 144 | .TP 145 | .B Mod1\-0 146 | View all windows with any tag. 147 | .TP 148 | .B Mod1\-Control\-[1..n] 149 | Add/remove all windows with nth tag to/from the view. 150 | .TP 151 | .B Mod1\-Shift\-q 152 | Quit dwm. 153 | .SS Mouse commands 154 | .TP 155 | .B Mod1\-Button1 156 | Move focused window while dragging. Tiled windows will be toggled to the floating state. 157 | .TP 158 | .B Mod1\-Button2 159 | Toggles focused window between floating and tiled state. 160 | .TP 161 | .B Mod1\-Button3 162 | Resize focused window while dragging. Tiled windows will be toggled to the floating state. 163 | .SH FILES 164 | The files containing programs to be started along with dwm are searched for in 165 | the following directories: 166 | .IP "1. $XDG_DATA_HOME/dwm" 167 | .IP "2. $HOME/.local/share/dwm" 168 | .IP "3. $HOME/.dwm" 169 | .P 170 | The first existing directory is scanned for any of the autostart files below. 171 | .TP 15 172 | autostart.sh 173 | This file is started as a shell background process before dwm enters its handler 174 | loop. 175 | .TP 15 176 | autostart_blocking.sh 177 | This file is started before any autostart.sh; dwm waits for its termination. 178 | .SH CUSTOMIZATION 179 | dwm is customized by creating a custom config.h and (re)compiling the source 180 | code. This keeps it fast, secure and simple. 181 | .SH SEE ALSO 182 | .BR dmenu (1), 183 | .BR st (1) 184 | .SH ISSUES 185 | Java applications which use the XToolkit/XAWT backend may draw grey windows 186 | only. The XToolkit/XAWT backend breaks ICCCM-compliance in recent JDK 1.5 and early 187 | JDK 1.6 versions, because it assumes a reparenting window manager. Possible workarounds 188 | are using JDK 1.4 (which doesn't contain the XToolkit/XAWT backend) or setting the 189 | environment variable 190 | .BR AWT_TOOLKIT=MToolkit 191 | (to use the older Motif backend instead) or running 192 | .B xprop -root -f _NET_WM_NAME 32a -set _NET_WM_NAME LG3D 193 | or 194 | .B wmname LG3D 195 | (to pretend that a non-reparenting window manager is running that the 196 | XToolkit/XAWT backend can recognize) or when using OpenJDK setting the environment variable 197 | .BR _JAVA_AWT_WM_NONREPARENTING=1 . 198 | .SH BUGS 199 | Send all bug reports with a patch to hackers@suckless.org. 200 | -------------------------------------------------------------------------------- /dwm/dwm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/dwm/dwm.o -------------------------------------------------------------------------------- /dwm/dwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/dwm/dwm.png -------------------------------------------------------------------------------- /dwm/patches/drw-patch-6.2.diff: -------------------------------------------------------------------------------- 1 | --- a/drw.c 2020-09-26 19:06:05.929479683 +0545 2 | +++ b/drw.c 2020-09-26 19:10:40.108541114 +0545 3 | @@ -133,19 +133,6 @@ 4 | die("no font specified."); 5 | } 6 | 7 | - /* Do not allow using color fonts. This is a workaround for a BadLength 8 | - * error from Xft with color glyphs. Modelled on the Xterm workaround. See 9 | - * https://bugzilla.redhat.com/show_bug.cgi?id=1498269 10 | - * https://lists.suckless.org/dev/1701/30932.html 11 | - * https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349 12 | - * and lots more all over the internet. 13 | - */ 14 | - FcBool iscol; 15 | - if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) { 16 | - XftFontClose(drw->dpy, xfont); 17 | - return NULL; 18 | - } 19 | - 20 | font = ecalloc(1, sizeof(Fnt)); 21 | font->xfont = xfont; 22 | font->pattern = pattern; 23 | -------------------------------------------------------------------------------- /dwm/patches/dwm-activetagindicatorbar-6.2.diff: -------------------------------------------------------------------------------- 1 | diff -up dwm-a/dwm.c dwm-b/dwm.c 2 | --- dwm-a/dwm.c 2019-02-02 06:55:28.000000000 -0600 3 | +++ dwm-b/dwm.c 2019-02-23 21:43:13.359179100 -0600 4 | @@ -719,9 +719,10 @@ drawbar(Monitor *m) 5 | drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); 6 | drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); 7 | if (occ & 1 << i) 8 | - drw_rect(drw, x + boxs, boxs, boxw, boxw, 9 | - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, 10 | - urg & 1 << i); 11 | + drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, 12 | + m == selmon && selmon->sel && selmon->sel->tags & 1 << i, 13 | + urg & 1 << i); 14 | + 15 | x += w; 16 | } 17 | w = blw = TEXTW(m->ltsymbol); 18 | -------------------------------------------------------------------------------- /dwm/patches/dwm-alpha-20180613-b69c870.diff: -------------------------------------------------------------------------------- 1 | From f699934b8c8a9c15988ad359bf8fedd6c55abd53 Mon Sep 17 00:00:00 2001 2 | From: Thomas Oltmann 3 | Date: Wed, 13 Jun 2018 19:46:26 +0200 4 | Subject: [PATCH] Allow dwm to have translucent bars, while keeping all the 5 | text on it opaque, just like the alpha-patch for st. Updated for b69c870. 6 | 7 | --- 8 | config.def.h | 7 ++++++ 9 | config.mk | 2 +- 10 | drw.c | 26 ++++++++++++----------- 11 | drw.h | 9 +++++--- 12 | dwm.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++------ 13 | 5 files changed, 82 insertions(+), 22 deletions(-) 14 | 15 | diff --git a/config.def.h b/config.def.h 16 | index 1c0b587..4f68fe8 100644 17 | --- a/config.def.h 18 | +++ b/config.def.h 19 | @@ -12,11 +12,18 @@ static const char col_gray2[] = "#444444"; 20 | static const char col_gray3[] = "#bbbbbb"; 21 | static const char col_gray4[] = "#eeeeee"; 22 | static const char col_cyan[] = "#005577"; 23 | +static const unsigned int baralpha = 0xd0; 24 | +static const unsigned int borderalpha = OPAQUE; 25 | static const char *colors[][3] = { 26 | /* fg bg border */ 27 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 28 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 29 | }; 30 | +static const unsigned int alphas[][3] = { 31 | + /* fg bg border */ 32 | + [SchemeNorm] = { OPAQUE, baralpha, borderalpha }, 33 | + [SchemeSel] = { OPAQUE, baralpha, borderalpha }, 34 | +}; 35 | 36 | /* tagging */ 37 | static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; 38 | diff --git a/config.mk b/config.mk 39 | index 25e2685..bef8de0 100644 40 | --- a/config.mk 41 | +++ b/config.mk 42 | @@ -22,7 +22,7 @@ FREETYPEINC = /usr/include/freetype2 43 | 44 | # includes and libs 45 | INCS = -I${X11INC} -I${FREETYPEINC} 46 | -LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} 47 | +LIBS = -L${X11LIB} -lX11 ${XINERAMALIBS} ${FREETYPELIBS} -lXrender 48 | 49 | # flags 50 | CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=2 -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS} 51 | diff --git a/drw.c b/drw.c 52 | index c638323..77fc113 100644 53 | --- a/drw.c 54 | +++ b/drw.c 55 | @@ -61,7 +61,7 @@ utf8decode(const char *c, long *u, size_t clen) 56 | } 57 | 58 | Drw * 59 | -drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) 60 | +drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap) 61 | { 62 | Drw *drw = ecalloc(1, sizeof(Drw)); 63 | 64 | @@ -70,8 +70,11 @@ drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h 65 | drw->root = root; 66 | drw->w = w; 67 | drw->h = h; 68 | - drw->drawable = XCreatePixmap(dpy, root, w, h, DefaultDepth(dpy, screen)); 69 | - drw->gc = XCreateGC(dpy, root, 0, NULL); 70 | + drw->visual = visual; 71 | + drw->depth = depth; 72 | + drw->cmap = cmap; 73 | + drw->drawable = XCreatePixmap(dpy, root, w, h, depth); 74 | + drw->gc = XCreateGC(dpy, drw->drawable, 0, NULL); 75 | XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); 76 | 77 | return drw; 78 | @@ -87,7 +90,7 @@ drw_resize(Drw *drw, unsigned int w, unsigned int h) 79 | drw->h = h; 80 | if (drw->drawable) 81 | XFreePixmap(drw->dpy, drw->drawable); 82 | - drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); 83 | + drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, drw->depth); 84 | } 85 | 86 | void 87 | @@ -180,21 +183,22 @@ drw_fontset_free(Fnt *font) 88 | } 89 | 90 | void 91 | -drw_clr_create(Drw *drw, Clr *dest, const char *clrname) 92 | +drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha) 93 | { 94 | if (!drw || !dest || !clrname) 95 | return; 96 | 97 | - if (!XftColorAllocName(drw->dpy, DefaultVisual(drw->dpy, drw->screen), 98 | - DefaultColormap(drw->dpy, drw->screen), 99 | + if (!XftColorAllocName(drw->dpy, drw->visual, drw->cmap, 100 | clrname, dest)) 101 | die("error, cannot allocate color '%s'", clrname); 102 | + 103 | + dest->pixel = (dest->pixel & 0x00ffffffU) | (alpha << 24); 104 | } 105 | 106 | /* Wrapper to create color schemes. The caller has to call free(3) on the 107 | * returned color scheme when done using it. */ 108 | Clr * 109 | -drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) 110 | +drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount) 111 | { 112 | size_t i; 113 | Clr *ret; 114 | @@ -204,7 +208,7 @@ drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount) 115 | return NULL; 116 | 117 | for (i = 0; i < clrcount; i++) 118 | - drw_clr_create(drw, &ret[i], clrnames[i]); 119 | + drw_clr_create(drw, &ret[i], clrnames[i], alphas[i]); 120 | return ret; 121 | } 122 | 123 | @@ -260,9 +264,7 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp 124 | } else { 125 | XSetForeground(drw->dpy, drw->gc, drw->scheme[invert ? ColFg : ColBg].pixel); 126 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); 127 | - d = XftDrawCreate(drw->dpy, drw->drawable, 128 | - DefaultVisual(drw->dpy, drw->screen), 129 | - DefaultColormap(drw->dpy, drw->screen)); 130 | + d = XftDrawCreate(drw->dpy, drw->drawable, drw->visual, drw->cmap); 131 | x += lpad; 132 | w -= lpad; 133 | } 134 | diff --git a/drw.h b/drw.h 135 | index 4bcd5ad..a56f523 100644 136 | --- a/drw.h 137 | +++ b/drw.h 138 | @@ -20,6 +20,9 @@ typedef struct { 139 | Display *dpy; 140 | int screen; 141 | Window root; 142 | + Visual *visual; 143 | + unsigned int depth; 144 | + Colormap cmap; 145 | Drawable drawable; 146 | GC gc; 147 | Clr *scheme; 148 | @@ -27,7 +30,7 @@ typedef struct { 149 | } Drw; 150 | 151 | /* Drawable abstraction */ 152 | -Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); 153 | +Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h, Visual *visual, unsigned int depth, Colormap cmap); 154 | void drw_resize(Drw *drw, unsigned int w, unsigned int h); 155 | void drw_free(Drw *drw); 156 | 157 | @@ -38,8 +41,8 @@ unsigned int drw_fontset_getwidth(Drw *drw, const char *text); 158 | void drw_font_getexts(Fnt *font, const char *text, unsigned int len, unsigned int *w, unsigned int *h); 159 | 160 | /* Colorscheme abstraction */ 161 | -void drw_clr_create(Drw *drw, Clr *dest, const char *clrname); 162 | -Clr *drw_scm_create(Drw *drw, const char *clrnames[], size_t clrcount); 163 | +void drw_clr_create(Drw *drw, Clr *dest, const char *clrname, unsigned int alpha); 164 | +Clr *drw_scm_create(Drw *drw, const char *clrnames[], const unsigned int alphas[], size_t clrcount); 165 | 166 | /* Cursor abstraction */ 167 | Cur *drw_cur_create(Drw *drw, int shape); 168 | diff --git a/dwm.c b/dwm.c 169 | index 4465af1..20f8309 100644 170 | --- a/dwm.c 171 | +++ b/dwm.c 172 | @@ -57,6 +57,8 @@ 173 | #define TAGMASK ((1 << LENGTH(tags)) - 1) 174 | #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad) 175 | 176 | +#define OPAQUE 0xffU 177 | + 178 | /* enums */ 179 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 180 | enum { SchemeNorm, SchemeSel }; /* color schemes */ 181 | @@ -232,6 +234,7 @@ static Monitor *wintomon(Window w); 182 | static int xerror(Display *dpy, XErrorEvent *ee); 183 | static int xerrordummy(Display *dpy, XErrorEvent *ee); 184 | static int xerrorstart(Display *dpy, XErrorEvent *ee); 185 | +static void xinitvisual(); 186 | static void zoom(const Arg *arg); 187 | 188 | /* variables */ 189 | @@ -268,6 +271,11 @@ static Drw *drw; 190 | static Monitor *mons, *selmon; 191 | static Window root, wmcheckwin; 192 | 193 | +static int useargb = 0; 194 | +static Visual *visual; 195 | +static int depth; 196 | +static Colormap cmap; 197 | + 198 | /* configuration, allows nested code to access above variables */ 199 | #include "config.h" 200 | 201 | @@ -1541,7 +1549,8 @@ setup(void) 202 | sw = DisplayWidth(dpy, screen); 203 | sh = DisplayHeight(dpy, screen); 204 | root = RootWindow(dpy, screen); 205 | - drw = drw_create(dpy, screen, root, sw, sh); 206 | + xinitvisual(); 207 | + drw = drw_create(dpy, screen, root, sw, sh, visual, depth, cmap); 208 | if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) 209 | die("no fonts could be loaded."); 210 | lrpad = drw->fonts->h; 211 | @@ -1569,7 +1578,7 @@ setup(void) 212 | /* init appearance */ 213 | scheme = ecalloc(LENGTH(colors), sizeof(Clr *)); 214 | for (i = 0; i < LENGTH(colors); i++) 215 | - scheme[i] = drw_scm_create(drw, colors[i], 3); 216 | + scheme[i] = drw_scm_create(drw, colors[i], alphas[i], 3); 217 | /* init bars */ 218 | updatebars(); 219 | updatestatus(); 220 | @@ -1804,16 +1813,18 @@ updatebars(void) 221 | Monitor *m; 222 | XSetWindowAttributes wa = { 223 | .override_redirect = True, 224 | - .background_pixmap = ParentRelative, 225 | + .background_pixel = 0, 226 | + .border_pixel = 0, 227 | + .colormap = cmap, 228 | .event_mask = ButtonPressMask|ExposureMask 229 | }; 230 | XClassHint ch = {"dwm", "dwm"}; 231 | for (m = mons; m; m = m->next) { 232 | if (m->barwin) 233 | continue; 234 | - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), 235 | - CopyFromParent, DefaultVisual(dpy, screen), 236 | - CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); 237 | + m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, depth, 238 | + InputOutput, visual, 239 | + CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa); 240 | XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); 241 | XMapRaised(dpy, m->barwin); 242 | XSetClassHint(dpy, m->barwin, &ch); 243 | @@ -2110,6 +2121,43 @@ xerrorstart(Display *dpy, XErrorEvent *ee) 244 | return -1; 245 | } 246 | 247 | +void 248 | +xinitvisual() 249 | +{ 250 | + XVisualInfo *infos; 251 | + XRenderPictFormat *fmt; 252 | + int nitems; 253 | + int i; 254 | + 255 | + XVisualInfo tpl = { 256 | + .screen = screen, 257 | + .depth = 32, 258 | + .class = TrueColor 259 | + }; 260 | + long masks = VisualScreenMask | VisualDepthMask | VisualClassMask; 261 | + 262 | + infos = XGetVisualInfo(dpy, masks, &tpl, &nitems); 263 | + visual = NULL; 264 | + for(i = 0; i < nitems; i ++) { 265 | + fmt = XRenderFindVisualFormat(dpy, infos[i].visual); 266 | + if (fmt->type == PictTypeDirect && fmt->direct.alphaMask) { 267 | + visual = infos[i].visual; 268 | + depth = infos[i].depth; 269 | + cmap = XCreateColormap(dpy, root, visual, AllocNone); 270 | + useargb = 1; 271 | + break; 272 | + } 273 | + } 274 | + 275 | + XFree(infos); 276 | + 277 | + if (! visual) { 278 | + visual = DefaultVisual(dpy, screen); 279 | + depth = DefaultDepth(dpy, screen); 280 | + cmap = DefaultColormap(dpy, screen); 281 | + } 282 | +} 283 | + 284 | void 285 | zoom(const Arg *arg) 286 | { 287 | -- 288 | 2.17.0 289 | 290 | -------------------------------------------------------------------------------- /dwm/patches/dwm-autostart-20200610-cb3f58a.diff: -------------------------------------------------------------------------------- 1 | From 37e970479dc5d40e57fc0cbfeaa5e39941483237 Mon Sep 17 00:00:00 2001 2 | From: Gan Ainm 3 | Date: Wed, 10 Jun 2020 10:59:02 +0000 4 | Subject: [PATCH] dwm-xdgautostart-6.2.diff 5 | 6 | =================================================================== 7 | --- 8 | dwm.1 | 23 +++++++++++++++++ 9 | dwm.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 10 | 2 files changed, 105 insertions(+) 11 | 12 | diff --git a/dwm.1 b/dwm.1 13 | index 13b3729..9533aa6 100644 14 | --- a/dwm.1 15 | +++ b/dwm.1 16 | @@ -30,6 +30,14 @@ top left corner. The tags which are applied to one or more windows are 17 | indicated with an empty square in the top left corner. 18 | .P 19 | dwm draws a small border around windows to indicate the focus state. 20 | +.P 21 | +On start, dwm can start additional programs that may be specified in two special 22 | +shell scripts (see the FILES section below), autostart_blocking.sh and 23 | +autostart.sh. The former is executed first and dwm will wait for its 24 | +termination before starting. The latter is executed in the background before 25 | +dwm enters its handler loop. 26 | +.P 27 | +Either of these files may be omitted. 28 | .SH OPTIONS 29 | .TP 30 | .B \-v 31 | @@ -152,6 +160,21 @@ Toggles focused window between floating and tiled state. 32 | .TP 33 | .B Mod1\-Button3 34 | Resize focused window while dragging. Tiled windows will be toggled to the floating state. 35 | +.SH FILES 36 | +The files containing programs to be started along with dwm are searched for in 37 | +the following directories: 38 | +.IP "1. $XDG_DATA_HOME/dwm" 39 | +.IP "2. $HOME/.local/share/dwm" 40 | +.IP "3. $HOME/.dwm" 41 | +.P 42 | +The first existing directory is scanned for any of the autostart files below. 43 | +.TP 15 44 | +autostart.sh 45 | +This file is started as a shell background process before dwm enters its handler 46 | +loop. 47 | +.TP 15 48 | +autostart_blocking.sh 49 | +This file is started before any autostart.sh; dwm waits for its termination. 50 | .SH CUSTOMIZATION 51 | dwm is customized by creating a custom config.h and (re)compiling the source 52 | code. This keeps it fast, secure and simple. 53 | diff --git a/dwm.c b/dwm.c 54 | index 4465af1..2156b49 100644 55 | --- a/dwm.c 56 | +++ b/dwm.c 57 | @@ -29,6 +29,7 @@ 58 | #include 59 | #include 60 | #include 61 | +#include 62 | #include 63 | #include 64 | #include 65 | @@ -193,6 +194,7 @@ static void resizeclient(Client *c, int x, int y, int w, int h); 66 | static void resizemouse(const Arg *arg); 67 | static void restack(Monitor *m); 68 | static void run(void); 69 | +static void runautostart(void); 70 | static void scan(void); 71 | static int sendevent(Client *c, Atom proto); 72 | static void sendmon(Client *c, Monitor *m); 73 | @@ -235,7 +237,11 @@ static int xerrorstart(Display *dpy, XErrorEvent *ee); 74 | static void zoom(const Arg *arg); 75 | 76 | /* variables */ 77 | +static const char autostartblocksh[] = "autostart_blocking.sh"; 78 | +static const char autostartsh[] = "autostart.sh"; 79 | static const char broken[] = "broken"; 80 | +static const char dwmdir[] = "dwm"; 81 | +static const char localshare[] = ".local/share"; 82 | static char stext[256]; 83 | static int screen; 84 | static int sw, sh; /* X display screen geometry width, height */ 85 | @@ -1380,6 +1386,83 @@ run(void) 86 | handler[ev.type](&ev); /* call handler */ 87 | } 88 | 89 | +void 90 | +runautostart(void) 91 | +{ 92 | + char *pathpfx; 93 | + char *path; 94 | + char *xdgdatahome; 95 | + char *home; 96 | + struct stat sb; 97 | + 98 | + if ((home = getenv("HOME")) == NULL) 99 | + /* this is almost impossible */ 100 | + return; 101 | + 102 | + /* if $XDG_DATA_HOME is set and not empty, use $XDG_DATA_HOME/dwm, 103 | + * otherwise use ~/.local/share/dwm as autostart script directory 104 | + */ 105 | + xdgdatahome = getenv("XDG_DATA_HOME"); 106 | + if (xdgdatahome != NULL && *xdgdatahome != '\0') { 107 | + /* space for path segments, separators and nul */ 108 | + pathpfx = ecalloc(1, strlen(xdgdatahome) + strlen(dwmdir) + 2); 109 | + 110 | + if (sprintf(pathpfx, "%s/%s", xdgdatahome, dwmdir) <= 0) { 111 | + free(pathpfx); 112 | + return; 113 | + } 114 | + } else { 115 | + /* space for path segments, separators and nul */ 116 | + pathpfx = ecalloc(1, strlen(home) + strlen(localshare) 117 | + + strlen(dwmdir) + 3); 118 | + 119 | + if (sprintf(pathpfx, "%s/%s/%s", home, localshare, dwmdir) < 0) { 120 | + free(pathpfx); 121 | + return; 122 | + } 123 | + } 124 | + 125 | + /* check if the autostart script directory exists */ 126 | + if (! (stat(pathpfx, &sb) == 0 && S_ISDIR(sb.st_mode))) { 127 | + /* the XDG conformant path does not exist or is no directory 128 | + * so we try ~/.dwm instead 129 | + */ 130 | + char *pathpfx_new = realloc(pathpfx, strlen(home) + strlen(dwmdir) + 3); 131 | + if(pathpfx_new == NULL) { 132 | + free(pathpfx); 133 | + return; 134 | + } 135 | + pathpfx = pathpfx_new; 136 | + 137 | + if (sprintf(pathpfx, "%s/.%s", home, dwmdir) <= 0) { 138 | + free(pathpfx); 139 | + return; 140 | + } 141 | + } 142 | + 143 | + /* try the blocking script first */ 144 | + path = ecalloc(1, strlen(pathpfx) + strlen(autostartblocksh) + 2); 145 | + if (sprintf(path, "%s/%s", pathpfx, autostartblocksh) <= 0) { 146 | + free(path); 147 | + free(pathpfx); 148 | + } 149 | + 150 | + if (access(path, X_OK) == 0) 151 | + system(path); 152 | + 153 | + /* now the non-blocking script */ 154 | + if (sprintf(path, "%s/%s", pathpfx, autostartsh) <= 0) { 155 | + free(path); 156 | + free(pathpfx); 157 | + } 158 | + 159 | + if (access(path, X_OK) == 0) 160 | + system(strcat(path, " &")); 161 | + 162 | + free(pathpfx); 163 | + free(path); 164 | +} 165 | + 166 | void 167 | scan(void) 168 | { 169 | @@ -2142,6 +2223,7 @@ main(int argc, char *argv[]) 170 | die("pledge"); 171 | #endif /* __OpenBSD__ */ 172 | scan(); 173 | + runautostart(); 174 | run(); 175 | cleanup(); 176 | XCloseDisplay(dpy); 177 | -- 178 | 2.27.0 179 | 180 | -------------------------------------------------------------------------------- /dwm/patches/dwm-bar-height-6.2.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index 1c0b587..9814500 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ 6 | static const unsigned int snap = 32; /* snap pixel */ 7 | static const int showbar = 1; /* 0 means no bar */ 8 | static const int topbar = 1; /* 0 means bottom bar */ 9 | +static const int user_bh = 0; /* 0 means that dwm will calculate bar height, >= 1 means dwm will user_bh as bar height */ 10 | static const char *fonts[] = { "monospace:size=10" }; 11 | static const char dmenufont[] = "monospace:size=10"; 12 | static const char col_gray1[] = "#222222"; 13 | diff --git a/dwm.c b/dwm.c 14 | index 4465af1..2c27cb3 100644 15 | --- a/dwm.c 16 | +++ b/dwm.c 17 | @@ -1545,7 +1545,7 @@ setup(void) 18 | if (!drw_fontset_create(drw, fonts, LENGTH(fonts))) 19 | die("no fonts could be loaded."); 20 | lrpad = drw->fonts->h; 21 | - bh = drw->fonts->h + 2; 22 | + bh = user_bh ? user_bh : drw->fonts->h + 2; 23 | updategeom(); 24 | /* init atoms */ 25 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); 26 | -------------------------------------------------------------------------------- /dwm/patches/dwm-barpadding-6.2.diff: -------------------------------------------------------------------------------- 1 | Common subdirectories: dwm/.git and dwm-new/.git 2 | diff -up dwm/config.def.h dwm-new/config.def.h 3 | --- dwm/config.def.h 2019-12-10 17:24:37.944708263 +1300 4 | +++ dwm-new/config.def.h 2019-12-10 17:44:38.447670711 +1300 5 | @@ -5,6 +5,8 @@ static const unsigned int borderpx = 1; 6 | static const unsigned int snap = 32; /* snap pixel */ 7 | static const int showbar = 1; /* 0 means no bar */ 8 | static const int topbar = 1; /* 0 means bottom bar */ 9 | +static const int vertpad = 10; /* vertical padding of bar */ 10 | +static const int sidepad = 10; /* horizontal padding of bar */ 11 | static const char *fonts[] = { "monospace:size=10" }; 12 | static const char dmenufont[] = "monospace:size=10"; 13 | static const char col_gray1[] = "#222222"; 14 | diff -up dwm/dwm.c dwm-new/dwm.c 15 | --- dwm/dwm.c 2019-12-10 17:24:37.945708263 +1300 16 | +++ dwm-new/dwm.c 2019-12-10 17:41:46.192676099 +1300 17 | @@ -241,6 +241,8 @@ static int screen; 18 | static int sw, sh; /* X display screen geometry width, height */ 19 | static int bh, blw = 0; /* bar geometry */ 20 | static int lrpad; /* sum of left and right padding for text */ 21 | +static int vp; /* vertical padding for bar */ 22 | +static int sp; /* side padding for bar */ 23 | static int (*xerrorxlib)(Display *, XErrorEvent *); 24 | static unsigned int numlockmask = 0; 25 | static void (*handler[LASTEvent]) (XEvent *) = { 26 | @@ -567,7 +569,7 @@ configurenotify(XEvent *e) 27 | for (c = m->clients; c; c = c->next) 28 | if (c->isfullscreen) 29 | resizeclient(c, m->mx, m->my, m->mw, m->mh); 30 | - XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh); 31 | + XMoveResizeWindow(dpy, m->barwin, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh); 32 | } 33 | focus(NULL); 34 | arrange(NULL); 35 | @@ -705,7 +707,7 @@ drawbar(Monitor *m) 36 | if (m == selmon) { /* status is only drawn on selected monitor */ 37 | drw_setscheme(drw, scheme[SchemeNorm]); 38 | sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ 39 | - drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); 40 | + drw_text(drw, m->ww - sw - 2 * sp, 0, sw, bh, 0, stext, 0); 41 | } 42 | 43 | for (c = m->clients; c; c = c->next) { 44 | @@ -731,12 +733,12 @@ drawbar(Monitor *m) 45 | if ((w = m->ww - sw - x) > bh) { 46 | if (m->sel) { 47 | drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); 48 | - drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); 49 | + drw_text(drw, x, 0, w - 2 * sp, bh, lrpad / 2, m->sel->name, 0); 50 | if (m->sel->isfloating) 51 | drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); 52 | } else { 53 | drw_setscheme(drw, scheme[SchemeNorm]); 54 | - drw_rect(drw, x, 0, w, bh, 1, 1); 55 | + drw_rect(drw, x, 0, w - 2 * sp, bh, 1, 1); 56 | } 57 | } 58 | drw_map(drw, m->barwin, 0, 0, m->ww, bh); 59 | @@ -1547,6 +1549,9 @@ setup(void) 60 | lrpad = drw->fonts->h; 61 | bh = drw->fonts->h + 2; 62 | updategeom(); 63 | + sp = sidepad; 64 | + vp = (topbar == 1) ? vertpad : - vertpad; 65 | + 66 | /* init atoms */ 67 | utf8string = XInternAtom(dpy, "UTF8_STRING", False); 68 | wmatom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False); 69 | @@ -1573,6 +1578,7 @@ setup(void) 70 | /* init bars */ 71 | updatebars(); 72 | updatestatus(); 73 | + updatebarpos(selmon); 74 | /* supporting window for NetWMCheck */ 75 | wmcheckwin = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); 76 | XChangeProperty(dpy, wmcheckwin, netatom[NetWMCheck], XA_WINDOW, 32, 77 | @@ -1701,7 +1707,7 @@ togglebar(const Arg *arg) 78 | { 79 | selmon->showbar = !selmon->showbar; 80 | updatebarpos(selmon); 81 | - XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); 82 | + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh); 83 | arrange(selmon); 84 | } 85 | 86 | @@ -1811,7 +1817,7 @@ updatebars(void) 87 | for (m = mons; m; m = m->next) { 88 | if (m->barwin) 89 | continue; 90 | - m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen), 91 | + m->barwin = XCreateWindow(dpy, root, m->wx + sp, m->by + vp, m->ww - 2 * sp, bh, 0, DefaultDepth(dpy, screen), 92 | CopyFromParent, DefaultVisual(dpy, screen), 93 | CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa); 94 | XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor); 95 | @@ -1826,11 +1832,11 @@ updatebarpos(Monitor *m) 96 | m->wy = m->my; 97 | m->wh = m->mh; 98 | if (m->showbar) { 99 | - m->wh -= bh; 100 | - m->by = m->topbar ? m->wy : m->wy + m->wh; 101 | - m->wy = m->topbar ? m->wy + bh : m->wy; 102 | + m->wh = m->wh - vertpad - bh; 103 | + m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad; 104 | + m->wy = m->topbar ? m->wy + bh + vp : m->wy; 105 | } else 106 | - m->by = -bh; 107 | + m->by = -bh - vp; 108 | } 109 | 110 | void 111 | -------------------------------------------------------------------------------- /dwm/patches/dwm-colorbar-6.2.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index 1c0b587..a516645 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -16,6 +16,11 @@ static const char *colors[][3] = { 6 | /* fg bg border */ 7 | [SchemeNorm] = { col_gray3, col_gray1, col_gray2 }, 8 | [SchemeSel] = { col_gray4, col_cyan, col_cyan }, 9 | + [SchemeStatus] = { col_gray3, col_gray1, "#000000" }, // Statusbar right {text,background,not used but cannot be empty} 10 | + [SchemeTagsSel] = { col_gray4, col_cyan, "#000000" }, // Tagbar left selected {text,background,not used but cannot be empty} 11 | + [SchemeTagsNorm] = { col_gray3, col_gray1, "#000000" }, // Tagbar left unselected {text,background,not used but cannot be empty} 12 | + [SchemeInfoSel] = { col_gray4, col_cyan, "#000000" }, // infobar middle selected {text,background,not used but cannot be empty} 13 | + [SchemeInfoNorm] = { col_gray3, col_gray1, "#000000" }, // infobar middle unselected {text,background,not used but cannot be empty} 14 | }; 15 | 16 | /* tagging */ 17 | diff --git a/dwm.c b/dwm.c 18 | index 4465af1..0d1d2f7 100644 19 | --- a/dwm.c 20 | +++ b/dwm.c 21 | @@ -59,7 +59,7 @@ 22 | 23 | /* enums */ 24 | enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ 25 | -enum { SchemeNorm, SchemeSel }; /* color schemes */ 26 | +enum { SchemeNorm, SchemeSel, SchemeStatus, SchemeTagsSel, SchemeTagsNorm, SchemeInfoSel, SchemeInfoNorm }; /* color schemes */ 27 | enum { NetSupported, NetWMName, NetWMState, NetWMCheck, 28 | NetWMFullscreen, NetActiveWindow, NetWMWindowType, 29 | NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */ 30 | @@ -703,7 +703,7 @@ drawbar(Monitor *m) 31 | 32 | /* draw status first so it can be overdrawn by tags later */ 33 | if (m == selmon) { /* status is only drawn on selected monitor */ 34 | - drw_setscheme(drw, scheme[SchemeNorm]); 35 | + drw_setscheme(drw, scheme[SchemeStatus]); 36 | sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */ 37 | drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0); 38 | } 39 | @@ -716,7 +716,7 @@ drawbar(Monitor *m) 40 | x = 0; 41 | for (i = 0; i < LENGTH(tags); i++) { 42 | w = TEXTW(tags[i]); 43 | - drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); 44 | + drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]); 45 | drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); 46 | if (occ & 1 << i) 47 | drw_rect(drw, x + boxs, boxs, boxw, boxw, 48 | @@ -725,17 +725,17 @@ drawbar(Monitor *m) 49 | x += w; 50 | } 51 | w = blw = TEXTW(m->ltsymbol); 52 | - drw_setscheme(drw, scheme[SchemeNorm]); 53 | + drw_setscheme(drw, scheme[SchemeTagsNorm]); 54 | x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0); 55 | 56 | if ((w = m->ww - sw - x) > bh) { 57 | if (m->sel) { 58 | - drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]); 59 | + drw_setscheme(drw, scheme[m == selmon ? SchemeInfoSel : SchemeInfoNorm]); 60 | drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0); 61 | if (m->sel->isfloating) 62 | drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0); 63 | } else { 64 | - drw_setscheme(drw, scheme[SchemeNorm]); 65 | + drw_setscheme(drw, scheme[SchemeInfoNorm]); 66 | drw_rect(drw, x, 0, w, bh, 1, 1); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /dwm/patches/dwm-cropwindows-20170709-ceac8c9.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index a9ac303..a9797ac 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -105,8 +105,10 @@ static Button buttons[] = { 6 | { ClkWinTitle, 0, Button2, zoom, {0} }, 7 | { ClkStatusText, 0, Button2, spawn, {.v = termcmd } }, 8 | { ClkClientWin, MODKEY, Button1, movemouse, {0} }, 9 | + { ClkClientWin, MODKEY|ShiftMask, Button1, movemouse, {.i = 1} }, 10 | { ClkClientWin, MODKEY, Button2, togglefloating, {0} }, 11 | { ClkClientWin, MODKEY, Button3, resizemouse, {0} }, 12 | + { ClkClientWin, MODKEY|ShiftMask, Button3, resizemouse, {.i = 1} }, 13 | { ClkTagBar, 0, Button1, view, {0} }, 14 | { ClkTagBar, 0, Button3, toggleview, {0} }, 15 | { ClkTagBar, MODKEY, Button1, tag, {0} }, 16 | diff --git a/dwm.c b/dwm.c 17 | index a5ce993..e922ef6 100644 18 | --- a/dwm.c 19 | +++ b/dwm.c 20 | @@ -98,6 +98,7 @@ struct Client { 21 | Client *snext; 22 | Monitor *mon; 23 | Window win; 24 | + Client *crop; 25 | }; 26 | 27 | typedef struct { 28 | @@ -276,6 +277,88 @@ static Window root, wmcheckwin; 29 | struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; 30 | 31 | /* function implementations */ 32 | +Client * 33 | +cropwintoclient(Window w) 34 | +{ 35 | + Client *c; 36 | + Monitor *m; 37 | + 38 | + for (m = mons; m; m = m->next) 39 | + for (c = m->clients; c; c = c->next) 40 | + if (c->crop && c->crop->win == w) 41 | + return c; 42 | + return NULL; 43 | +} 44 | + 45 | +void 46 | +cropwindow(Client *c) 47 | +{ 48 | + int x, y; 49 | + XEvent ev; 50 | + XSetWindowAttributes wa = { .event_mask = SubstructureRedirectMask }; 51 | + 52 | + if (!getrootptr(&x, &y)) 53 | + return; 54 | + if (!c->crop) { 55 | + c->crop = ecalloc(1, sizeof(Client)); 56 | + memcpy(c->crop, c, sizeof(Client)); 57 | + c->crop->crop = NULL; 58 | + c->crop->x = c->crop->y = c->crop->bw = 0; 59 | + c->basew = c->baseh = c->mina = c->maxa = 0; 60 | + c->maxw = c->maxh = c->incw = c->inch = 0; 61 | + c->minw = c->minh = 1; 62 | + if (!c->isfloating) 63 | + togglefloating(NULL); 64 | + c->win = XCreateWindow(dpy, root, x, y, 1, 1, c->bw, 65 | + 0, 0, 0, CWEventMask, &wa); 66 | + XReparentWindow(dpy, c->crop->win, c->win, 0, 0); 67 | + XMapWindow(dpy, c->win); 68 | + focus(c); 69 | + XCheckTypedWindowEvent(dpy, c->crop->win, UnmapNotify, &ev); 70 | + if (XCheckTypedWindowEvent(dpy, root, UnmapNotify, &ev) 71 | + && ev.xunmap.window != c->crop->win) 72 | + XPutBackEvent(dpy, &ev); 73 | + } 74 | + resizeclient(c->crop, c->crop->x + c->x - x, c->crop->y + c->y - y, 75 | + c->crop->w, c->crop->h); 76 | + resizeclient(c, x, y, 1, 1); 77 | +} 78 | + 79 | +void 80 | +cropdelete(Client *c) 81 | +{ 82 | + Client *crop; 83 | + XEvent ev; 84 | + 85 | + c->crop->x += c->x; 86 | + c->crop->y += c->y; 87 | + c->crop->bw = c->bw; 88 | + c->crop->next = c->next; 89 | + c->crop->snext = c->snext; 90 | + c->crop->tags = c->tags; 91 | + c->crop->mon = c->mon; 92 | + XReparentWindow(dpy, c->crop->win, root, c->crop->x, c->crop->y); 93 | + XDestroyWindow(dpy, c->win); 94 | + crop = c->crop; 95 | + memcpy(c, c->crop, sizeof(Client)); 96 | + free(crop); 97 | + resize(c, c->x, c->y, c->w, c->h, 0); 98 | + focus(c); 99 | + XCheckTypedWindowEvent(dpy, c->win, UnmapNotify, &ev); 100 | +} 101 | + 102 | +void 103 | +cropresize(Client* c) 104 | +{ 105 | + resizeclient(c->crop, 106 | + BETWEEN(c->crop->x, -(c->crop->w), 0) ? c->crop->x : 0, 107 | + BETWEEN(c->crop->y, -(c->crop->h), 0) ? c->crop->y : 0, 108 | + c->crop->w, c->crop->h); 109 | + resize(c, c->x, c->y, 110 | + MIN(c->w, c->crop->x + c->crop->w), 111 | + MIN(c->h, c->crop->y + c->crop->h), 0); 112 | +} 113 | + 114 | void 115 | applyrules(Client *c) 116 | { 117 | @@ -516,7 +599,7 @@ clientmessage(XEvent *e) 118 | XClientMessageEvent *cme = &e->xclient; 119 | Client *c = wintoclient(cme->window); 120 | 121 | - if (!c) 122 | + if (!c && !(c = cropwintoclient(cme->window))) 123 | return; 124 | if (cme->message_type == netatom[NetWMState]) { 125 | if (cme->data.l[1] == netatom[NetWMFullscreen] 126 | @@ -579,16 +662,19 @@ configurenotify(XEvent *e) 127 | void 128 | configurerequest(XEvent *e) 129 | { 130 | - Client *c; 131 | + Client *c, *cc = NULL; 132 | Monitor *m; 133 | XConfigureRequestEvent *ev = &e->xconfigurerequest; 134 | XWindowChanges wc; 135 | 136 | - if ((c = wintoclient(ev->window))) { 137 | + if ((c = wintoclient(ev->window)) 138 | + || (c = cc = cropwintoclient(ev->window))) { 139 | if (ev->value_mask & CWBorderWidth) 140 | c->bw = ev->border_width; 141 | else if (c->isfloating || !selmon->lt[selmon->sellt]->arrange) { 142 | m = c->mon; 143 | + if (c->crop) 144 | + c = c->crop; 145 | if (ev->value_mask & CWX) { 146 | c->oldx = c->x; 147 | c->x = m->mx + ev->x; 148 | @@ -613,6 +699,8 @@ configurerequest(XEvent *e) 149 | configure(c); 150 | if (ISVISIBLE(c)) 151 | XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 152 | + if (cc) 153 | + cropresize(cc); 154 | } else 155 | configure(c); 156 | } else { 157 | @@ -651,7 +739,7 @@ destroynotify(XEvent *e) 158 | Client *c; 159 | XDestroyWindowEvent *ev = &e->xdestroywindow; 160 | 161 | - if ((c = wintoclient(ev->window))) 162 | + if ((c = wintoclient(ev->window)) || (c = cropwintoclient(ev->window))) 163 | unmanage(c, 1); 164 | } 165 | 166 | @@ -762,6 +850,8 @@ enternotify(XEvent *e) 167 | if ((ev->mode != NotifyNormal || ev->detail == NotifyInferior) && ev->window != root) 168 | return; 169 | c = wintoclient(ev->window); 170 | + if (!c) 171 | + c = cropwintoclient(ev->window); 172 | m = c ? c->mon : wintomon(ev->window); 173 | if (m != selmon) { 174 | unfocus(selmon->sel, 1); 175 | @@ -1005,6 +1095,8 @@ killclient(const Arg *arg) 176 | { 177 | if (!selmon->sel) 178 | return; 179 | + if (selmon->sel->crop) 180 | + cropdelete(selmon->sel); 181 | if (!sendevent(selmon->sel, wmatom[WMDelete])) { 182 | XGrabServer(dpy); 183 | XSetErrorHandler(xerrordummy); 184 | @@ -1150,6 +1242,10 @@ movemouse(const Arg *arg) 185 | restack(selmon); 186 | ocx = c->x; 187 | ocy = c->y; 188 | + if (arg->i == 1 && c->crop) { 189 | + ocx = c->crop->x; 190 | + ocy = c->crop->y; 191 | + } 192 | if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, 193 | None, cursor[CurMove]->cursor, CurrentTime) != GrabSuccess) 194 | return; 195 | @@ -1170,6 +1266,12 @@ movemouse(const Arg *arg) 196 | 197 | nx = ocx + (ev.xmotion.x - x); 198 | ny = ocy + (ev.xmotion.y - y); 199 | + if (arg->i == 1 && c->crop) { 200 | + c->crop->x = nx; 201 | + c->crop->y = ny; 202 | + cropresize(c); 203 | + continue; 204 | + } 205 | if (abs(selmon->wx - nx) < snap) 206 | nx = selmon->wx; 207 | else if (abs((selmon->wx + selmon->ww) - (nx + WIDTH(c))) < snap) 208 | @@ -1221,7 +1323,10 @@ propertynotify(XEvent *e) 209 | updatestatus(); 210 | else if (ev->state == PropertyDelete) 211 | return; /* ignore */ 212 | - else if ((c = wintoclient(ev->window))) { 213 | + else if ((c = wintoclient(ev->window)) 214 | + || (c = cropwintoclient(ev->window))) { 215 | + if (c->crop) 216 | + c = c->crop; 217 | switch(ev->atom) { 218 | default: break; 219 | case XA_WM_TRANSIENT_FOR: 220 | @@ -1303,12 +1408,16 @@ resizemouse(const Arg *arg) 221 | if (c->isfullscreen) /* no support resizing fullscreen windows by mouse */ 222 | return; 223 | restack(selmon); 224 | + if (arg->i == 1) 225 | + cropwindow(c); 226 | ocx = c->x; 227 | ocy = c->y; 228 | if (XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAsync, 229 | None, cursor[CurResize]->cursor, CurrentTime) != GrabSuccess) 230 | return; 231 | - XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->bw - 1, c->h + c->bw - 1); 232 | + if (arg->i != 1) 233 | + XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, 234 | + c->w + c->bw - 1, c->h + c->bw - 1); 235 | do { 236 | XMaskEvent(dpy, MOUSEMASK|ExposureMask|SubstructureRedirectMask, &ev); 237 | switch(ev.type) { 238 | @@ -1324,6 +1433,10 @@ resizemouse(const Arg *arg) 239 | 240 | nw = MAX(ev.xmotion.x - ocx - 2 * c->bw + 1, 1); 241 | nh = MAX(ev.xmotion.y - ocy - 2 * c->bw + 1, 1); 242 | + if (c->crop) { 243 | + nw = MIN(nw, c->crop->w + c->crop->x); 244 | + nh = MIN(nh, c->crop->h + c->crop->y); 245 | + } 246 | if (c->mon->wx + nw >= selmon->wx && c->mon->wx + nw <= selmon->wx + selmon->ww 247 | && c->mon->wy + nh >= selmon->wy && c->mon->wy + nh <= selmon->wy + selmon->wh) 248 | { 249 | @@ -1430,6 +1543,8 @@ setclientstate(Client *c, long state) 250 | { 251 | long data[] = { state, None }; 252 | 253 | + if (c->crop) 254 | + c = c->crop; 255 | XChangeProperty(dpy, c->win, wmatom[WMState], wmatom[WMState], 32, 256 | PropModeReplace, (unsigned char *)data, 2); 257 | } 258 | @@ -1462,6 +1577,8 @@ sendevent(Client *c, Atom proto) 259 | void 260 | setfocus(Client *c) 261 | { 262 | + if (c->crop) 263 | + c = c->crop; 264 | if (!c->neverfocus) { 265 | XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); 266 | XChangeProperty(dpy, root, netatom[NetActiveWindow], 267 | @@ -1474,6 +1591,8 @@ setfocus(Client *c) 268 | void 269 | setfullscreen(Client *c, int fullscreen) 270 | { 271 | + if (c->crop) 272 | + c = c->crop; 273 | if (fullscreen && !c->isfullscreen) { 274 | XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, 275 | PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); 276 | @@ -1718,6 +1837,8 @@ togglefloating(const Arg *arg) 277 | if (selmon->sel->isfloating) 278 | resize(selmon->sel, selmon->sel->x, selmon->sel->y, 279 | selmon->sel->w, selmon->sel->h, 0); 280 | + if (!selmon->sel->isfloating && selmon->sel->crop) 281 | + cropdelete(selmon->sel); 282 | arrange(selmon); 283 | } 284 | 285 | @@ -1767,6 +1888,8 @@ unmanage(Client *c, int destroyed) 286 | Monitor *m = c->mon; 287 | XWindowChanges wc; 288 | 289 | + if (c->crop) 290 | + cropdelete(c); 291 | detach(c); 292 | detachstack(c); 293 | if (!destroyed) { 294 | @@ -1792,7 +1915,8 @@ unmapnotify(XEvent *e) 295 | Client *c; 296 | XUnmapEvent *ev = &e->xunmap; 297 | 298 | - if ((c = wintoclient(ev->window))) { 299 | + if ((c = wintoclient(ev->window)) 300 | + || (c = cropwintoclient(ev->window))) { 301 | if (ev->send_event) 302 | setclientstate(c, WithdrawnState); 303 | else 304 | @@ -2070,7 +2194,7 @@ wintomon(Window w) 305 | for (m = mons; m; m = m->next) 306 | if (w == m->barwin) 307 | return m; 308 | - if ((c = wintoclient(w))) 309 | + if ((c = wintoclient(w)) || (c = cropwintoclient(w))) 310 | return c->mon; 311 | return selmon; 312 | } 313 | -------------------------------------------------------------------------------- /dwm/patches/dwm-fullgaps-6.2.diff: -------------------------------------------------------------------------------- 1 | diff --git a/config.def.h b/config.def.h 2 | index 1c0b587..38d2f6c 100644 3 | --- a/config.def.h 4 | +++ b/config.def.h 5 | @@ -2,6 +2,7 @@ 6 | 7 | /* appearance */ 8 | static const unsigned int borderpx = 1; /* border pixel of windows */ 9 | +static const unsigned int gappx = 5; /* gaps between windows */ 10 | static const unsigned int snap = 32; /* snap pixel */ 11 | static const int showbar = 1; /* 0 means no bar */ 12 | static const int topbar = 1; /* 0 means bottom bar */ 13 | @@ -84,6 +85,9 @@ static Key keys[] = { 14 | { MODKEY, XK_period, focusmon, {.i = +1 } }, 15 | { MODKEY|ShiftMask, XK_comma, tagmon, {.i = -1 } }, 16 | { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } }, 17 | + { MODKEY, XK_minus, setgaps, {.i = -1 } }, 18 | + { MODKEY, XK_equal, setgaps, {.i = +1 } }, 19 | + { MODKEY|ShiftMask, XK_equal, setgaps, {.i = 0 } }, 20 | TAGKEYS( XK_1, 0) 21 | TAGKEYS( XK_2, 1) 22 | TAGKEYS( XK_3, 2) 23 | diff --git a/dwm.c b/dwm.c 24 | index 4465af1..4363627 100644 25 | --- a/dwm.c 26 | +++ b/dwm.c 27 | @@ -119,6 +119,7 @@ struct Monitor { 28 | int by; /* bar geometry */ 29 | int mx, my, mw, mh; /* screen size */ 30 | int wx, wy, ww, wh; /* window area */ 31 | + int gappx; /* gaps between windows */ 32 | unsigned int seltags; 33 | unsigned int sellt; 34 | unsigned int tagset[2]; 35 | @@ -199,6 +200,7 @@ static void sendmon(Client *c, Monitor *m); 36 | static void setclientstate(Client *c, long state); 37 | static void setfocus(Client *c); 38 | static void setfullscreen(Client *c, int fullscreen); 39 | +static void setgaps(const Arg *arg); 40 | static void setlayout(const Arg *arg); 41 | static void setmfact(const Arg *arg); 42 | static void setup(void); 43 | @@ -638,6 +640,7 @@ createmon(void) 44 | m->nmaster = nmaster; 45 | m->showbar = showbar; 46 | m->topbar = topbar; 47 | + m->gappx = gappx; 48 | m->lt[0] = &layouts[0]; 49 | m->lt[1] = &layouts[1 % LENGTH(layouts)]; 50 | strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol); 51 | @@ -1497,6 +1500,16 @@ setfullscreen(Client *c, int fullscreen) 52 | } 53 | } 54 | 55 | +void 56 | +setgaps(const Arg *arg) 57 | +{ 58 | + if ((arg->i == 0) || (selmon->gappx + arg->i < 0)) 59 | + selmon->gappx = 0; 60 | + else 61 | + selmon->gappx += arg->i; 62 | + arrange(selmon); 63 | +} 64 | + 65 | void 66 | setlayout(const Arg *arg) 67 | { 68 | @@ -1683,16 +1696,16 @@ tile(Monitor *m) 69 | if (n > m->nmaster) 70 | mw = m->nmaster ? m->ww * m->mfact : 0; 71 | else 72 | - mw = m->ww; 73 | - for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 74 | + mw = m->ww - m->gappx; 75 | + for (i = 0, my = ty = m->gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) 76 | if (i < m->nmaster) { 77 | - h = (m->wh - my) / (MIN(n, m->nmaster) - i); 78 | - resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0); 79 | - my += HEIGHT(c); 80 | + h = (m->wh - my) / (MIN(n, m->nmaster) - i) - m->gappx; 81 | + resize(c, m->wx + m->gappx, m->wy + my, mw - (2*c->bw) - m->gappx, h - (2*c->bw), 0); 82 | + my += HEIGHT(c) + m->gappx; 83 | } else { 84 | - h = (m->wh - ty) / (n - i); 85 | - resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0); 86 | - ty += HEIGHT(c); 87 | + h = (m->wh - ty) / (n - i) - m->gappx; 88 | + resize(c, m->wx + mw + m->gappx, m->wy + ty, m->ww - mw - (2*c->bw) - 2*m->gappx, h - (2*c->bw), 0); 89 | + ty += HEIGHT(c) + m->gappx; 90 | } 91 | } 92 | 93 | -- 94 | 2.20.1 95 | 96 | -------------------------------------------------------------------------------- /dwm/patches/dwm-hide_vacant_tags-6.2.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index 4465af1..c4aa3de 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -416,7 +416,7 @@ attachstack(Client *c) 6 | void 7 | buttonpress(XEvent *e) 8 | { 9 | - unsigned int i, x, click; 10 | + unsigned int i, x, click, occ = 0; 11 | Arg arg = {0}; 12 | Client *c; 13 | Monitor *m; 14 | @@ -431,9 +431,14 @@ buttonpress(XEvent *e) 15 | } 16 | if (ev->window == selmon->barwin) { 17 | i = x = 0; 18 | - do 19 | + for (c = m->clients; c; c = c->next) 20 | + occ |= c->tags == 255 ? 0 : c->tags; 21 | + do { 22 | + /* do not reserve space for vacant tags */ 23 | + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) 24 | + continue; 25 | x += TEXTW(tags[i]); 26 | - while (ev->x >= x && ++i < LENGTH(tags)); 27 | + } while (ev->x >= x && ++i < LENGTH(tags)); 28 | if (i < LENGTH(tags)) { 29 | click = ClkTagBar; 30 | arg.ui = 1 << i; 31 | @@ -709,19 +714,19 @@ drawbar(Monitor *m) 32 | } 33 | 34 | for (c = m->clients; c; c = c->next) { 35 | - occ |= c->tags; 36 | + occ |= c->tags == 255 ? 0 : c->tags; 37 | if (c->isurgent) 38 | urg |= c->tags; 39 | } 40 | x = 0; 41 | for (i = 0; i < LENGTH(tags); i++) { 42 | + /* do not draw vacant tags */ 43 | + if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) 44 | + continue; 45 | + 46 | w = TEXTW(tags[i]); 47 | drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]); 48 | drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i); 49 | - if (occ & 1 << i) 50 | - drw_rect(drw, x + boxs, boxs, boxw, boxw, 51 | - m == selmon && selmon->sel && selmon->sel->tags & 1 << i, 52 | - urg & 1 << i); 53 | x += w; 54 | } 55 | w = blw = TEXTW(m->ltsymbol); 56 | -------------------------------------------------------------------------------- /dwm/patches/dwm-removeborder-20200520-f09418b.diff: -------------------------------------------------------------------------------- 1 | diff --git a/dwm.c b/dwm.c 2 | index 9fd0286..dcdbc38 100644 3 | --- a/dwm.c 4 | +++ b/dwm.c 5 | @@ -1277,12 +1277,24 @@ void 6 | resizeclient(Client *c, int x, int y, int w, int h) 7 | { 8 | XWindowChanges wc; 9 | + unsigned int n; 10 | + Client *nbc; 11 | 12 | c->oldx = c->x; c->x = wc.x = x; 13 | c->oldy = c->y; c->y = wc.y = y; 14 | c->oldw = c->w; c->w = wc.width = w; 15 | c->oldh = c->h; c->h = wc.height = h; 16 | wc.border_width = c->bw; 17 | + 18 | + for (n = 0, nbc = nexttiled(selmon->clients); nbc; nbc = nexttiled(nbc->next), n++); 19 | + 20 | + if (c->isfloating || selmon->lt[selmon->sellt]->arrange == NULL) { 21 | + } else { 22 | + if (selmon->lt[selmon->sellt]->arrange == monocle || n == 1) { 23 | + wc.border_width = 0; 24 | + } 25 | + } 26 | + 27 | XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 28 | configure(c); 29 | XSync(dpy, False); 30 | -------------------------------------------------------------------------------- /dwm/transient.c: -------------------------------------------------------------------------------- 1 | /* cc transient.c -o transient -lX11 */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(void) { 9 | Display *d; 10 | Window r, f, t = None; 11 | XSizeHints h; 12 | XEvent e; 13 | 14 | d = XOpenDisplay(NULL); 15 | if (!d) 16 | exit(1); 17 | r = DefaultRootWindow(d); 18 | 19 | f = XCreateSimpleWindow(d, r, 100, 100, 400, 400, 0, 0, 0); 20 | h.min_width = h.max_width = h.min_height = h.max_height = 400; 21 | h.flags = PMinSize | PMaxSize; 22 | XSetWMNormalHints(d, f, &h); 23 | XStoreName(d, f, "floating"); 24 | XMapWindow(d, f); 25 | 26 | XSelectInput(d, f, ExposureMask); 27 | while (1) { 28 | XNextEvent(d, &e); 29 | 30 | if (t == None) { 31 | sleep(5); 32 | t = XCreateSimpleWindow(d, r, 50, 50, 100, 100, 0, 0, 0); 33 | XSetTransientForHint(d, t, f); 34 | XStoreName(d, t, "transient"); 35 | XMapWindow(d, t); 36 | XSelectInput(d, t, ExposureMask); 37 | } 38 | } 39 | 40 | XCloseDisplay(d); 41 | exit(0); 42 | } 43 | -------------------------------------------------------------------------------- /dwm/util.c: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #include "util.h" 8 | 9 | void * 10 | ecalloc(size_t nmemb, size_t size) 11 | { 12 | void *p; 13 | 14 | if (!(p = calloc(nmemb, size))) 15 | die("calloc:"); 16 | return p; 17 | } 18 | 19 | void 20 | die(const char *fmt, ...) { 21 | va_list ap; 22 | 23 | va_start(ap, fmt); 24 | vfprintf(stderr, fmt, ap); 25 | va_end(ap); 26 | 27 | if (fmt[0] && fmt[strlen(fmt)-1] == ':') { 28 | fputc(' ', stderr); 29 | perror(NULL); 30 | } else { 31 | fputc('\n', stderr); 32 | } 33 | 34 | exit(1); 35 | } 36 | -------------------------------------------------------------------------------- /dwm/util.h: -------------------------------------------------------------------------------- 1 | /* See LICENSE file for copyright and license details. */ 2 | 3 | #define MAX(A, B) ((A) > (B) ? (A) : (B)) 4 | #define MIN(A, B) ((A) < (B) ? (A) : (B)) 5 | #define BETWEEN(X, A, B) ((A) <= (X) && (X) <= (B)) 6 | 7 | void die(const char *fmt, ...); 8 | void *ecalloc(size_t nmemb, size_t size); 9 | -------------------------------------------------------------------------------- /dwm/util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/dwm/util.o -------------------------------------------------------------------------------- /myscripts/bar/dwm_battery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function to read the battery level and status 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | dwm_battery () { 8 | # Change BAT1 to whatever your battery is identified as. Typically BAT0 or BAT1 9 | CHARGE=$(cat /sys/class/power_supply/BAT0/capacity) 10 | STATUS=$(cat /sys/class/power_supply/BAT0/status) 11 | 12 | printf "%s" "$SEP1" 13 | if [ "$IDENTIFIER" = "unicode" ]; then 14 | if [ "$STATUS" = "Charging" ]; then 15 | printf " %s%% %s" "$CHARGE" "$STATUS" #🔌 16 | elif [ $CHARGE -lt 75 ] && [ $CHARGE -gt 50 ]; then 17 | printf " %s%% %s" "$CHARGE" "$STATUS" 18 | elif [ $CHARGE -lt 50 ] && [ $CHARGE -gt 25 ]; then 19 | printf " %s%% %s" "$CHARGE" "$STATUS" 20 | elif [ $CHARGE -lt 25 ] && [ $CHARGE -gt 10 ]; then 21 | printf " %s%% %s" "$CHARGE" "$STATUS" 22 | elif [ $CHARGE -lt 10 ]; then 23 | printf " %s%% %s" "$CHARGE" "$STATUS" 24 | else 25 | printf " %s%% %s" "$CHARGE" "$STATUS" #🔋 26 | fi 27 | else 28 | printf "BAT %s%% %s" "$CHARGE" "$STATUS" 29 | fi 30 | printf "%s" #"$SEP2" 31 | } 32 | 33 | dwm_battery 34 | 35 | -------------------------------------------------------------------------------- /myscripts/bar/dwm_date.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function that shows the current date and time 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | # Date is formatted like like this: "[Mon 01-01-00 00:00:00]" 8 | dwm_date () { 9 | printf "%s" "$SEP1" 10 | if [ "$IDENTIFIER" = "unicode" ]; then 11 | printf " %s" "$(date "+%a %d-%m-%y %H:%M")" 12 | else 13 | printf "DAT %s" "$(date "+%a %d-%m-%y %H:%M")" 14 | fi 15 | printf "%s" "$SEP2" 16 | } 17 | 18 | dwm_date 19 | -------------------------------------------------------------------------------- /myscripts/bar/dwm_inhibitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | dwm_inhibitor () { 3 | INHIBITPID=$(pgrep foo.sh) 4 | 5 | printf "%s" "$SEP1" 6 | if [ -z "$(pgrep foo.sh)" ] 7 | then 8 | printf "" 9 | else 10 | printf "" 11 | fi 12 | printf "%s" " " 13 | } 14 | dwm_inhibitor 15 | -------------------------------------------------------------------------------- /myscripts/bar/dwm_networkmanager.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # A dwm_bar function to show the current network connection/SSID, private IP, and public IP using NetworkManager 4 | # Joe Standring 5 | # GNU GPLv3 6 | 7 | # Dependencies: NetworkManager, curl 8 | 9 | dwm_networkmanager () { 10 | CONNAME=$(nmcli -a | grep 'Wired connection' | awk 'NR==1{print $1}') 11 | if [ "$CONNAME" = "" ]; then 12 | CONNAME=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -c 5-) 13 | fi 14 | 15 | PRIVATE=$(nmcli -a | grep 'inet4 192' | awk '{print $2}') 16 | PUBLIC=$(curl -s https://ipinfo.io/ip) 17 | 18 | printf "%s" "$SEP1" 19 | if [ "$IDENTIFIER" = "unicode" ]; then 20 | printf " %s %s" "$CONNAME" ########"$PRIVATE" "$PUBLIC"🌐 21 | else 22 | printf "NET %s %s" "$CONNAME" ####### "$PRIVATE" "$PUBLIC" 23 | fi 24 | printf "%s" #"$SEP2" 25 | } 26 | 27 | dwm_networkmanager 28 | -------------------------------------------------------------------------------- /myscripts/deactivate_inhibitor.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | if [ -z "$(pgrep foo.sh)" ] 3 | then 4 | notify-send "Inhibitor Was Not Active." 5 | else 6 | kill -15 $(pgrep foo.sh) && notify-send "Inhibitor" "Deactivated" 7 | fi 8 | 9 | 10 | -------------------------------------------------------------------------------- /myscripts/inhibitor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | me="$(basename "$0")"; 3 | running=$(ps h -C "$me" | grep -wv $$ | wc -l); 4 | [[ $running > 1 ]] && notify-send "Inhibitor Already Active"&& exit; 5 | 6 | notify-send "Inhibitor" "Activated" 7 | while sleep 30; do xdotool keydown Shift_L keyup Shift_L; done 8 | 9 | -------------------------------------------------------------------------------- /myscripts/lock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | xset s 240 & 3 | xautolock -time 2 -locker "betterlockscreen -l" -notify 30 -notifier "notify-send 'Locker' 'Locking screen in 30 seconds'" -killtime 5 -killer "systemctl suspend" 4 | #xautolock -time 2 -locker "systemctl suspend" 5 | -------------------------------------------------------------------------------- /rofi-spotlight/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Gerome Matilla 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /rofi-spotlight/README.md: -------------------------------------------------------------------------------- 1 | A Spotlight-like rofi. Supports file and web search. 2 | 3 | | File Browsing | Context Menu | 4 | | --- | --- | 5 | | ![screenshot](screenshots/main.png) | ![screenshot](screenshots/menu.png) | 6 | 7 | | Google Results | DuckDuckGo Results 8 | | --- | --- | 9 | | ![screenshot](screenshots/rofi-web-google.png) | ![screenshot](screenshots/rofi-web-ddg.png) | 10 | 11 | This rofi will supposed to replace the web search in my awesome-wm setups. 12 | 13 | #### Dependencies 14 | + `rofi-git master branch` 15 | + `python3` 16 | + `bash` 17 | + `an icon theme (optional)` 18 | 19 | #### Icon themes used: 20 | + Papirus 21 | + Tela Blue 22 | 23 | #### Run it by: 24 | 25 | ```bash 26 | $ rofi -modi "Global Search":"rofi-spotlight/rofi-spotlight.sh" -show "Global Search" \ 27 | -config rofi-spotlight/rofi.rasi 28 | ``` 29 | 30 | #### Configuration: 31 | You can change the following variables in the `rofi-spotlight.sh` 32 | + Terminal Emulator 33 | + File Manager 34 | + Bluetooth sender 35 | 36 | You can change the following variables in the `web-search.py` 37 | + Search engine 38 | + Web browser 39 | + Terminal Emulator 40 | 41 | #### Available commands: 42 | 43 | Just type them on rofi search bar: 44 | 45 | + **`:help`** to print the help message 46 | + **`:h`** or **`:hidden`** to show hidden files/directories 47 | + **`:xdg XDGDIR`** to jump to an xdg directory 48 | 49 | Examples: 50 | 51 | ``` 52 | :xdg DOCUMENTS 53 | :xdg DOWNLOADS 54 | 55 | # Also supports incomplete path. Examples: 56 | 57 | :xdg doc # Same as :xdg DOCUMENTS 58 | :xdg down # Same as :xdg DOWNLOADS 59 | 60 | # For more info about XDG dirs, see: 61 | # man xdg-user-dir 62 | ``` 63 | 64 | **File search syntaxes:** 65 | + **`!`** to search for a file and web suggestions 66 | + **`?`** to search parent directories 67 | 68 | Examples: 69 | 70 | ``` 71 | !half-life 3 72 | ?portal 3 73 | ``` 74 | 75 | **Web search syntaxes:** 76 | 77 | + **`!`** to get a search suggestions 78 | + **`:web `** to also to gets search suggestions 79 | + **`:webbro `** to search directly from your browser 80 | 81 | Examples: 82 | 83 | ``` 84 | !how to install archlinux 85 | :web how to install gentoo 86 | :webbro how to install wine in windowsxp 87 | ``` 88 | 89 | #### TODOs: 90 | - [x] Web search support 91 | - [ ] Cleaner bash script 92 | 93 | #### Notes: 94 | 95 | + This is not a file manager and web a browser. This is meant to be a file/web-searching rofi. Nothing else. 96 | + I'm fairly new on scripting something like this big, so pardon me if my code is kinda ugly, boilerplate and obscure. I will improve this from time to time, for sure. 97 | + Better with blur. Rofi's appearance can be change in `rofi.rasi`. It uses CSS syntax. More info by executing `man rofi-theme` in your terminal emulator. 98 | -------------------------------------------------------------------------------- /rofi-spotlight/history.txt: -------------------------------------------------------------------------------- 1 | ! fire 2 | !install arch 3 | !nord theme 4 | !himeno chainsawman 5 | -------------------------------------------------------------------------------- /rofi-spotlight/icons/google.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 20 | 22 | 23 | 25 | image/svg+xml 26 | 28 | 29 | 30 | 31 | 32 | 34 | 55 | 365 | 366 | -------------------------------------------------------------------------------- /rofi-spotlight/icons/history.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 54 | 58 | 66 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /rofi-spotlight/icons/result.svg: -------------------------------------------------------------------------------- 1 | 2 | 17 | 19 | 20 | 22 | image/svg+xml 23 | 25 | 26 | 27 | 28 | 29 | 31 | 52 | 57 | 58 | -------------------------------------------------------------------------------- /rofi-spotlight/rofi-spotlight.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ---------------------------------------------------------------------------- 4 | # --- Rofi File Browser 5 | # -- 6 | # -- 7 | # -- @author manilarome <gerome.matilla07@gmail.com> 8 | # -- @copyright 2020 manilarome 9 | # -- @script rofi-spotlight.sh 10 | # ---------------------------------------------------------------------------- 11 | 12 | TMP_DIR="/tmp/rofi/${USER}/" 13 | 14 | PREV_LOC_FILE="${TMP_DIR}rofi_fb_prevloc" 15 | CURRENT_FILE="${TMP_DIR}rofi_fb_current_file" 16 | 17 | MY_PATH="$(dirname "${0}")" 18 | HIST_FILE="${MY_PATH}/history.txt" 19 | 20 | OPENER=xdg-open 21 | TERM_EMU=termite 22 | TEXT_EDITOR=kate 23 | FILE_MANAGER=dolphin 24 | BLUETOOTH_SEND=blueman-sendto 25 | 26 | CUR_DIR=$PWD 27 | 28 | NEXT_DIR="" 29 | 30 | SHOW_HIDDEN=false 31 | 32 | declare -a SHELL_OPTIONS=( 33 | "Run" 34 | "Execute in ${TERM_EMU}" 35 | "Edit" 36 | "Open file location in ${TERM_EMU}" 37 | "Open file location in ${FILE_MANAGER}" 38 | "Move to trash" 39 | "Delete" 40 | "Back" 41 | ) 42 | 43 | declare -a SHELL_NO_X_OPTIONS=( 44 | "Edit" 45 | "Open file location in ${TERM_EMU}" 46 | "Open file location in ${FILE_MANAGER}" 47 | "Move to trash" 48 | "Delete" 49 | "Back" 50 | ) 51 | 52 | declare -a BIN_OPTIONS=( 53 | "Run" 54 | "Execute in ${TERM_EMU}" 55 | "Open file location in ${TERM_EMU}" 56 | "Open file location in ${FILE_MANAGER}" 57 | "Back" 58 | ) 59 | 60 | declare -a BIN_NO_X_OPTIONS=( 61 | "Open file location in ${TERM_EMU}" 62 | "Open file location in ${FILE_MANAGER}" 63 | "Back" 64 | ) 65 | 66 | declare -a TEXT_OPTIONS=( 67 | "Edit" 68 | "Open file location in ${TERM_EMU}" 69 | "Open file location in ${FILE_MANAGER}" 70 | "Move to trash" 71 | "Delete" 72 | "Back" 73 | ) 74 | 75 | declare -a XCF_SVG_OPTIONS=( 76 | "Open" 77 | "Open file location in ${TERM_EMU}" 78 | "Open file location in ${FILE_MANAGER}" 79 | "Move to trash" 80 | "Delete" 81 | "Back" 82 | ) 83 | 84 | declare -a IMAGE_OPTIONS=( 85 | "Open" 86 | "Send via Bluetooth" 87 | "Open file location in ${TERM_EMU}" 88 | "Open file location in ${FILE_MANAGER}" 89 | "Move to trash" 90 | "Delete" 91 | "Back" 92 | ) 93 | 94 | declare -a ALL_OPTIONS=() 95 | 96 | # Combine all context menu 97 | COMBINED_OPTIONS=( 98 | "${SHELL_OPTIONS[@]}" 99 | "${SHELL_NO_X_OPTIONS[@]}" 100 | "${BIN_OPTIONS[@]}" 101 | "${BIN_NO_X_OPTIONS[@]}" 102 | "${TEXT_OPTIONS[@]}" 103 | "${XCF_SVG_OPTIONS[@]}" 104 | "${IMAGE_OPTIONS[@]}" 105 | ) 106 | 107 | # Remove duplicates 108 | while IFS= read -r -d '' x; do 109 | ALL_OPTIONS+=("$x") 110 | done < <(printf "%s\0" "${COMBINED_OPTIONS[@]}" | sort -uz) 111 | 112 | # Create tmp dir for rofi 113 | if [ ! -d "${TMP_DIR}" ] 114 | then 115 | mkdir -p "${TMP_DIR}"; 116 | fi 117 | 118 | # Create hist file if it doesn't exist 119 | if [ ! -f "${HIST_FILE}" ] 120 | then 121 | touch "${HIST_FILE}" 122 | fi 123 | 124 | # Help message 125 | if [[ ! -z "$@" ]] && [[ "$@" == ":help" ]] 126 | then 127 | 128 | echo "Rofi Spotlight" 129 | echo "A Rofi with file and web searching functionality" 130 | echo " " 131 | echo "Commands:" 132 | echo ":help to print this help message" 133 | echo ":h or :hidden to show hidden files/dirs" 134 | echo ":sh or :show_hist to show search history" 135 | echo ":ch or :clear_hist to clear search history" 136 | echo ":xdg to jump to an xdg directory" 137 | echo "Examples:" 138 | echo " :xdg DOCUMENTS" 139 | echo " :xdg DOWNLOADS" 140 | echo "Also supports incomplete path:" 141 | echo "Examples:" 142 | echo " :xdg doc" 143 | echo " :xdg down" 144 | echo "For more info about XDG dirs, see:" 145 | echo "\`man xdg-user-dir\`" 146 | echo " " 147 | echo "File search syntaxes:" 148 | echo "! to search for a file and web suggestions" 149 | echo "? to search parent directories" 150 | echo "Examples:" 151 | echo " !half-life 3" 152 | echo " ?portal 3" 153 | echo " " 154 | echo "Web search syntaxes:" 155 | echo "! to gets search suggestions" 156 | echo ":web/:w to also to gets search suggestions" 157 | echo ":webbro/:wb to search directly from your browser" 158 | echo "Examples:" 159 | echo " !how to install archlinux" 160 | echo " :web how to install gentoo" 161 | echo " :w how to make a nuclear fission" 162 | echo " :webbro how to install wine in windowsxp" 163 | 164 | exit; 165 | fi 166 | 167 | # Return the icon string 168 | function icon_file_type(){ 169 | 170 | icon_name="" 171 | mime_type=$(file --mime-type -b "${1}") 172 | 173 | case "${mime_type}" in 174 | "inode/directory") 175 | case "${1}" in 176 | "Desktop/" ) 177 | icon_name='folder-blue-desktop' 178 | ;; 179 | "Documents/" ) 180 | icon_name='folder-blue-documents' 181 | ;; 182 | "Downloads/" ) 183 | icon_name='folder-blue-downloads' 184 | ;; 185 | "Music/" ) 186 | icon_name='folder-blue-music' 187 | ;; 188 | "Pictures/" ) 189 | icon_name='folder-blue-pictures' 190 | ;; 191 | "Public/" ) 192 | icon_name='folder-blue-public' 193 | ;; 194 | "Templates/" ) 195 | icon_name='folder-blue-templates' 196 | ;; 197 | "Videos/" ) 198 | icon_name='folder-blue-videos' 199 | ;; 200 | "root/" ) 201 | icon_name='folder-root' 202 | ;; 203 | "home/" | "${USER}/") 204 | icon_name='folder-home' 205 | ;; 206 | *"$" ) 207 | icon_name='folder-blue' 208 | ;; 209 | *) 210 | icon_name='folder-blue' 211 | ;; 212 | esac 213 | ;; 214 | "inode/symlink" ) 215 | icon_name='inode-symlink' 216 | ;; 217 | "audio/flac" | "audio/mpeg" ) 218 | icon_name='music' 219 | ;; 220 | "video/mp4" ) 221 | icon_name='video-mp4' 222 | ;; 223 | "video/x-matroska" ) 224 | icon_name=video-x-matroska 225 | ;; 226 | "image/x-xcf" ) 227 | # notify-send '123' 228 | icon_name='image-x-xcf' 229 | ;; 230 | "image/jpeg" | "image/png" | "image/svg+xml") 231 | icon_name="${CUR_DIR}/${1}" 232 | ;; 233 | "image/gif" ) 234 | icon_name='gif' 235 | ;; 236 | "image/vnd.adobe.photoshop" ) 237 | icon_name='image-vnd.adobe.photoshop' 238 | ;; 239 | "image/webp" ) 240 | icon_name='gif' 241 | ;; 242 | "application/x-pie-executable" ) 243 | icon_name='binary' 244 | ;; 245 | "application/pdf" ) 246 | icon_name='pdf' 247 | ;; 248 | "application/zip" ) 249 | icon_name='application-zip' 250 | ;; 251 | "application/x-xz" ) 252 | icon_name='application-x-xz-compressed-tar' 253 | ;; 254 | "application/x-7z-compressed" ) 255 | icon_name='application-x-7zip' 256 | ;; 257 | "application/x-rar" ) 258 | icon_name='application-x-rar' 259 | ;; 260 | "application/octet-stream" | "application/x-iso9660-image" ) 261 | icon_name='application-x-iso' 262 | ;; 263 | "application/x-dosexec" ) 264 | icon_name='application-x-ms-dos-executable' 265 | ;; 266 | "text/plain" ) 267 | icon_name='application-text' 268 | ;; 269 | "text/x-shellscript" ) 270 | icon_name='application-x-shellscript' 271 | ;; 272 | "font/sfnt" | "application/vnd.ms-opentype" ) 273 | icon_name='application-x-font-ttf' 274 | ;; 275 | * ) 276 | case "${1}" in 277 | *."docx" | *".doc" ) 278 | icon_name='application-msword' 279 | ;; 280 | *."apk" ) 281 | icon_name='android-package-archive' 282 | ;; 283 | * ) 284 | icon_name='unknown' 285 | ;; 286 | esac 287 | ;; 288 | esac 289 | 290 | echo "${1}""\0icon\x1f""${icon_name}""\n" 291 | } 292 | 293 | 294 | # Pass the argument to python script 295 | function web_search() { 296 | # Pass the search query to web-search script 297 | "${MY_PATH}/web-search.py" "${1}" 298 | exit; 299 | } 300 | 301 | # Handles the web search method 302 | if [ ! -z "$@" ] && ([[ "$@" == ":webbro"* ]] || [[ "$@" == ":wb"* ]]) 303 | then 304 | remove='' 305 | 306 | if [[ "$@" == ":webbro"* ]] 307 | then 308 | remove=":webbro" 309 | else 310 | remove=":wb" 311 | fi 312 | 313 | # Search directly from your web browser 314 | web_search "$(printf '%s\n' "${1//$remove/}")" 315 | exit; 316 | 317 | elif [ ! -z "$@" ] && ([[ "$@" == ":web"* ]] || [[ "$@" == ":w"* ]]) 318 | then 319 | remove='' 320 | 321 | if [[ "$@" == ":web"* ]] 322 | then 323 | remove=":web" 324 | else 325 | remove=":w" 326 | fi 327 | 328 | # Get search suggestions 329 | web_search "!$(printf '%s\n' "${1//$remove/}")" 330 | exit; 331 | fi 332 | 333 | # File and calls to the web search 334 | if [ ! -z "$@" ] && ([[ "$@" == /* ]] || [[ "$@" == \?* ]] || [[ "$@" == \!* ]]) 335 | then 336 | QUERY=$@ 337 | 338 | echo "${QUERY}" >> "${HIST_FILE}" 339 | 340 | if [[ "$@" == /* ]] 341 | then 342 | 343 | if [[ "$@" == *\?\? ]] 344 | then 345 | coproc ( ${OPENER} "${QUERY%\/* \?\?}" > /dev/null 2>&1 ) 346 | exec 1>&- 347 | exit; 348 | else 349 | coproc ( ${OPENER} "$@" > /dev/null 2>&1 ) 350 | exec 1>&- 351 | exit; 352 | fi 353 | 354 | elif [[ "$@" == \?* ]] 355 | then 356 | while read -r line 357 | do 358 | echo "$line" \?\? 359 | done <<< $(find "${HOME}" -iname *"${QUERY#\?}"* 2>&1 | grep -v 'Permission denied\|Input/output error') 360 | 361 | else 362 | # Find the file 363 | find "${HOME}" -iname *"${QUERY#!}"* -exec echo -ne \ 364 | "{}\0icon\x1f${MY_PATH}/icons/result.svg\n" \; 2>&1 | 365 | grep -av 'Permission denied\|Input/output error' 366 | 367 | # Web search 368 | web_search "${QUERY}" 369 | fi 370 | exit; 371 | fi 372 | 373 | # Create notification if there's an error 374 | function create_notification() { 375 | if [[ "${1}" == "denied" ]] 376 | then 377 | notify-send -a "Global Search" "Permission denied!" \ 378 | 'You have no permission to access '"${CUR_DIR}!" 379 | elif [[ "${1}" == "deleted" ]] 380 | then 381 | notify-send -a "Global Search" "Success!" \ 382 | 'File deleted!' 383 | elif [[ "${1}" == "trashed" ]] 384 | then 385 | notify-send -a "Global Search" "Success!" \ 386 | 'The file has been moved to trash!' 387 | elif [[ "${1}" == "cleared" ]] 388 | then 389 | notify-send -a "Global Search" "Success!" \ 390 | 'Search history has been successfully cleared!' 391 | 392 | else 393 | notify-send -a "Global Search" "Somethings wrong I can feel it!" \ 394 | 'This incident will be reported!' 395 | fi 396 | } 397 | 398 | # Show the files in the current directory 399 | function navigate_to() { 400 | # process current dir. 401 | if [ -n "${CUR_DIR}" ] 402 | then 403 | CUR_DIR=$(readlink -e "${CUR_DIR}") 404 | if [ ! -d "${CUR_DIR}" ] || [ ! -r "${CUR_DIR}" ] 405 | then 406 | echo "${HOME}" > "${PREV_LOC_FILE}" 407 | create_notification "denied" 408 | 409 | else 410 | echo "${CUR_DIR}/" > "${PREV_LOC_FILE}" 411 | fi 412 | pushd "${CUR_DIR}" >/dev/null 413 | fi 414 | 415 | printf "..\0icon\x1fup\n" 416 | 417 | if [[ ${SHOW_HIDDEN} == true ]] 418 | then 419 | 420 | for i in .*/ 421 | do 422 | if [[ -d "${i}" ]] && ([[ "${i}" != "./" ]] && [[ "${i}" != "../"* ]]) 423 | then 424 | printf "$(icon_file_type "${i}")"; 425 | fi 426 | done 427 | 428 | for i in .* 429 | do 430 | if [[ -f "${i}" ]] 431 | then 432 | printf "$(icon_file_type "${i}")"; 433 | fi 434 | done 435 | 436 | fi 437 | 438 | for i in */ 439 | do 440 | if [[ -d "${i}" ]] 441 | then 442 | printf "$(icon_file_type "${i}")"; 443 | fi 444 | done 445 | 446 | for i in * 447 | do 448 | if [[ -f "${i}" ]] 449 | then 450 | printf "$(icon_file_type "${i}")"; 451 | fi 452 | done 453 | } 454 | 455 | # Set XDG dir 456 | function return_xdg_dir() { 457 | target_dir=$(echo "$1" | tr "[:lower:]" "[:upper:]") 458 | 459 | if [[ "HOME" == *"${target_dir}"* ]] 460 | then 461 | CUR_DIR=$(xdg-user-dir) 462 | 463 | elif [[ "DESKTOP" == *"${target_dir}"* ]] 464 | then 465 | CUR_DIR=$(xdg-user-dir DESKTOP) 466 | 467 | elif [[ "DOCUMENTS" == *"${target_dir}"* ]] 468 | then 469 | CUR_DIR=$(xdg-user-dir DOCUMENTS) 470 | 471 | elif [[ "DOWNLOADS" == *"${target_dir}"* ]] 472 | then 473 | CUR_DIR=$(xdg-user-dir DOWNLOAD) 474 | 475 | elif [[ "MUSIC" == *"${target_dir}"* ]] 476 | then 477 | CUR_DIR=$(xdg-user-dir MUSIC) 478 | 479 | elif [[ "PICTURES" == *"${target_dir}"* ]] 480 | then 481 | CUR_DIR=$(xdg-user-dir PICTURES) 482 | 483 | elif [[ "PUBLICSHARE" == *"${target_dir}"* ]] 484 | then 485 | CUR_DIR=$(xdg-user-dir PUBLICSHARE) 486 | 487 | elif [[ "TEMPLATES" == *"${target_dir}"* ]] 488 | then 489 | CUR_DIR=$(xdg-user-dir TEMPLATES) 490 | 491 | elif [[ "VIDEOS" == *"${target_dir}"* ]] 492 | then 493 | CUR_DIR=$(xdg-user-dir VIDEOS) 494 | 495 | elif [[ "ROOT" == *"${target_dir}"* ]] 496 | then 497 | CUR_DIR="/" 498 | 499 | else 500 | CUR_DIR="${HOME}" 501 | fi 502 | navigate_to 503 | exit; 504 | } 505 | 506 | # Show and Clear History 507 | if [ ! -z "$@" ] && ([[ "$@" == ":sh" ]] || [[ "$@" == ":show_hist" ]]) 508 | then 509 | hist=$(tac "${HIST_FILE}") 510 | 511 | if [ ! -n "${hist}" ] 512 | then 513 | printf ".\0icon\x1fback\n" 514 | printf "No history, yet.\0icon\x1ftext-plain\n" 515 | fi 516 | 517 | while IFS= read -r line; 518 | do 519 | printf "${line}\0icon\x1f${MY_PATH}/icons/history.svg\n"; 520 | done <<< "${hist}" 521 | 522 | exit; 523 | 524 | elif [ ! -z "$@" ] && ([[ "$@" == ":ch" ]] || [[ "$@" == ":clear_hist" ]]) 525 | then 526 | :> "${HIST_FILE}" 527 | create_notification "cleared" 528 | 529 | CUR_DIR="${HOME}" 530 | navigate_to 531 | exit; 532 | fi 533 | 534 | # Accepts XDG command 535 | if [[ ! -z "$@" ]] && [[ "$@" == ":xdg"* ]] 536 | then 537 | 538 | NEXT_DIR=$(echo "$@" | awk '{print $2}') 539 | 540 | if [[ ! -z "$NEXT_DIR" ]] 541 | then 542 | return_xdg_dir "${NEXT_DIR}" 543 | else 544 | return_xdg_dir "${HOME}" 545 | fi 546 | 547 | fi 548 | 549 | # Read last location, otherwise we default to PWD. 550 | if [ -f "${PREV_LOC_FILE}" ] 551 | then 552 | CUR_DIR=$(cat "${PREV_LOC_FILE}") 553 | fi 554 | 555 | if [[ ! -z "$@" ]] && ([[ "$@" == ":h" ]] || [[ "$@" == ":hidden" ]]) 556 | then 557 | SHOW_HIDDEN=true 558 | navigate_to 559 | exit; 560 | fi 561 | 562 | # Handle argument. 563 | if [ -n "$@" ] 564 | then 565 | CUR_DIR="${CUR_DIR}/$@" 566 | fi 567 | 568 | 569 | # Context Menu 570 | if [[ ! -z "$@" ]] && [[ "${ALL_OPTIONS[*]} " == *"${1}"* ]] 571 | then 572 | case "${1}" in 573 | "Run" ) 574 | coproc ( eval "$(cat "${CURRENT_FILE}")" & > /dev/null 2>&1 ) 575 | kill -9 $(pgrep rofi) 576 | ;; 577 | "Execute in ${TERM_EMU}" ) 578 | coproc ( eval "${TERM_EMU} "$(cat "${CURRENT_FILE}")"" & > /dev/null 2>&1 ) 579 | kill -9 $(pgrep rofi) 580 | ;; 581 | "Open" ) 582 | coproc ( eval "${OPENER} "$(cat "${CURRENT_FILE}")"" & > /dev/null 2>&1 ) 583 | kill -9 $(pgrep rofi) 584 | ;; 585 | "Open file location in ${TERM_EMU}" ) 586 | file_path="$(cat "${CURRENT_FILE}")" 587 | coproc ( ${TERM_EMU} bash -c "cd "${file_path%/*}" ; ${SHELL}" & > /dev/null 2>&1 ) 588 | kill -9 $(pgrep rofi) 589 | ;; 590 | "Open file location in ${FILE_MANAGER}" ) 591 | file_path="$(cat "${CURRENT_FILE}")" 592 | coproc ( eval "${FILE_MANAGER} "${file_path%/*}"" & > /dev/null 2>&1 ) 593 | kill -9 $(pgrep rofi) 594 | ;; 595 | "Edit" ) 596 | coproc ( eval "${TEXT_EDITOR} $(cat "${CURRENT_FILE}")" & > /dev/null 2>&1 ) 597 | kill -9 $(pgrep rofi) 598 | ;; 599 | "Move to trash" ) 600 | coproc( gio trash "$(cat "${CURRENT_FILE}")" & > /dev/null 2>&1 ) 601 | create_notification "trashed" 602 | CUR_DIR="$(dirname $(cat "${CURRENT_FILE}"))" 603 | navigate_to 604 | ;; 605 | "Delete" ) 606 | shred "$(cat "${CURRENT_FILE}")" 607 | rm "$(cat "${CURRENT_FILE}")" 608 | create_notification "deleted" 609 | CUR_DIR="$(dirname $(cat "${CURRENT_FILE}"))" 610 | navigate_to 611 | ;; 612 | "Send via Bluetooth" ) 613 | rfkill unblock bluetooth && bluetoothctl power on 614 | sleep 1 615 | blueman-sendto "$(cat "${CURRENT_FILE}")" & > /dev/null 2>&1 616 | kill -9 $(pgrep rofi) 617 | ;; 618 | "Back" ) 619 | CUR_DIR=$(cat "${PREV_LOC_FILE}") 620 | navigate_to 621 | ;; 622 | esac 623 | exit; 624 | fi 625 | 626 | function context_menu_icons() { 627 | 628 | if [[ "${1}" == "Run" ]] 629 | then 630 | echo '\0icon\x1fsystem-run\n' 631 | 632 | elif [[ "${1}" == "Execute in ${TERM_EMU}" ]] 633 | then 634 | echo "\0icon\x1f${TERM_EMU}\n" 635 | 636 | elif [[ "${1}" == "Open" ]] 637 | then 638 | echo "\0icon\x1futilities-x-terminal\n" 639 | 640 | elif [[ "${1}" == "Open file location in ${TERM_EMU}" ]] 641 | then 642 | echo "\0icon\x1f${TERM_EMU}\n" 643 | 644 | elif [[ "${1}" == "Open file location in ${FILE_MANAGER}" ]] 645 | then 646 | echo "\0icon\x1fblue-folder-open\n" 647 | 648 | elif [[ "${1}" == "Edit" ]] 649 | then 650 | echo "\0icon\x1faccessories-text-editor\n" 651 | 652 | elif [[ "${1}" == "Move to trash" ]] 653 | then 654 | echo "\0icon\x1fapplication-x-trash\n" 655 | 656 | elif [[ "${1}" == "Delete" ]] 657 | then 658 | echo "\0icon\x1findicator-trashindicator\n" 659 | 660 | elif [[ "${1}" == "Send via Bluetooth" ]] 661 | then 662 | echo "\0icon\x1fbluetooth\n" 663 | 664 | elif [[ "${1}" == "Back" ]] 665 | then 666 | echo "\0icon\x1fback\n" 667 | fi 668 | } 669 | 670 | function print_context_menu() { 671 | declare -a arg_arr=("${!1}") 672 | 673 | for menu in "${arg_arr[@]}" 674 | do 675 | printf "$menu$(context_menu_icons "${menu}")\n" 676 | done 677 | } 678 | 679 | function context_menu() { 680 | 681 | type=$(file --mime-type -b "${CUR_DIR}") 682 | 683 | if [ -w "${CUR_DIR}" ] && [[ "${type}" == "text/x-shellscript" ]] 684 | then 685 | if [ -x "${CUR_DIR}" ]; 686 | then 687 | print_context_menu SHELL_OPTIONS[@] 688 | else 689 | print_context_menu SHELL_NO_X_OPTIONS[@] 690 | fi 691 | 692 | elif [[ "${type}" == "application/x-executable" ]] || [[ "${type}" == "application/x-pie-executable" ]] 693 | then 694 | if [ -x "${CUR_DIR}" ] 695 | then 696 | print_context_menu BIN_OPTIONS[@] 697 | else 698 | print_context_menu BIN_NO_X_OPTIONS[@] 699 | fi 700 | 701 | elif [[ "${type}" == "text/plain" ]] 702 | then 703 | print_context_menu TEXT_OPTIONS[@] 704 | 705 | elif [[ "${type}" == "image/jpeg" ]] || [[ "${type}" == "image/png" ]] 706 | then 707 | print_context_menu IMAGE_OPTIONS[@] 708 | 709 | elif [[ "${type}" == "image/x-xcf" ]] || [[ "${type}" == "image/svg+xml" ]] 710 | then 711 | print_context_menu XCF_SVG_OPTIONS[@] 712 | 713 | elif [ ! -w "${CUR_DIR}" ] && [[ "${type}" == "text/x-shellscript" ]] 714 | then 715 | coproc ( exec "${CUR_DIR}" & > /dev/null 2>&1 ) 716 | 717 | else 718 | if [ ! -d "${CUR_DIR}" ] && [ ! -f "${CUR_DIR}" ] 719 | then 720 | QUERY="${CUR_DIR//*\/\//}" 721 | 722 | echo "${QUERY}" >> "${HIST_FILE}" 723 | 724 | find "${HOME}" -iname *"${QUERY#!}"* -exec echo -ne \ 725 | "{}\0icon\x1f${MY_PATH}/icons/result.svg\n" \; 2>&1 | 726 | grep -av 'Permission denied\|Input/output error' 727 | 728 | web_search "!${QUERY}" 729 | else 730 | coproc ( ${OPENER} "${CUR_DIR}" & > /dev/null 2>&1 ) 731 | fi 732 | fi 733 | exit; 734 | 735 | } 736 | 737 | # If argument is not a directory/folder 738 | if [ ! -d "${CUR_DIR}" ] 739 | then 740 | echo "${CUR_DIR}" > "${CURRENT_FILE}" 741 | context_menu 742 | exit; 743 | fi 744 | 745 | navigate_to 746 | -------------------------------------------------------------------------------- /rofi-spotlight/rofi.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | font: "Inter Regular 10"; 3 | show-icons: true; 4 | fullscreen: false; 5 | threads: 0; 6 | matching: "fuzzy"; 7 | scroll-method: 0; 8 | } 9 | 10 | * { 11 | background: #2e3440; 12 | background-color: #2e3440; 13 | background-entry: #434c5e; 14 | background-alt: #5e81ac; 15 | foreground: #d8dee9; 16 | foreground-selected: #eceff4; 17 | urgent: #E91E6366; 18 | urgent-selected: #E91E6377; 19 | } 20 | 21 | window { 22 | 23 | background: @background; 24 | location: center; 25 | anchor: center; 26 | x-offset: 0px; 27 | height: 500px; 28 | width: 750px; 29 | orientation: vertical; 30 | border-radius: 12px; 31 | } 32 | 33 | mainbox { 34 | background-color: @background; 35 | spacing: 0px; 36 | padding: 5px 5px 5px 5px; 37 | width: 200px; 38 | expand: true; 39 | spacing: 12px; 40 | children: [ inputbar, listview]; 41 | } 42 | 43 | scrollbar { 44 | background-color: @background-alt; 45 | handle-width: 0; 46 | margin: 0 0 5px 0; 47 | border-radius: 9px; 48 | } 49 | 50 | listview { 51 | background-color: @background; 52 | spacing: 0px; 53 | dynamic: true; 54 | cycle: true; 55 | scrollbar: true; 56 | } 57 | 58 | prompt { 59 | enabled: false; 60 | } 61 | 62 | button { 63 | action: "ok"; 64 | str: ""; 65 | font: "FantasqueSansMono Nerd Font 16"; 66 | expand: false; 67 | text-color: @foreground; 68 | background-color: @background-entry; 69 | vertical-align: 0.5; 70 | horizontal-align: 0.5; 71 | } 72 | 73 | 74 | entry { 75 | font: "Inter Regular 12"; 76 | background-color: @background-entry; 77 | placeholder-color: @background-entry; 78 | placeholder: "Global Search"; 79 | blink: true; 80 | expand: true; 81 | text-color: @foreground; 82 | vertical-align: 0.5; 83 | } 84 | 85 | entry-wrapper { 86 | orientation: horizontal; 87 | margin: 0 12px 0 12px; 88 | spacing: 24px; 89 | vertical-align: 0.5; 90 | background-color: @background-entry; 91 | children: [ button, entry ]; 92 | } 93 | 94 | inputbar { 95 | padding: 14px; 96 | margin: 10px 10px 14px 10px; 97 | background-color: @background-entry; 98 | text-color: @foreground; 99 | expand: false; 100 | border-radius: 9px; 101 | position: north; 102 | children: [ entry-wrapper ]; 103 | } 104 | 105 | element { 106 | margin: 0px 12px 0px 12px; 107 | background-color: @background; 108 | text-color: @foreground; 109 | orientation: horizontal; 110 | padding: 10px 24px 10px 24px; 111 | spacing: 24px; 112 | border: 0 0 0 0; 113 | border-color: @background-alt; 114 | border-radius: 6px; 115 | } 116 | 117 | element-icon { 118 | size: 24px; 119 | /* border-color: @background; */ 120 | /* border: 2px; */ 121 | } 122 | 123 | element-text { 124 | font: "Inter Regular 11"; 125 | expand: true; 126 | horizontal-align: 0.0; 127 | vertical-align: 0.5; 128 | } 129 | 130 | element normal.urgent, 131 | element alternate.urgent { 132 | background-color: @urgent; 133 | text-color: @foreground; 134 | border-radius: 9px; 135 | } 136 | 137 | element normal.active, 138 | element alternate.active { 139 | background-color: @background-alt; 140 | text-color: @foreground; 141 | } 142 | 143 | element selected { 144 | background-color: @background-alt; 145 | text-color: @foreground-selected; 146 | } 147 | 148 | element selected.urgent { 149 | background-color: @urgent-selected; 150 | text-color: @foreground; 151 | } 152 | 153 | element selected.active { 154 | background-color: @background-alt; 155 | color: @foreground-selected; 156 | } 157 | -------------------------------------------------------------------------------- /rofi-spotlight/web-search.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # MIT License 4 | 5 | # Copyright (c) 2019 Paolo Donadeo 6 | 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy 8 | # of this software and associated documentation files (the "Software"), to deal 9 | # in the Software without restriction, including without limitation the rights 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | # copies of the Software, and to permit persons to whom the Software is 12 | # furnished to do so, subject to the following conditions: 13 | 14 | # The above copyright notice and this permission notice shall be included in all 15 | # copies or substantial portions of the Software. 16 | 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | 24 | import json 25 | import re 26 | import urllib.parse 27 | import urllib.request 28 | import sys 29 | import os 30 | import datetime 31 | import gzip 32 | 33 | import subprocess as sp 34 | 35 | import html 36 | 37 | 38 | ################################################################################ 39 | ##### C O N F I G U R A T I O N ###### 40 | ################################################################################ 41 | SEARCH_ENGINE = 'duckduckgo' # or 'duckduckgo' 42 | BROWSER = 'firefox' # or 'firefox', 'chromium', 'brave', 'lynx' 43 | TERMINAL = ['termite', '--'] # or ['st', '-e'] or something like that 44 | ################################################################################ 45 | 46 | CONFIG = { 47 | 'BROWSER_PATH' : { 48 | 'chrome' : ['google-chrome-stable'], 49 | 'firefox' : ['firefox'], 50 | 'chromium' : ['chromium-browser'], 51 | 'brave' : ['brave-browser'], 52 | 'lynx' : TERMINAL + ['lynx'] 53 | }, 54 | 'USER_AGENT' : { 55 | 'chrome' : 'Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36', 56 | 'firefox' : 'Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0', 57 | 'chromium' : 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/76.0.3809.100 Chrome/76.0.3809.100 Safari/537.36', 58 | 'brave' : 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36', 59 | 'lynx' : 'Lynx/2.8.9rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/1.1.1d' 60 | }, 61 | 'SEARCH_ENGINE_NAME' : { 62 | 'google' : 'Google', 63 | 'duckduckgo' : 'DuckDuckGo' 64 | }, 65 | 'SEARCH_URL' : { 66 | 'google' : 'https://www.google.com/search?q=', 67 | 'duckduckgo' : 'https://duckduckgo.com/?q=' 68 | }, 69 | 'SUGGESTION_URL' : { 70 | 'google' : 'https://www.google.com/complete/search?', 71 | 'duckduckgo' : 'https://duckduckgo.com/ac/?' 72 | } 73 | } 74 | 75 | def cleanhtml(txt): 76 | return re.sub(r'<.*?>', '', txt) 77 | 78 | def fetch_suggestions(search_string): 79 | if SEARCH_ENGINE == 'google': 80 | r = { 81 | 'q' : search_string, 82 | 'cp' : '11', 83 | 'client' : 'psy-ab', 84 | 'xssi' : 't', 85 | 'gs_ri' : 'gws-wiz', 86 | 'hl' : 'en-IT', 87 | 'authuser' : '0' 88 | } 89 | url = CONFIG['SUGGESTION_URL'][SEARCH_ENGINE] + urllib.parse.urlencode(r) 90 | headers = { 91 | 'sec-fetch-mode' : 'cors', 92 | 'dnt' : '1', 93 | 'accept-encoding' : 'gzip', 94 | 'accept-language' : 'en-US;q=0.9,en;q=0.8', 95 | 'pragma' : 'no-cache', 96 | 'user-agent' : CONFIG['USER_AGENT'][BROWSER], 97 | 'accept' : '*/*', 98 | 'cache-control' : 'no-cache', 99 | 'authority' : 'www.google.com', 100 | 'referer' : 'https://www.google.com/', 101 | 'sec-fetch-site' : 'same-origin' 102 | } 103 | req = urllib.request.Request(url, headers=headers, method='GET') 104 | 105 | reply_data = gzip.decompress(urllib.request.urlopen(req).read()).split(b'\n')[1] 106 | reply_data = json.loads(reply_data) 107 | return [ cleanhtml(res[0]).strip() for res in reply_data[0] ] 108 | else: # 'duckduckgo' 109 | if search_string.startswith('!'): 110 | bang_search = True 111 | search_string = search_string.lstrip('!') 112 | else: 113 | bang_search = False 114 | r = { 115 | 'q' : search_string, 116 | 'callback' : 'autocompleteCallback', 117 | 'kl' : 'wt-wt', 118 | '_' : str(int((datetime.datetime.now().timestamp())*1000)) 119 | } 120 | url = CONFIG['SUGGESTION_URL'][SEARCH_ENGINE] + urllib.parse.urlencode(r) 121 | if bang_search: 122 | url = url.replace('?q=', '?q=!') 123 | headers = { 124 | 'pragma' : 'no-cache', 125 | 'dnt' : '1', 126 | 'accept-encoding' : 'gzip', 127 | 'accept-language' : 'en-US;q=0.9,en;q=0.8', 128 | 'user-agent' : CONFIG['USER_AGENT'][BROWSER], 129 | 'sec-fetch-mode' : 'no-cors', 130 | 'accept' : '*/*', 131 | 'cache-control' : 'no-cache', 132 | 'authority' : 'duckduckgo.com', 133 | 'referer' : 'https://duckduckgo.com/', 134 | 'sec-fetch-site' : 'same-origin', 135 | } 136 | req = urllib.request.Request(url, headers=headers, method='GET') 137 | reply_data = gzip.decompress(urllib.request.urlopen(req).read()).decode('utf8') 138 | reply_data = json.loads(re.match(r'autocompleteCallback\((.*)\);', reply_data).group(1)) 139 | return [ cleanhtml(res['phrase']).strip() for res in reply_data ] 140 | 141 | def main(): 142 | search_string = html.unescape((' '.join(sys.argv[1:])).strip()) 143 | 144 | path_str = os.path.dirname(os.path.realpath(__file__)) + '/' 145 | icon_path_str = path_str + 'icons/' 146 | icon_name = icon_path_str 147 | 148 | if SEARCH_ENGINE == 'google': 149 | icon_name += 'google.svg' 150 | else: 151 | icon_name += 'ddg.svg' 152 | 153 | if search_string.startswith('!'): 154 | search_string = search_string.rstrip('!').strip() 155 | results = fetch_suggestions(search_string) 156 | for r in results: 157 | print(":wb " + html.unescape(r) + "\0icon\x1f"+icon_name+"\n") 158 | else: 159 | url = CONFIG['SEARCH_URL'][SEARCH_ENGINE] + urllib.parse.quote_plus(search_string) 160 | sp.Popen(CONFIG['BROWSER_PATH'][BROWSER] + [url], stdout=sp.DEVNULL, stderr=sp.DEVNULL, shell=False) 161 | 162 | if __name__ == "__main__": 163 | try: 164 | main() 165 | except Exception as e: 166 | if e: 167 | sys.exit(1) 168 | -------------------------------------------------------------------------------- /screenshots/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/screenshots/image.png -------------------------------------------------------------------------------- /screenshots/imgonline-com-ua-twotoone-byNO7a5jIbXGHq.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/screenshots/imgonline-com-ua-twotoone-byNO7a5jIbXGHq.jpg -------------------------------------------------------------------------------- /vimrc: -------------------------------------------------------------------------------- 1 | set number 2 | call plug#begin(expand('~/.vim/plugged')) 3 | Plug 'arcticicestudio/nord-vim' 4 | Plug 'vim-airline/vim-airline' 5 | call plug#end() 6 | colorscheme nord 7 | set matchpairs+=<:> 8 | set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ [BUFFER=%n]\ %{strftime('%c')} 9 | -------------------------------------------------------------------------------- /wallpaper/nordnight.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Axarva/dotfiles/a79f3f8997a203cbb945cfb582f17f657fbc7a11/wallpaper/nordnight.jpg -------------------------------------------------------------------------------- /zshrc: -------------------------------------------------------------------------------- 1 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 2 | # Initialization code that may require console input (password prompts, [y/n] 3 | # confirmations, etc.) must go above this block; everything else may go below. 4 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 5 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 6 | fi 7 | 8 | # If you come from bash you might have to change your $PATH. 9 | # export PATH=$HOME/bin:/usr/local/bin:$PATH 10 | 11 | # Path to your oh-my-zsh installation. 12 | export ZSH="/home/axarva/.oh-my-zsh" 13 | 14 | # Set name of the theme to load --- if set to "random", it will 15 | # load a random theme each time oh-my-zsh is loaded, in which case, 16 | # to know which specific one was loaded, run: echo $RANDOM_THEME 17 | # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes 18 | ZSH_THEME="powerlevel10k/powerlevel10k" 19 | 20 | # Set list of themes to pick from when loading at random 21 | # Setting this variable when ZSH_THEME=random will cause zsh to load 22 | # a theme from this variable instead of looking in $ZSH/themes/ 23 | # If set to an empty array, this variable will have no effect. 24 | # ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) 25 | 26 | # Uncomment the following line to use case-sensitive completion. 27 | # CASE_SENSITIVE="true" 28 | 29 | # Uncomment the following line to use hyphen-insensitive completion. 30 | # Case-sensitive completion must be off. _ and - will be interchangeable. 31 | # HYPHEN_INSENSITIVE="true" 32 | 33 | # Uncomment the following line to disable bi-weekly auto-update checks. 34 | # DISABLE_AUTO_UPDATE="true" 35 | 36 | # Uncomment the following line to automatically update without prompting. 37 | # DISABLE_UPDATE_PROMPT="true" 38 | 39 | # Uncomment the following line to change how often to auto-update (in days). 40 | # export UPDATE_ZSH_DAYS=13 41 | 42 | # Uncomment the following line if pasting URLs and other text is messed up. 43 | # DISABLE_MAGIC_FUNCTIONS="true" 44 | 45 | # Uncomment the following line to disable colors in ls. 46 | # DISABLE_LS_COLORS="true" 47 | 48 | # Uncomment the following line to disable auto-setting terminal title. 49 | # DISABLE_AUTO_TITLE="true" 50 | 51 | # Uncomment the following line to enable command auto-correction. 52 | # ENABLE_CORRECTION="true" 53 | 54 | # Uncomment the following line to display red dots whilst waiting for completion. 55 | # COMPLETION_WAITING_DOTS="true" 56 | 57 | # Uncomment the following line if you want to disable marking untracked files 58 | # under VCS as dirty. This makes repository status check for large repositories 59 | # much, much faster. 60 | # DISABLE_UNTRACKED_FILES_DIRTY="true" 61 | 62 | # Uncomment the following line if you want to change the command execution time 63 | # stamp shown in the history command output. 64 | # You can set one of the optional three formats: 65 | # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" 66 | # or set a custom format using the strftime function format specifications, 67 | # see 'man strftime' for details. 68 | # HIST_STAMPS="mm/dd/yyyy" 69 | 70 | # Would you like to use another custom folder than $ZSH/custom? 71 | # ZSH_CUSTOM=/path/to/new-custom-folder 72 | 73 | # Which plugins would you like to load? 74 | # Standard plugins can be found in $ZSH/plugins/ 75 | # Custom plugins may be added to $ZSH_CUSTOM/plugins/ 76 | # Example format: plugins=(rails git textmate ruby lighthouse) 77 | # Add wisely, as too many plugins slow down shell startup. 78 | plugins=(git rvm nvm z zsh-autosuggestions) 79 | 80 | source $ZSH/oh-my-zsh.sh 81 | 82 | # User configuration 83 | 84 | # export MANPATH="/usr/local/man:$MANPATH" 85 | 86 | # You may need to manually set your language environment 87 | # export LANG=en_US.UTF-8 88 | 89 | # Preferred editor for local and remote sessions 90 | # if [[ -n $SSH_CONNECTION ]]; then 91 | # export EDITOR='vim' 92 | # else 93 | # export EDITOR='mvim' 94 | # fi 95 | 96 | # Compilation flags 97 | # export ARCHFLAGS="-arch x86_64" 98 | 99 | # Set personal aliases, overriding those provided by oh-my-zsh libs, 100 | # plugins, and themes. Aliases can be placed here, though oh-my-zsh 101 | # users are encouraged to define aliases within the ZSH_CUSTOM folder. 102 | # For a full list of active aliases, run `alias`. 103 | # 104 | # Example aliases 105 | # alias zshconfig="mate ~/.zshrc" 106 | # alias ohmyzsh="mate ~/.oh-my-zsh" 107 | 108 | # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. 109 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 110 | 111 | export PATH="$PATH:/home/axarva/bin" 112 | export SPICETIFY_INSTALL="/home/axarva/spicetify-cli" 113 | export PATH="$SPICETIFY_INSTALL:$PATH" 114 | # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. 115 | export PATH="$PATH:$HOME/.rvm/bin" 116 | 117 | [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* 118 | 119 | --------------------------------------------------------------------------------