change to librewolf

This commit is contained in:
2025-03-02 18:28:48 +01:00
parent 6763218652
commit a58f285a08
2 changed files with 106 additions and 202 deletions

View File

@@ -20,7 +20,6 @@ in {
dmenu dmenu
alacritty alacritty
# discord # discord
# firefox
scrot scrot
brightnessctl brightnessctl
python3 python3
@@ -73,6 +72,7 @@ in {
libtool libtool
tinymist tinymist
emacsPackages.treesit-grammars.with-all-grammars emacsPackages.treesit-grammars.with-all-grammars
librewolf
]; ];
# Home Manager is pretty good at managing dotfiles. The primary way to manage # Home Manager is pretty good at managing dotfiles. The primary way to manage
@@ -105,96 +105,6 @@ in {
home.sessionPath = [ "/home/fredrikr/.config/emacs/bin/" ]; home.sessionPath = [ "/home/fredrikr/.config/emacs/bin/" ];
programs.firefox = {
enable = true;
policies = {
# about:policies
DisableTelemetry = true;
DisableFirefoxStudies = true;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
DisablePocket = true;
DisableFirefoxAccounts = true;
DisableAccounts = true;
DisableFirefoxScreenshots = true;
OverrideFirstRunPage = "";
OverridePostUpdatePage = "";
DontCheckDefaultBrowser = true;
DisplayBookmarksToolbar = "newtab"; # alternatives: "always" or "newtab"
DisplayMenuBar =
"default-off"; # alternatives: "always", "never" or "default-on"
SearchBar = "unified"; # alternative: "separate"
# about:support
ExtensionSettings = {
"*".installation_mode =
"blocked"; # blocks all addons except the ones specified below
# uBlock Origin:
"uBlock0@raymondhill.net" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
# dark reader
"addon@darkreader.org" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi";
installation_mode = "force_installed";
};
# kagi
"search@kagi.com" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/kagi-search-for-firefox/latest.xpi";
installation_mode = "force_installed";
};
# vimium
"vimium-store@googlegroups.com" = {
install_url =
"https://addons.mozilla.org/firefox/downloads/latest/vimium-ff/latest.xpi";
installation_mode = "force_installed";
};
};
# about:config
Preferences = {
"browser.contentblocking.category" = {
Value = "strict";
Status = "locked";
};
"extensions.pocket.enabled" = lock-false;
"extensions.screenshots.disabled" = lock-true;
"browser.topsites.contile.enabled" = lock-false;
"browser.formfill.enable" = lock-false;
"browser.search.suggest.enabled" = lock-false;
"browser.search.suggest.enabled.private" = lock-false;
"browser.urlbar.suggest.searches" = lock-false;
"browser.urlbar.showSearchSuggestionsFirst" = lock-false;
"browser.newtabpage.activity-stream.feeds.section.topstories" =
lock-false;
"browser.newtabpage.activity-stream.feeds.snippets" = lock-false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" =
lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeBookmarks" =
lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeDownloads" =
lock-false;
"browser.newtabpage.activity-stream.section.highlights.includeVisited" =
lock-false;
"browser.newtabpage.activity-stream.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.system.showSponsored" = lock-false;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false;
};
};
};
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.nixvim = { programs.nixvim = {

View File

@@ -1,118 +1,113 @@
import XMonad
import XMonad.Util.EZConfig
-- import XMonad.Util.Ungrab -- import XMonad.Util.Ungrab
-- import XMonad.Operations (unGrab) -- import XMonad.Operations (unGrab)
import XMonad.Hooks.EwmhDesktops import Graphics.X11.ExtraTypes.XF86
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Actions.GroupNavigation
import XMonad.Hooks.DynamicLog import XMonad.Hooks.DynamicLog
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.StatusBar import XMonad.Hooks.StatusBar
import XMonad.Hooks.StatusBar.PP import XMonad.Hooks.StatusBar.PP
import XMonad.Hooks.ManageDocks
import XMonad.Util.Loggers
import XMonad.Util.SpawnOnce ( spawnOnce )
import XMonad.Layout.NoBorders import XMonad.Layout.NoBorders
import XMonad.Actions.GroupNavigation
import XMonad.Actions.CycleWS
import XMonad.StackSet
import Graphics.X11.ExtraTypes.XF86
import XMonad.Layout.Spacing import XMonad.Layout.Spacing
import XMonad.StackSet
import XMonad.Util.EZConfig
import XMonad.Util.Loggers
import XMonad.Util.SpawnOnce (spawnOnce)
main :: IO () main :: IO ()
main = xmonad main =
xmonad
. ewmhFullscreen . ewmhFullscreen
. ewmh . ewmh
. withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) toggleStrutsKey . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) toggleStrutsKey
$ myConfig $ myConfig
where where
toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym) toggleStrutsKey :: XConfig Layout -> (KeyMask, KeySym)
toggleStrutsKey XConfig{ modMask = m } = (m, xK_End) toggleStrutsKey XConfig {modMask = m} = (m, xK_End)
myConfig = let myConfig =
terminal = "kitty" let terminal = "kitty"
browser = "firefox" browser = "librewolf"
modm = mod4Mask -- super/meta modm = mod4Mask -- super/meta
in def in def
{ modMask = modm { modMask = modm,
, terminal = terminal terminal = terminal,
, startupHook = myStartupHook startupHook = myStartupHook,
, layoutHook = spacingWithEdge 3 $ myLayout layoutHook = spacingWithEdge 3 $ myLayout,
, logHook = historyHook logHook = historyHook
} }
`additionalKeysP` `additionalKeysP` [ ("M-b", spawn browser),
[ ("M-b", spawn browser)
-- , ("M-t", spawn terminal) -- , ("M-t", spawn terminal)
-- , ("M-S-Enter", spawn terminal) -- , ("M-S-Enter", spawn terminal)
-- , ("<Print>", spawn "scrot ~/Pictures/Screenshots/%b-%d::%H-%M-%S.png") -- , ("<Print>", spawn "scrot ~/Pictures/Screenshots/%b-%d::%H-%M-%S.png")
, ("<Print>", spawn "/home/fredrikr/.scrot.sh") ("<Print>", spawn "/home/fredrikr/.scrot.sh")
-- , ("<M-S-s>", unGrab *> spawn "scrot -s ~/Pictures/Screenshots/%b-%d::%H-%M-%S.png") -- , ("<M-S-s>", unGrab *> spawn "scrot -s ~/Pictures/Screenshots/%b-%d::%H-%M-%S.png")
] ]
`additionalKeys` `additionalKeys` [ ((mod1Mask, xK_Tab), nextMatch History (return True)),
[ ((mod1Mask, xK_Tab), nextMatch History (return True)) ((modm, xK_Escape), spawn "dm-tool lock"),
, ((modm, xK_Escape), spawn "dm-tool lock") ((modm, xK_Down), nextWS),
, ((modm, xK_Down), nextWS) ((modm, xK_Up), prevWS),
, ((modm, xK_Up), prevWS) ((modm .|. shiftMask, xK_Down), shiftToNext),
, ((modm .|. shiftMask, xK_Down), shiftToNext) ((modm .|. shiftMask, xK_Up), shiftToPrev),
, ((modm .|. shiftMask, xK_Up), shiftToPrev) ((modm, xK_z), spawn "zathura"),
, ((modm, xK_z), spawn "zathura") ((modm, xK_y), withFocused $ windows . sink), -- %! Push window back into tiling
, ((modm, xK_y), withFocused $ windows . sink) -- %! Push window back into tiling ((modm, xK_i), sendMessage Shrink), -- %! Shrink the master area
, ((modm, xK_i), sendMessage Shrink) -- %! Shrink the master area ((modm, xK_o), sendMessage Expand), -- %! Expand the master area
, ((modm, xK_o), sendMessage Expand) -- %! Expand the master area ((modm, xK_r), withFocused $ windows . sink), -- %! Resize viewed windows to the correct size
, ((modm, xK_r), withFocused $ windows . sink) -- %! Resize viewed windows to the correct size ((modm, xK_a), sendMessage ToggleStruts),
, ((modm, xK_a), sendMessage ToggleStruts) ((0, xF86XK_AudioLowerVolume), spawn "amixer set Master 2%-"),
, ((0, xF86XK_AudioLowerVolume ), spawn "amixer set Master 2%-") ((0, xF86XK_AudioRaiseVolume), spawn "amixer set Master 2%+"),
, ((0, xF86XK_AudioRaiseVolume ), spawn "amixer set Master 2%+") ((0, xF86XK_AudioMute), spawn "amixer set Master toggle"),
, ((0, xF86XK_AudioMute ), spawn "amixer set Master toggle") ((0, xF86XK_MonBrightnessUp), spawn "brightnessctl set 5%+"),
, ((0, xF86XK_MonBrightnessUp ), spawn "brightnessctl set 5%+") ((0, xF86XK_MonBrightnessDown), spawn "brightnessctl set 5%-"),
, ((0, xF86XK_MonBrightnessDown ), spawn "brightnessctl set 5%-") ((modm .|. shiftMask, xK_Return), spawn terminal),
, ((modm .|. shiftMask, xK_Return), spawn terminal) ((modm, xK_e), spawn "emacsclient -c -a emacs")
, ((modm, xK_e), spawn "emacsclient -c -a emacs") ]
++ [ ((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces numPadKeys,
(f, m) <- [(greedyView, 0), (shift, shiftMask)]
]
++ [ ((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces myWSKeys,
(f, m) <- [(greedyView, 0), (shift, shiftMask)]
] ]
++
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces numPadKeys
, (f, m) <- [(greedyView, 0), (shift, shiftMask)]]
++
[((m .|. modm, k), windows $ f i)
| (i, k) <- zip myWorkspaces myWSKeys
, (f, m) <- [(greedyView, 0), (shift, shiftMask)]]
where where
myWorkspaces = ["1","2","3","4","5","6","7","8","9","0"] myWorkspaces = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]
-- Non-numeric num pad keys, sorted by number -- Non-numeric num pad keys, sorted by number
numPadKeys = [ xK_KP_End, xK_KP_Down, xK_KP_Page_Down -- 1, 2, 3 numPadKeys =
, xK_KP_Left, xK_KP_Begin, xK_KP_Right -- 4, 5, 6 [ xK_KP_End,
, xK_KP_Home, xK_KP_Up, xK_KP_Page_Up -- 7, 8, 9 xK_KP_Down,
, xK_KP_Insert] -- 0 xK_KP_Page_Down, -- 1, 2, 3
myWSKeys = [xK_h, xK_t, xK_n, xK_s] ++ [xK_5..xK_9] xK_KP_Left,
xK_KP_Begin,
xK_KP_Right, -- 4, 5, 6
xK_KP_Home,
xK_KP_Up,
xK_KP_Page_Up, -- 7, 8, 9
xK_KP_Insert -- 0
]
myWSKeys = [xK_h, xK_t, xK_n, xK_s] ++ [xK_5 .. xK_9]
myXmobarPP :: PP myXmobarPP :: PP
myXmobarPP = def myXmobarPP =
{ ppSep = magenta "" def
, ppTitleSanitize = xmobarStrip { ppSep = magenta "",
, ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 ppTitleSanitize = xmobarStrip,
, ppHidden = white . wrap " " "" ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2,
, ppHiddenNoWindows = lowWhite . wrap " " "" ppHidden = white . wrap " " "",
, ppUrgent = red . wrap (yellow "!") (yellow "!") ppHiddenNoWindows = lowWhite . wrap " " "",
, ppOrder = \[ws, l, _, wins] -> [ws, l, wins] ppUrgent = red . wrap (yellow "!") (yellow "!"),
, ppExtras = [logTitles formatFocused formatUnfocused] ppOrder = \[ws, l, _, wins] -> [ws, l, wins],
ppExtras = [logTitles formatFocused formatUnfocused]
} }
where where
formatFocused = wrap (white "[") (white "]") . magenta . ppWindow formatFocused = wrap (white "[") (white "]") . magenta . ppWindow
formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow
-- | Windows should have *some* title, which should not not exceed a -- \| Windows should have *some* title, which should not not exceed a
-- sane length. -- sane length.
ppWindow :: String -> String ppWindow :: String -> String
ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30
@@ -125,20 +120,19 @@ myXmobarPP = def
red = xmobarColor "#ff5555" "" red = xmobarColor "#ff5555" ""
lowWhite = xmobarColor "#bbbbbb" "" lowWhite = xmobarColor "#bbbbbb" ""
myStartupHook :: X () myStartupHook :: X ()
myStartupHook = do myStartupHook = do
spawnOnce "trayer --edge bottom --align right --SetDockType true \ spawnOnce
"trayer --edge bottom --align right --SetDockType true \
\--SetPartialStrut true --expand false --width 5 --transparent true \ \--SetPartialStrut true --expand false --width 5 --transparent true \
\--alpha 0 --tint 0x000000 --height 18 --distance 0" \--alpha 0 --tint 0x000000 --height 18 --distance 0"
spawnOnce "feh --bg-fill --no-fehbg /usr/share/nix.png" spawnOnce "feh --bg-fill --no-fehbg /usr/share/nix.png"
myLayout = avoidStruts $ smartBorders tiled ||| smartBorders (Mirror tiled) ||| smartBorders Full myLayout = avoidStruts $ smartBorders tiled ||| smartBorders (Mirror tiled) ||| smartBorders Full
where where
tiled = Tall nmaster delta ratio tiled = Tall nmaster delta ratio
nmaster = 1 -- Default number of windows in the master pane nmaster = 1 -- Default number of windows in the master pane
ratio = 3/5 -- Default proportion of screen occupied by master pane ratio = 3 / 5 -- Default proportion of screen occupied by master pane
delta = 2/100 -- Percent of screen to increment by when resizing panes delta = 2 / 100 -- Percent of screen to increment by when resizing panes
-- toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_a) -- toggleStrutsKey XConfig {XMonad.modMask = modMask} = (modMask, xK_a)