Merge pull request #206954 from Homebrew/bump-gollama-1.28.13
[homebrew-core.git] / Formula / d / dwm.rb
blobd76c91708cc3ed734c76421404f1c51b940f0386
1 class Dwm < Formula
2   desc "Dynamic window manager"
3   homepage "https://dwm.suckless.org/"
4   url "https://dl.suckless.org/dwm/dwm-6.5.tar.gz"
5   sha256 "21d79ebfa9f2fb93141836c2666cb81f4784c69d64e7f1b2352f9b970ba09729"
6   license "MIT"
7   head "https://git.suckless.org/dwm", using: :git, branch: "master"
9   livecheck do
10     url "https://dl.suckless.org/dwm/"
11     regex(/href=.*?dwm[._-]v?(\d+(?:\.\d+)+)\.t/i)
12   end
14   bottle do
15     rebuild 1
16     sha256 cellar: :any,                 arm64_sequoia: "1aea6c7c3cc131887b7d471659137384ac7e415dd9fbe7d15e3d8ae9c6dbe180"
17     sha256 cellar: :any,                 arm64_sonoma:  "922787e07a3be0599f223d64f413f62ca8b7bb2a6d6fefec4565a7357c359564"
18     sha256 cellar: :any,                 arm64_ventura: "b7971ddb4bf6f52bfc8a844ff6ea0681a0c9d6645cea923b0851e94771068785"
19     sha256 cellar: :any,                 sonoma:        "ddc7a7f3fbae58d7c4e8924ef3f53cff4906ac384f91a039bca5bdf097eb60d8"
20     sha256 cellar: :any,                 ventura:       "bb5ad3a4079c76769e85ebda55ad12a1260e946be09c5b611bdbfdff3146fdf1"
21     sha256 cellar: :any_skip_relocation, x86_64_linux:  "107dc6ce40aaa02fca9690bd3a7ac7804664cbfc49776b76354beccc8ba6da10"
22   end
24   depends_on "dmenu"
25   depends_on "fontconfig"
26   depends_on "libx11"
27   depends_on "libxft"
28   depends_on "libxinerama"
30   def install
31     if OS.mac?
32       # The dwm default quit keybinding Mod1-Shift-q collides with
33       # the Mac OS X Log Out shortcut in the Apple menu.
34       inreplace "config.def.h",
35       "{ MODKEY|ShiftMask,             XK_q,      quit,           {0} },",
36       "{ MODKEY|ControlMask,           XK_q,      quit,           {0} },"
37       inreplace "dwm.1", '.B Mod1\-Shift\-q', '.B Mod1\-Control\-q'
38     end
39     system "make", "FREETYPEINC=#{Formula["freetype2"].opt_include}/freetype2", "PREFIX=#{prefix}", "install"
40   end
42   def caveats
43     on_macos do
44       <<~EOS
45         In order to use the Mac OS X command key for dwm commands,
46         change the X11 keyboard modifier map using xmodmap (1).
48         e.g. by running the following command from $HOME/.xinitrc
49         xmodmap -e 'remove Mod2 = Meta_L' -e 'add Mod1 = Meta_L'&
51         See also https://gist.github.com/311377 for a handful of tips and tricks
52         for running dwm on Mac OS X.
53       EOS
54     end
55   end
57   test do
58     assert_match "dwm: cannot open display", shell_output("DISPLAY= #{bin}/dwm 2>&1", 1)
59     assert_match "dwm-#{version}", shell_output("DISPLAY= #{bin}/dwm -v 2>&1", 1)
60   end
61 end