diff --git a/bin/kami b/bin/kami new file mode 100755 index 0000000..9b1b728 Binary files /dev/null and b/bin/kami differ diff --git a/bin/picom-jonaburg b/bin/picom-jonaburg new file mode 100755 index 0000000..68dc2f3 Binary files /dev/null and b/bin/picom-jonaburg differ diff --git a/bin/picom-pijulius b/bin/picom-pijulius new file mode 100755 index 0000000..e92d650 Binary files /dev/null and b/bin/picom-pijulius differ diff --git a/configs/scripts/print-fullscreen b/bin/print-fullscreen similarity index 100% rename from configs/scripts/print-fullscreen rename to bin/print-fullscreen diff --git a/configs/scripts/print-select b/bin/print-select similarity index 100% rename from configs/scripts/print-select rename to bin/print-select diff --git a/configs/MangoHud/MangoHud.conf b/configs/MangoHud/MangoHud.conf index ec31a5a..a562af0 100644 --- a/configs/MangoHud/MangoHud.conf +++ b/configs/MangoHud/MangoHud.conf @@ -10,3 +10,4 @@ cpu_load_value=50,90 core_load_change engine_version swap +font_scale=0.8 diff --git a/configs/MangoHud/wine-CodeVein-Win64-Shipping.conf b/configs/MangoHud/wine-CodeVein-Win64-Shipping.conf new file mode 100644 index 0000000..8b80040 --- /dev/null +++ b/configs/MangoHud/wine-CodeVein-Win64-Shipping.conf @@ -0,0 +1,14 @@ +gamemode +wine +position=top-left +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 + diff --git a/configs/MangoHud/wine-CodeVein.conf b/configs/MangoHud/wine-CodeVein.conf new file mode 100644 index 0000000..8b80040 --- /dev/null +++ b/configs/MangoHud/wine-CodeVein.conf @@ -0,0 +1,14 @@ +gamemode +wine +position=top-left +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 + diff --git a/configs/MangoHud/wine-DarkSoulsII.conf b/configs/MangoHud/wine-DarkSoulsII.conf new file mode 100644 index 0000000..a562af0 --- /dev/null +++ b/configs/MangoHud/wine-DarkSoulsII.conf @@ -0,0 +1,13 @@ +gamemode +wine +position=top-right +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 diff --git a/configs/MangoHud/wine-DarkSoulsIII.conf b/configs/MangoHud/wine-DarkSoulsIII.conf new file mode 100644 index 0000000..a562af0 --- /dev/null +++ b/configs/MangoHud/wine-DarkSoulsIII.conf @@ -0,0 +1,13 @@ +gamemode +wine +position=top-right +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 diff --git a/configs/MangoHud/wine-DarkSoulsRemastered.conf b/configs/MangoHud/wine-DarkSoulsRemastered.conf new file mode 100644 index 0000000..a562af0 --- /dev/null +++ b/configs/MangoHud/wine-DarkSoulsRemastered.conf @@ -0,0 +1,13 @@ +gamemode +wine +position=top-right +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 diff --git a/configs/MangoHud/wine-SoTGame.conf b/configs/MangoHud/wine-SoTGame.conf new file mode 100644 index 0000000..434a659 --- /dev/null +++ b/configs/MangoHud/wine-SoTGame.conf @@ -0,0 +1,13 @@ +gamemode +wine +position=middle-right +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 diff --git a/configs/MangoHud/wine-Warframe.x64.conf b/configs/MangoHud/wine-Warframe.x64.conf new file mode 100644 index 0000000..bbfd03b --- /dev/null +++ b/configs/MangoHud/wine-Warframe.x64.conf @@ -0,0 +1,14 @@ +gamemode +wine +position=middle-right +cpu_temp +gpu_temp +ram +custom_text_center=jabuxas-benchmark +cpu_load_color=00FFFF,00FFFF,FF00FF +cpu_load_value=50,90 +core_load_change +engine_version +swap +font_scale=0.8 + diff --git a/configs/MangoHud/wine-eldenring.conf b/configs/MangoHud/wine-eldenring.conf index f3ea2f9..b2b5b1d 100644 --- a/configs/MangoHud/wine-eldenring.conf +++ b/configs/MangoHud/wine-eldenring.conf @@ -9,3 +9,5 @@ engine_version swap fps_limit=30 wine_color=#548813 +font_scale=0.7 + diff --git a/configs/MangoHud/wine-start_protected_game.conf b/configs/MangoHud/wine-start_protected_game.conf index f3ea2f9..d1768f1 100644 --- a/configs/MangoHud/wine-start_protected_game.conf +++ b/configs/MangoHud/wine-start_protected_game.conf @@ -9,3 +9,5 @@ engine_version swap fps_limit=30 wine_color=#548813 +font_scale=0.8 + diff --git a/configs/alacritty/alacritty.yml b/configs/alacritty/alacritty.yml new file mode 100644 index 0000000..2a32e91 --- /dev/null +++ b/configs/alacritty/alacritty.yml @@ -0,0 +1,65 @@ +colors: + primary: + background: '0x282828' + foreground: '0xdfbf8e' + + normal: + black: '0x665c54' + red: '0xea6962' + green: '0xa9b665' + yellow: '0xe78a4e' + blue: '0x7daea3' + magenta: '0xd3869b' + cyan: '0x89b482' + white: '0xdfbf8e' + + bright: + black: '0x928374' + red: '0xea6962' + green: '0xa9b665' + yellow: '0xe3a84e' + blue: '0x7daea3' + magenta: '0xd3869b' + cyan: '0x89b482' + white: '0xdfbf8e' +# Font configuration +font: + # The normal (roman) font face to use. + normal: + family: Blex Mono Nerd Font + # Style can be specified to pick a specific face. + style: Regular + + # The bold font face + bold: + family: Hack Nerd Font + # Style can be specified to pick a specific face. + # style: Bold + + # The italic font face + italic: + family: InconsolataGo Nerd Font + # Style can be specified to pick a specific face. + # style: Italic + + + + # Point size + size: 13.0 + +window: + dimensions: + columns: 140 + lines: 40 + + opacity: 0.90 + + padding: + x: 12 + y: 12 + + position: + x: 955 + y: 545 + + diff --git a/configs/autostart/conky.desktop b/configs/autostart/conky.desktop new file mode 100644 index 0000000..5ea516f --- /dev/null +++ b/configs/autostart/conky.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=conky +Comment=conky config startup +Exec=/home/klein/.config/conky/Regulus/start.sh +OnlyShowIn=XFCE; +RunHook=0 +StartupNotify=false +Terminal=false +Hidden=false + diff --git a/configs/autostart/glava.desktop b/configs/autostart/glava.desktop new file mode 100644 index 0000000..88a81d5 --- /dev/null +++ b/configs/autostart/glava.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=0.9.4 +Type=Application +Name=picom +Comment=Glava Audio Visualizer +Exec=sh -c 'sleep 10 && glava --desktop' +OnlyShowIn=XFCE; +RunHook=0 +StartupNotify=false +Terminal=false +Hidden=false \ No newline at end of file diff --git a/configs/autostart/xfce.sh.desktop b/configs/autostart/xfce.sh.desktop new file mode 100644 index 0000000..3e387c2 --- /dev/null +++ b/configs/autostart/xfce.sh.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Exec=/home/klein/xfce.sh +Icon=dialog-scripts +Name=xfce.sh +Path= +Type=Application +X-KDE-AutostartScript=true diff --git a/configs/awesome/awesome-wm-widgets b/configs/awesome/awesome-wm-widgets new file mode 160000 index 0000000..3bb3d56 --- /dev/null +++ b/configs/awesome/awesome-wm-widgets @@ -0,0 +1 @@ +Subproject commit 3bb3d56c26ac3500aab33381af0cccebf6aaa05c diff --git a/configs/awesome/gruvbox/theme.lua b/configs/awesome/gruvbox/theme.lua index 0274707..910a4fd 100644 --- a/configs/awesome/gruvbox/theme.lua +++ b/configs/awesome/gruvbox/theme.lua @@ -11,18 +11,18 @@ local themes_path = gfs.get_themes_dir() local theme = {} -theme.font = "mononoki Nerd Font 11" +theme.font = "InconsolataGo Nerd Font 13" -theme.bg_normal = "#222222" -theme.bg_focus = "#B79759" -theme.bg_urgent = "#5E8D87" -theme.bg_minimize = "#444444" -theme.bg_systray = theme.bg_normal +theme.bg_normal = "#222222" +theme.bg_focus = "#B79759" +theme.bg_urgent = "#5E8D87" +theme.bg_minimize = "#444444" +theme.bg_systray = theme.bg_normal -theme.fg_normal = "#aaaaaa" -theme.fg_focus = "#ffffff" -theme.fg_urgent = "#ffffff" -theme.fg_minimize = "#ffffff" +theme.fg_normal = "#aaaaaa" +theme.fg_focus = "#ffffff" +theme.fg_urgent = "#ffffff" +theme.fg_minimize = "#ffffff" theme.useless_gap = dpi(5) theme.border_width = dpi(2) @@ -61,9 +61,9 @@ theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( -- Variables set for theming the menu: -- menu_[bg|fg]_[normal|focus] -- menu_[border_color|border_width] -theme.menu_submenu_icon = themes_path.."default/submenu.png" -theme.menu_height = dpi(15) -theme.menu_width = dpi(100) +theme.menu_submenu_icon = themes_path .. "default/submenu.png" +theme.menu_height = dpi(15) +theme.menu_width = dpi(100) -- You can add as many variables as -- you wish and access them by using @@ -71,51 +71,51 @@ theme.menu_width = dpi(100) --theme.bg_widget = "#cc0000" -- Define the image to load -theme.titlebar_close_button_normal = themes_path.."default/titlebar/close_normal.png" -theme.titlebar_close_button_focus = themes_path.."default/titlebar/close_focus.png" +theme.titlebar_close_button_normal = themes_path .. "default/titlebar/close_normal.png" +theme.titlebar_close_button_focus = themes_path .. "default/titlebar/close_focus.png" -theme.titlebar_minimize_button_normal = themes_path.."default/titlebar/minimize_normal.png" -theme.titlebar_minimize_button_focus = themes_path.."default/titlebar/minimize_focus.png" +theme.titlebar_minimize_button_normal = themes_path .. "default/titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path .. "default/titlebar/minimize_focus.png" -theme.titlebar_ontop_button_normal_inactive = themes_path.."default/titlebar/ontop_normal_inactive.png" -theme.titlebar_ontop_button_focus_inactive = themes_path.."default/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_active = themes_path.."default/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_active = themes_path.."default/titlebar/ontop_focus_active.png" +theme.titlebar_ontop_button_normal_inactive = themes_path .. "default/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = themes_path .. "default/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = themes_path .. "default/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = themes_path .. "default/titlebar/ontop_focus_active.png" -theme.titlebar_sticky_button_normal_inactive = themes_path.."default/titlebar/sticky_normal_inactive.png" -theme.titlebar_sticky_button_focus_inactive = themes_path.."default/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_active = themes_path.."default/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_active = themes_path.."default/titlebar/sticky_focus_active.png" +theme.titlebar_sticky_button_normal_inactive = themes_path .. "default/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = themes_path .. "default/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = themes_path .. "default/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = themes_path .. "default/titlebar/sticky_focus_active.png" -theme.titlebar_floating_button_normal_inactive = themes_path.."default/titlebar/floating_normal_inactive.png" -theme.titlebar_floating_button_focus_inactive = themes_path.."default/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_active = themes_path.."default/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_active = themes_path.."default/titlebar/floating_focus_active.png" +theme.titlebar_floating_button_normal_inactive = themes_path .. "default/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = themes_path .. "default/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = themes_path .. "default/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = themes_path .. "default/titlebar/floating_focus_active.png" -theme.titlebar_maximized_button_normal_inactive = themes_path.."default/titlebar/maximized_normal_inactive.png" -theme.titlebar_maximized_button_focus_inactive = themes_path.."default/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_active = themes_path.."default/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_active = themes_path.."default/titlebar/maximized_focus_active.png" +theme.titlebar_maximized_button_normal_inactive = themes_path .. "default/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = themes_path .. "default/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = themes_path .. "default/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = themes_path .. "default/titlebar/maximized_focus_active.png" -theme.wallpaper = themes_path.."default/background.png" +theme.wallpaper = themes_path .. "default/background.png" -- You can use your own layout icons like this: -theme.layout_fairh = themes_path.."default/layouts/fairhw.png" -theme.layout_fairv = themes_path.."default/layouts/fairvw.png" -theme.layout_floating = themes_path.."default/layouts/floatingw.png" -theme.layout_magnifier = themes_path.."default/layouts/magnifierw.png" -theme.layout_max = themes_path.."default/layouts/maxw.png" -theme.layout_fullscreen = themes_path.."default/layouts/fullscreenw.png" -theme.layout_tilebottom = themes_path.."default/layouts/tilebottomw.png" -theme.layout_tileleft = themes_path.."default/layouts/tileleftw.png" -theme.layout_tile = themes_path.."default/layouts/tilew.png" -theme.layout_tiletop = themes_path.."default/layouts/tiletopw.png" -theme.layout_spiral = themes_path.."default/layouts/spiralw.png" -theme.layout_dwindle = themes_path.."default/layouts/dwindlew.png" -theme.layout_cornernw = themes_path.."default/layouts/cornernww.png" -theme.layout_cornerne = themes_path.."default/layouts/cornernew.png" -theme.layout_cornersw = themes_path.."default/layouts/cornersww.png" -theme.layout_cornerse = themes_path.."default/layouts/cornersew.png" +theme.layout_fairh = themes_path .. "default/layouts/fairhw.png" +theme.layout_fairv = themes_path .. "default/layouts/fairvw.png" +theme.layout_floating = themes_path .. "default/layouts/floatingw.png" +theme.layout_magnifier = themes_path .. "default/layouts/magnifierw.png" +theme.layout_max = themes_path .. "default/layouts/maxw.png" +theme.layout_fullscreen = themes_path .. "default/layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path .. "default/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path .. "default/layouts/tileleftw.png" +theme.layout_tile = themes_path .. "default/layouts/tilew.png" +theme.layout_tiletop = themes_path .. "default/layouts/tiletopw.png" +theme.layout_spiral = themes_path .. "default/layouts/spiralw.png" +theme.layout_dwindle = themes_path .. "default/layouts/dwindlew.png" +theme.layout_cornernw = themes_path .. "default/layouts/cornernww.png" +theme.layout_cornerne = themes_path .. "default/layouts/cornernew.png" +theme.layout_cornersw = themes_path .. "default/layouts/cornersww.png" +theme.layout_cornerse = themes_path .. "default/layouts/cornersew.png" -- Generate Awesome icon: theme.awesome_icon = theme_assets.awesome_icon( diff --git a/configs/awesome/rc.lua b/configs/awesome/rc.lua index 96c55fc..c954017 100644 --- a/configs/awesome/rc.lua +++ b/configs/awesome/rc.lua @@ -12,7 +12,7 @@ local mpdarc_widget = require("awesome-wm-widgets.mpdarc-widget.mpdarc") local cpu_widget = require("awesome-wm-widgets.cpu-widget.cpu-widget") local ram_widget = require("awesome-wm-widgets.ram-widget.ram-widget") local volume_widget = require('awesome-wm-widgets.volume-widget.volume') -local box_separator = wibox.widget.textbox (" | ") +local box_separator = wibox.widget.textbox(" | ") -- Theme handling library local beautiful = require("beautiful") -- Notification library @@ -27,24 +27,24 @@ require("awful.hotkeys_popup.keys") -- Check if awesome encountered an error during startup and fell back to -- another config (This code will only ever execute for the fallback config) if awesome.startup_errors then - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, there were errors during startup!", - text = awesome.startup_errors }) + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) end -- Handle runtime errors after startup do - local in_error = false - awesome.connect_signal("debug::error", function (err) - -- Make sure we don't go into an endless error loop - if in_error then return end - in_error = true + local in_error = false + awesome.connect_signal("debug::error", function(err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true - naughty.notify({ preset = naughty.config.presets.critical, - title = "Oops, an error happened!", - text = tostring(err) }) - in_error = false - end) + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) }) + in_error = false + end) end -- }}} @@ -53,7 +53,8 @@ end beautiful.init(gears.filesystem.get_configuration_dir() .. "gruvbox/theme.lua") -- This is used later as the default terminal and editor to run. -terminal = "alacritty" +terminal = "kitty" +-- terminal = "urxvtc" editor = os.getenv("EDITOR") or "nvim" editor_cmd = terminal .. " -e " .. editor @@ -66,42 +67,42 @@ modkey = "Mod4" -- Table of layouts to cover with awful.layout.inc, order matters. awful.layout.layouts = { - awful.layout.suit.tile, - awful.layout.suit.floating, - -- awful.layout.suit.tile.left, - -- awful.layout.suit.tile.bottom, - -- awful.layout.suit.tile.top, - awful.layout.suit.fair, - -- awful.layout.suit.fair.horizontal, - -- awful.layout.suit.spiral, - -- awful.layout.suit.spiral.dwindle, - -- awful.layout.suit.max, - -- awful.layout.suit.max.fullscreen, - -- awful.layout.suit.magnifier, - -- awful.layout.suit.corner.nw, - -- awful.layout.suit.corner.ne, - -- awful.layout.suit.corner.sw, - -- awful.layout.suit.corner.se, + awful.layout.suit.tile, + awful.layout.suit.floating, + -- awful.layout.suit.tile.left, + -- awful.layout.suit.tile.bottom, + -- awful.layout.suit.tile.top, + awful.layout.suit.fair, + -- awful.layout.suit.fair.horizontal, + -- awful.layout.suit.spiral, + -- awful.layout.suit.spiral.dwindle, + -- awful.layout.suit.max, + -- awful.layout.suit.max.fullscreen, + -- awful.layout.suit.magnifier, + -- awful.layout.suit.corner.nw, + -- awful.layout.suit.corner.ne, + -- awful.layout.suit.corner.sw, + -- awful.layout.suit.corner.se, } -- }}} -- {{{ Menu -- Create a launcher widget and a main menu myawesomemenu = { - { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, - { "manual", terminal .. " -e man awesome" }, - { "edit config", editor_cmd .. " " .. awesome.conffile }, - { "restart", awesome.restart }, - { "quit", function() awesome.quit() end }, + { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, + { "manual", terminal .. " -e man awesome" }, + { "edit config", editor_cmd .. " " .. awesome.conffile }, + { "restart", awesome.restart }, + { "quit", function() awesome.quit() end }, } mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "open terminal", terminal } - } - }) + { "open terminal", terminal } +} +}) mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, - menu = mymainmenu }) + menu = mymainmenu }) -- Menubar configuration menubar.utils.terminal = terminal -- Set the terminal for applications that require it @@ -116,389 +117,417 @@ mytextclock = wibox.widget.textclock() -- Create a wibox for each screen and add it local taglist_buttons = gears.table.join( - awful.button({ }, 1, function(t) t:view_only() end), - awful.button({ modkey }, 1, function(t) - if client.focus then - client.focus:move_to_tag(t) - end - end), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, function(t) - if client.focus then - client.focus:toggle_tag(t) - end - end), - awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) - ) + awful.button({}, 1, function(t) t:view_only() end), + awful.button({ modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({}, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end), + awful.button({}, 4, function(t) awful.tag.viewnext(t.screen) end), + awful.button({}, 5, function(t) awful.tag.viewprev(t.screen) end) +) local tasklist_buttons = gears.table.join( - awful.button({ }, 1, function (c) - if c == client.focus then - c.minimized = true - else - c:emit_signal( - "request::activate", - "tasklist", - {raise = true} - ) - end - end), - awful.button({ }, 3, function() - awful.menu.client_list({ theme = { width = 250 } }) - end), - awful.button({ }, 4, function () - awful.client.focus.byidx(1) - end), - awful.button({ }, 5, function () - awful.client.focus.byidx(-1) - end)) + awful.button({}, 1, function(c) + if c == client.focus then + c.minimized = true + else + c:emit_signal( + "request::activate", + "tasklist", + { raise = true } + ) + end + end), + awful.button({}, 3, function() + awful.menu.client_list({ theme = { width = 250 } }) + end), + awful.button({}, 4, function() + awful.client.focus.byidx(1) + end), + awful.button({}, 5, function() + awful.client.focus.byidx(-1) + end)) local function set_wallpaper(s) - -- Wallpaper - if beautiful.wallpaper then - local wallpaper = beautiful.wallpaper - -- If wallpaper is a function, call it with the screen - if type(wallpaper) == "function" then - wallpaper = wallpaper(s) - end - gears.wallpaper.maximized(wallpaper, s, true) + -- Wallpaper + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) end + gears.wallpaper.maximized(wallpaper, s, true) + end end -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) screen.connect_signal("property::geometry", set_wallpaper) awful.screen.connect_for_each_screen(function(s) - -- Wallpaper - set_wallpaper(s) + -- Wallpaper + set_wallpaper(s) - -- Each screen has its own tag table. - awful.tag({ "term", "web", "irc", "gfx", "vm", "code", "music", "email", "x" }, s, awful.layout.layouts[1]) + -- Each screen has its own tag table. + awful.tag({ "term", "web", "irc", "gfx", "vm", "code", "music", "email", "x" }, s, awful.layout.layouts[1]) - -- Create a promptbox for each screen - s.mypromptbox = awful.widget.prompt() - -- Create an imagebox widget which will contain an icon indicating which layout we're using. - -- We need one layoutbox per screen. - s.mylayoutbox = awful.widget.layoutbox(s) - s.mylayoutbox:buttons(gears.table.join( - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc( 1) end), - awful.button({ }, 5, function () awful.layout.inc(-1) end))) - -- Create a taglist widget - s.mytaglist = awful.widget.taglist { - screen = s, - filter = awful.widget.taglist.filter.all, - buttons = taglist_buttons - } + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt() + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = awful.widget.layoutbox(s) + s.mylayoutbox:buttons(gears.table.join( + awful.button({}, 1, function() awful.layout.inc(1) end), + awful.button({}, 3, function() awful.layout.inc(-1) end), + awful.button({}, 4, function() awful.layout.inc(1) end), + awful.button({}, 5, function() awful.layout.inc(-1) end))) + -- Create a taglist widget + s.mytaglist = awful.widget.taglist { + screen = s, + filter = awful.widget.taglist.filter.all, + buttons = taglist_buttons + } - -- Create a tasklist widget - s.mytasklist = awful.widget.tasklist { - screen = s, - filter = awful.widget.tasklist.filter.currenttags, - buttons = tasklist_buttons - } + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = tasklist_buttons + } - -- Create the wibox - s.mywibox = awful.wibar({ position = "top", screen = s }) + -- Create the wibox + s.mywibox = awful.wibar({ position = "top", screen = s }) - -- Add widgets to the wibox - s.mywibox:setup { - layout = wibox.layout.align.horizontal, - { -- Left widgets - layout = wibox.layout.fixed.horizontal, --- mylauncher, - s.mytaglist, - s.mylayoutbox, - s.mypromptbox, - }, - s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, --- mykeyboardlayout, - mpdarc_widget, - box_separator, - cpu_widget({ + -- Add widgets to the wibox + s.mywibox:setup { + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + -- mylauncher, + s.mytaglist, + s.mylayoutbox, + s.mypromptbox, + }, + s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + -- mykeyboardlayout, + mpdarc_widget, + box_separator, + cpu_widget({ width = 70, step_width = 2, step_spacing = 0, color = '#8c9440', }), - box_separator, - ram_widget(), - box_separator, - mytextclock, - box_separator, - volume_widget(), - box_separator, - wibox.widget.systray(), - }, - } + box_separator, + ram_widget(), + box_separator, + mytextclock, + box_separator, + volume_widget(), + box_separator, + wibox.widget.systray(), + }, + } end) -- }}} -- {{{ Mouse bindings root.buttons(gears.table.join( - awful.button({ }, 3, function () mymainmenu:toggle() end), - awful.button({ }, 4, awful.tag.viewnext), - awful.button({ }, 5, awful.tag.viewprev) + awful.button({}, 3, function() mymainmenu:toggle() end), + awful.button({}, 4, awful.tag.viewnext), + awful.button({}, 5, awful.tag.viewprev) )) -- }}} -- {{{ Key bindings globalkeys = gears.table.join( - awful.key({ modkey, }, "s", hotkeys_popup.show_help, - {description="show help", group="awesome"}), - awful.key({ modkey, }, "Left", awful.tag.viewprev, - {description = "view previous", group = "tag"}), - awful.key({ modkey, }, "Right", awful.tag.viewnext, - {description = "view next", group = "tag"}), - awful.key({ modkey, "Control"}, "Escape", awful.tag.history.restore, - {description = "go back", group = "tag"}), + awful.key({ modkey, }, "s", hotkeys_popup.show_help, + { description = "show help", group = "awesome" }), + awful.key({ modkey, }, "Left", awful.tag.viewprev, + { description = "view previous", group = "tag" }), + awful.key({ modkey, }, "Right", awful.tag.viewnext, + { description = "view next", group = "tag" }), + awful.key({ modkey, "Control" }, "Escape", awful.tag.history.restore, + { description = "go back", group = "tag" }), - awful.key({ modkey, }, "j", - function () - awful.client.focus.byidx( 1) - end, - {description = "focus next by index", group = "client"} - ), - awful.key({ modkey, }, "k", - function () - awful.client.focus.byidx(-1) - end, - {description = "focus previous by index", group = "client"} - ), - awful.key({ modkey, }, "w", function () mymainmenu:show() end, - {description = "show main menu", group = "awesome"}), + awful.key({ modkey, }, "j", + function() + awful.client.focus.byidx(1) + end, + { description = "focus next by index", group = "client" } + ), + awful.key({ modkey, }, "k", + function() + awful.client.focus.byidx(-1) + end, + { description = "focus previous by index", group = "client" } + ), + awful.key({ modkey, }, "w", function() mymainmenu:show() end, + { description = "show main menu", group = "awesome" }), - -- Layout manipulation - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, - {description = "swap with next client by index", group = "client"}), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, - {description = "swap with previous client by index", group = "client"}), - awful.key({ modkey }, ".", function () awful.screen.focus_relative( 1) end, - {description = "focus the next screen", group = "screen"}), - awful.key({ modkey }, ",", function () awful.screen.focus_relative(-1) end, - {description = "focus the previous screen", group = "screen"}), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto, - {description = "jump to urgent client", group = "client"}), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end, - {description = "go back", group = "client"}), + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function() awful.client.swap.byidx(1) end, + { description = "swap with next client by index", group = "client" }), + awful.key({ modkey, "Shift" }, "k", function() awful.client.swap.byidx(-1) end, + { description = "swap with previous client by index", group = "client" }), + awful.key({ modkey }, ".", function() awful.screen.focus_relative(1) end, + { description = "focus the next screen", group = "screen" }), + awful.key({ modkey }, ",", function() awful.screen.focus_relative(-1) end, + { description = "focus the previous screen", group = "screen" }), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto, + { description = "jump to urgent client", group = "client" }), + awful.key({ modkey, }, "Tab", + function() + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end, + { description = "go back", group = "client" }), - -- Standard program - awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, - {description = "open a terminal", group = "launcher"}), - awful.key({ modkey, "Shift" }, "r", awesome.restart, - {description = "reload awesome", group = "awesome"}), - awful.key({ modkey, "Shift" }, "q", awesome.quit, - {description = "quit awesome", group = "awesome"}), + -- Standard program + awful.key({ modkey, }, "Return", function() awful.spawn(terminal) end, + { description = "open a terminal", group = "launcher" }), + awful.key({ modkey, "Shift" }, "r", awesome.restart, + { description = "reload awesome", group = "awesome" }), + awful.key({ modkey, "Shift" }, "q", awesome.quit, + { description = "quit awesome", group = "awesome" }), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, - {description = "increase master width factor", group = "layout"}), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, - {description = "decrease master width factor", group = "layout"}), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, - {description = "increase the number of master clients", group = "layout"}), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, - {description = "decrease the number of master clients", group = "layout"}), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, - {description = "increase the number of columns", group = "layout"}), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, - {description = "decrease the number of columns", group = "layout"}), - awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, - {description = "select next", group = "layout"}), - awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, - {description = "select previous", group = "layout"}), + awful.key({ modkey, }, "l", function() awful.tag.incmwfact(0.05) end, + { description = "increase master width factor", group = "layout" }), + awful.key({ modkey, }, "h", function() awful.tag.incmwfact(-0.05) end, + { description = "decrease master width factor", group = "layout" }), + awful.key({ modkey, "Shift" }, "h", function() awful.tag.incnmaster(1, nil, true) end, + { description = "increase the number of master clients", group = "layout" }), + awful.key({ modkey, "Shift" }, "l", function() awful.tag.incnmaster(-1, nil, true) end, + { description = "decrease the number of master clients", group = "layout" }), + awful.key({ modkey, "Control" }, "h", function() awful.tag.incncol(1, nil, true) end, + { description = "increase the number of columns", group = "layout" }), + awful.key({ modkey, "Control" }, "l", function() awful.tag.incncol(-1, nil, true) end, + { description = "decrease the number of columns", group = "layout" }), + awful.key({ modkey, }, "space", function() awful.layout.inc(1) end, + { description = "select next", group = "layout" }), + awful.key({ modkey, "Shift" }, "space", function() awful.layout.inc(-1) end, + { description = "select previous", group = "layout" }), - awful.key({ modkey, "Control" }, "n", - function () - local c = awful.client.restore() - -- Focus restored client - if c then - c:emit_signal( - "request::activate", "key.unminimize", {raise = true} - ) - end - end, - {description = "restore minimized", group = "client"}), + awful.key({ modkey, "Control" }, "n", + function() + local c = awful.client.restore() + -- Focus restored client + if c then + c:emit_signal( + "request::activate", "key.unminimize", { raise = true } + ) + end + end, + { description = "restore minimized", group = "client" }), -- Personal Keybindings - awful.key({ modkey, "Shift" }, "Return", function () - awful.util.spawn("rofi -show drun") end, - {description = "launch rofi", group = "personal"}), + awful.key({ modkey, "Shift" }, "Return", function() + awful.util.spawn("/home/klein/.config/rofi/launchers/type-7/launcher.sh") + end, + { description = "launch rofi", group = "personal" }), - awful.key({ modkey }, "e", function () - awful.util.spawn("pcmanfm") end, - {description = "launch PCManFM", group = "personal"}), - awful.key({ modkey }, "b", function () - awful.util.spawn("brave-bin") end, - {description = "launch brave", group = "personal"}), + awful.key({ modkey, "Control" }, "Return", function() + awful.util.spawn("/home/klein/.config/rofi/applets/bin/mpd.sh") + end, + { description = "launch mpd 'gui'", group = "personal" }), - awful.key({ modkey }, "v", function () - awful.util.spawn("vscodium") end, - {description = "launch vscodium", group = "personal"}), - awful.key({ modkey }, "Escape", function () - awful.util.spawn("mpc toggle") end, - {description = "toggle pause/play music", group = "personal"}), + awful.key({ modkey, "Shift" }, "Escape", function() + awful.spawn.with_shell("/home/klein/.config/rofi/powermenu/type-6/powermenu.sh") + end, + { description = "launch rofi", group = "personal" }), - awful.key({ modkey }, "F1", function () - awful.util.spawn("mpc prev") end, - {description = "previous music", group = "personal"}), + awful.key({ modkey }, "e", function() + awful.util.spawn("pcmanfm") + end, + { description = "launch PCManFM", group = "personal" }), - awful.key({ modkey }, "F2", function () - awful.util.spawn("mpc next") end, - {description = "next music", group = "personal"}), + awful.key({ modkey }, "b", function() + -- awful.util.spawn("brave-bin") end, + awful.util.spawn("firefox") + end, + { description = "launch browser", group = "personal" }), - awful.key({ modkey, "Shift" }, "m", function () - awful.util.spawn("alacritty -e ncmpcpp") end, - {description = "launch ncmpcpp", group = "personal"}), + awful.key({ modkey }, "v", function() + awful.util.spawn("vscodium") + end, + { description = "launch vscodium", group = "personal" }), - awful.key({"Shift"}, "Print", function () - awful.spawn.with_shell("sh $HOME/.local/bin/print-select") end, - {description = "print selected area", group = "personal"}), + awful.key({ modkey, "Shift" }, "v", function() + awful.util.spawn("emacsclient -c") + end, + { description = "launch emacs", group = "personal" }), - awful.key({}, "Print", function () - awful.spawn.with_shell("sh $HOME/.local/bin/print-fullscreen") end, - {description = "print fullscreen", group = "personal"}), + awful.key({ modkey }, "Escape", function() + awful.util.spawn("mpc toggle") + end, + { description = "toggle pause/play music", group = "personal" }), + + awful.key({ modkey }, "F1", function() + awful.util.spawn("mpc prev") + end, + { description = "previous music", group = "personal" }), + + awful.key({ modkey }, "F2", function() + awful.util.spawn("mpc next") + end, + { description = "next music", group = "personal" }), + + awful.key({ modkey, "Shift" }, "m", function() + awful.util.spawn("alacritty -e ncmpcpp") + end, + { description = "launch ncmpcpp", group = "personal" }), + + awful.key({ "Shift" }, "Print", function() + awful.spawn.with_shell("sh $HOME/.local/bin/print-select") + end, + { description = "print selected area", group = "personal" }), + + awful.key({}, "Print", function() + awful.spawn.with_shell("sh $HOME/.local/bin/print-fullscreen") + end, + { description = "print fullscreen", group = "personal" }), -- Prompt - awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, - {description = "run prompt", group = "launcher"}), + awful.key({ modkey }, "r", function() awful.screen.focused().mypromptbox:run() end, + { description = "run prompt", group = "launcher" }), - awful.key({ modkey }, "x", - function () - awful.prompt.run { - prompt = "Run Lua code: ", --- textbox = awful.screen.focused().mypromptbox.widget, - exe_callback = awful.util.eval, - history_path = awful.util.get_cache_dir() .. "/history_eval" - } - end, - {description = "lua execute prompt", group = "awesome"}), - -- Menubar - awful.key({ modkey, "Control" }, "p", function() menubar.show() end, - {description = "show the menubar", group = "launcher"}) + awful.key({ modkey }, "x", + function() + awful.prompt.run { + prompt = "Run Lua code: ", + -- textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } + end, + { description = "lua execute prompt", group = "awesome" }), + -- Menubar + awful.key({ modkey, "Control" }, "p", function() menubar.show() end, + { description = "show the menubar", group = "launcher" }) ) clientkeys = gears.table.join( - awful.key({ modkey, }, "f", - function (c) - c.fullscreen = not c.fullscreen - c:raise() - end, - {description = "toggle fullscreen", group = "client"}), - awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, - {description = "close", group = "client"}), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , - {description = "toggle floating", group = "client"}), - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, - {description = "move to master", group = "client"}), - awful.key({ modkey, "Shift"}, ".", function (c) c:move_to_screen(0) end, - {description = "move to screen", group = "client"}), - awful.key({ modkey, "Shift"}, ",", function (c) c:move_to_screen(1) end, - {description = "move to screen", group = "client"}), - awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, - {description = "toggle keep on top", group = "client"}), - awful.key({ modkey, }, "n", - function (c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end , - {description = "minimize", group = "client"}), - awful.key({ modkey, }, "m", - function (c) - c.maximized = not c.maximized - c:raise() - end , - {description = "(un)maximize", group = "client"}), - awful.key({ modkey, "Control" }, "m", - function (c) - c.maximized_vertical = not c.maximized_vertical - c:raise() - end , - {description = "(un)maximize vertically", group = "client"}), - awful.key({ modkey, "Shift" }, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c:raise() - end , - {description = "(un)maximize horizontally", group = "client"}) + awful.key({ modkey, }, "f", + function(c) + c.fullscreen = not c.fullscreen + c:raise() + end, + { description = "toggle fullscreen", group = "client" }), + awful.key({ modkey, "Shift" }, "c", function(c) c:kill() end, + { description = "close", group = "client" }), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle, + { description = "toggle floating", group = "client" }), + awful.key({ modkey }, "p", function(c) c:swap(awful.client.getmaster()) end, + { description = "move to master", group = "client" }), + awful.key({ modkey, "Shift" }, ".", function(c) c:move_to_screen(0) end, + { description = "move to screen", group = "client" }), + awful.key({ modkey, "Shift" }, ",", function(c) c:move_to_screen(1) end, + { description = "move to screen", group = "client" }), + awful.key({ modkey, }, "t", function(c) c.ontop = not c.ontop end, + { description = "toggle keep on top", group = "client" }), + awful.key({ modkey, }, "n", + function(c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end, + { description = "minimize", group = "client" }), + awful.key({ modkey, }, "m", + function(c) + c.maximized = not c.maximized + c:raise() + end, + { description = "(un)maximize", group = "client" }), + awful.key({ modkey, "Control" }, "m", + function(c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end, + { description = "(un)maximize vertically", group = "client" }), + awful.key({ modkey, "Shift" }, "m", + function(c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() + end, + { description = "(un)maximize horizontally", group = "client" }) ) -- Bind all key numbers to tags. -- Be careful: we use keycodes to make it work on any keyboard layout. -- This should map on the top row of your keyboard, usually 1 to 9. for i = 1, 9 do - globalkeys = gears.table.join(globalkeys, - -- View tag only. - awful.key({ modkey }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - tag:view_only() - end - end, - {description = "view tag #"..i, group = "tag"}), - -- Toggle tag display. - awful.key({ modkey, "Control" }, "#" .. i + 9, - function () - local screen = awful.screen.focused() - local tag = screen.tags[i] - if tag then - awful.tag.viewtoggle(tag) - end - end, - {description = "toggle tag #" .. i, group = "tag"}), - -- Move client to tag. - awful.key({ modkey, "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:move_to_tag(tag) - end - end - end, - {description = "move focused client to tag #"..i, group = "tag"}), - -- Toggle tag on focused client. - awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, - function () - if client.focus then - local tag = client.focus.screen.tags[i] - if tag then - client.focus:toggle_tag(tag) - end - end - end, - {description = "toggle focused client on tag #" .. i, group = "tag"}) - ) + globalkeys = gears.table.join(globalkeys, + -- View tag only. + awful.key({ modkey }, "#" .. i + 9, + function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, + { description = "view tag #" .. i, group = "tag" }), + -- Toggle tag display. + awful.key({ modkey, "Control" }, "#" .. i + 9, + function() + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, + { description = "toggle tag #" .. i, group = "tag" }), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, + { description = "move focused client to tag #" .. i, group = "tag" }), + -- Toggle tag on focused client. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function() + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, + { description = "toggle focused client on tag #" .. i, group = "tag" }) + ) end clientbuttons = gears.table.join( - awful.button({ }, 1, function (c) - c:emit_signal("request::activate", "mouse_click", {raise = true}) - end), - awful.button({ modkey }, 1, function (c) - c:emit_signal("request::activate", "mouse_click", {raise = true}) - awful.mouse.client.move(c) - end), - awful.button({ modkey }, 3, function (c) - c:emit_signal("request::activate", "mouse_click", {raise = true}) - awful.mouse.client.resize(c) - end) + awful.button({}, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + end), + awful.button({ modkey }, 1, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + awful.mouse.client.move(c) + end), + awful.button({ modkey }, 3, function(c) + c:emit_signal("request::activate", "mouse_click", { raise = true }) + awful.mouse.client.resize(c) + end) ) -- Set keys @@ -508,137 +537,150 @@ root.keys(globalkeys) -- {{{ Rules -- Rules to apply to new clients (through the "manage" signal). awful.rules.rules = { - -- All clients will match this rule. - { rule = { }, - properties = { border_width = beautiful.border_width, - border_color = beautiful.border_normal, - focus = awful.client.focus.filter, - raise = true, - keys = clientkeys, - buttons = clientbuttons, - screen = awful.screen.preferred, - placement = awful.placement.no_overlap+awful.placement.no_offscreen - } + -- All clients will match this rule. + { rule = {}, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap + awful.placement.no_offscreen + } + }, + + -- Floating clients. + { rule_any = { + instance = { + "DTA", -- Firefox addon DownThemAll. + "copyq", -- Includes session name in class. + "pinentry", + }, + class = { + "Arandr", + "Blueman-manager", + "Gpick", + "Pavucontrol", + "Arandr", + "Blueman-manager", + "Transmission-gtk", + "Bottles", + "Lutris", + "Virt-manager", + "Pcmanfm", + "Nitrogen", + "PolyMC", + "scrcpy", + "Kruler", + "MessageWin", -- kalarm. + "Sxiv", + "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. + "Wpa_gui", + "veromix", + "xtightvncviewer" }, - -- Floating clients. - { rule_any = { - instance = { - "DTA", -- Firefox addon DownThemAll. - "copyq", -- Includes session name in class. - "pinentry", - }, - class = { - "Arandr", - "Blueman-manager", - "Gpick", - "Pavucontrol", - "Arandr", - "Blueman-manager", - "Transmission-gtk", - "Bottles", - "Lutris", - "Virt-manager", - "Pcmanfm", - "Nitrogen", - "PolyMC", - "scrcpy", - "Kruler", - "MessageWin", -- kalarm. - "Sxiv", - "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. - "Wpa_gui", - "veromix", - "xtightvncviewer"}, - - -- Note that the name property shown in xprop might be set slightly after creation of the client - -- and the name shown there might not match defined rules here. - name = { - "Event Tester", -- xev. - }, - role = { - "AlarmWindow", -- Thunderbird's calendar. - "ConfigManager", -- Thunderbird's about:config. - "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. - } - }, properties = { floating = true }}, - - -- Add titlebars to normal clients and dialogs - { rule_any = {type = { "normal", "dialog" } - }, properties = { titlebars_enabled = false } + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = { + "Event Tester", -- xev. }, + role = { + "AlarmWindow", -- Thunderbird's calendar. + "ConfigManager", -- Thunderbird's about:config. + "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. + } + }, properties = { floating = true } }, - { rule = { class = "Steam" }, - properties = { screen = 1, tag = "x" } }, + -- Add titlebars to normal clients and dialogs + { rule_any = { type = { "normal", "dialog" } + }, properties = { titlebars_enabled = false } + }, - { rule = { class = "discord" }, - properties = { screen = 2, tag = "irc" } }, + { rule = { class = "Steam" }, + properties = { screen = 2, tag = "x" } }, - { rule = {class = "Brave-browser"}, - properties = {screen = 2, tag = "web"}}, + { rule = { class = "discord" }, + properties = { screen = 2, tag = "irc" } }, - { rule = {class = "leagueclientux.exe"}, - properties = {screen = 1, tag = "web"}}, + { rule = { class = "firefox-esr" }, + properties = { screen = 2, tag = "web" } }, - { rule = {class = "league of legends.exe"}, - properties = {screen = 1, tag = "web"}}, + { rule = { class = "leagueclientux.exe" }, + properties = { floating = true, screen = 1, tag = "gfx" } }, - { rule = {class = "Minecraft 1.19"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "league of legends.exe" }, + properties = { floating = true, screen = 1, tag = "gfx" } }, - { rule = {class = "riotclientux.exe"}, - properties = {screen = 1, tag = "web"}}, + { rule = { class = "Minecraft 1.19" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "dauntless-win64-shipping.exe"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "riotclientux.exe" }, + properties = { floating = true, screen = 1, tag = "gfx" } }, - { rule = {class = "leagueclient.exe"}, - properties = {screen = 1, tag = "web"}}, + { rule = { class = "dauntless-win64-shipping.exe" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_335300"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "leagueclient.exe" }, + properties = { floating = true, screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_292030"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_678960" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_381210"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_335300" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_374320"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "battle.net.exe" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_814380"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "overwatch.exe" }, + properties = { screen = 1, tag = "gfx" } }, + { rule = { class = "steam_app_312060" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_1172620"}, - properties = {screen = 1, tag = "irc"}}, - { rule = {class = "csgo_linux64"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_292030" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_291550"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_381210" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_1245620"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_374320" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_570940"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_814380" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_1172470"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_1172620" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_1446780"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "csgo_linux64" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "steam_app_230410"}, - properties = {screen = 1, tag = "irc"}}, + { rule = { class = "steam_app_291550" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "Lutris"}, - properties = {screen = 1, tag = "gfx"}}, + { rule = { class = "steam_app_1245620" }, + properties = { screen = 1, tag = "gfx" } }, - { rule = {class = "Virt-manager"}, - properties = {screen = 1, tag = "vm"}}, + { rule = { class = "steam_app_570940" }, + properties = { screen = 1, tag = "gfx" } }, + + { rule = { class = "steam_app_1172470" }, + properties = { screen = 1, tag = "gfx" } }, + + { rule = { class = "steam_app_1446780" }, + properties = { screen = 1, tag = "gfx" } }, + + { rule = { class = "steam_app_230410" }, + properties = { screen = 1, tag = "gfx" } }, + + { rule = { class = "Lutris" }, + properties = { screen = 1, tag = "gfx" } }, + + { rule = { class = "Virt-manager" }, + properties = { screen = 1, tag = "vm" } }, @@ -647,62 +689,62 @@ awful.rules.rules = { -- {{{ Signals -- Signal function to execute when a new client appears. -client.connect_signal("manage", function (c) - -- Set the windows at the slave, - -- i.e. put it at the end of others instead of setting it master. - -- if not awesome.startup then awful.client.setslave(c) end +client.connect_signal("manage", function(c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end - if awesome.startup + if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then - -- Prevent clients from being unreachable after screen count changes. - awful.placement.no_offscreen(c) - end + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end end) -- Add a titlebar if titlebars_enabled is set to true in the rules. client.connect_signal("request::titlebars", function(c) - -- buttons for the titlebar - local buttons = gears.table.join( - awful.button({ }, 1, function() - c:emit_signal("request::activate", "titlebar", {raise = true}) - awful.mouse.client.move(c) - end), - awful.button({ }, 3, function() - c:emit_signal("request::activate", "titlebar", {raise = true}) - awful.mouse.client.resize(c) - end) - ) + -- buttons for the titlebar + local buttons = gears.table.join( + awful.button({}, 1, function() + c:emit_signal("request::activate", "titlebar", { raise = true }) + awful.mouse.client.move(c) + end), + awful.button({}, 3, function() + c:emit_signal("request::activate", "titlebar", { raise = true }) + awful.mouse.client.resize(c) + end) + ) - awful.titlebar(c) : setup { - { -- Left - awful.titlebar.widget.iconwidget(c), - buttons = buttons, - layout = wibox.layout.fixed.horizontal - }, - { -- Middle - { -- Title - align = "center", - widget = awful.titlebar.widget.titlewidget(c) - }, - buttons = buttons, - layout = wibox.layout.flex.horizontal - }, - { -- Right - awful.titlebar.widget.floatingbutton (c), - awful.titlebar.widget.maximizedbutton(c), - awful.titlebar.widget.stickybutton (c), - awful.titlebar.widget.ontopbutton (c), - awful.titlebar.widget.closebutton (c), - layout = wibox.layout.fixed.horizontal() - }, - layout = wibox.layout.align.horizontal - } + awful.titlebar(c):setup { + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.floatingbutton(c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton(c), + awful.titlebar.widget.ontopbutton(c), + awful.titlebar.widget.closebutton(c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + } end) -- Enable sloppy focus, so that focus follows mouse. client.connect_signal("mouse::enter", function(c) - c:emit_signal("request::activate", "mouse_enter", {raise = false}) + c:emit_signal("request::activate", "mouse_enter", { raise = false }) end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) @@ -710,7 +752,11 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n -- }}} -- Autostart +awful.spawn.with_shell("/home/klein/scripts/screenlayout.sh") awful.spawn.with_shell("/home/klein/scripts/autostart.sh") +-- awful.spawn.with_shell("urxvtd --quiet --opendisplay --fork") +awful.spawn.with_shell("nm-applet") +awful.spawn.with_shell("nitrogen --restore &") -- Gaps beautiful.useless_gap = 6 diff --git a/configs/.bashrc b/configs/bashrc similarity index 100% rename from configs/.bashrc rename to configs/bashrc diff --git a/configs/picom/original.conf b/configs/picom/original.conf new file mode 100644 index 0000000..4f54b06 --- /dev/null +++ b/configs/picom/original.conf @@ -0,0 +1,193 @@ +# ░█▀█░▀█▀░█▀▀░█▀█░█▄█░░░░█▀▀░█▀█░█▀█░█▀▀ +# ░█▀▀░░█░░█░░░█░█░█░█░░░░█░░░█░█░█░█░█▀▀ +# ░▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░░▀▀▀░▀▀▀░▀░▀░▀░░ +# +# X compositor configuration +# +# ░█▀▀░█░█░█▀█░█▀▄░█▀█░█░█ +# ░▀▀█░█▀█░█▀█░█░█░█░█░█▄█ +# ░▀▀▀░▀░▀░▀░▀░▀▀░░▀▀▀░▀░▀ + +shadow = true; +shadow-radius = 25; +shadow-opacity = 0.3; +shadow-offset-x = -32; +shadow-offset-y = -32; + +# shadow-red = 0 +# shadow-green = 0 +# shadow-blue = 0 +shadow-color = "#000000"; + +shadow-exclude = [ + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "class_g = 'slop'", + "class_g = 'Firefox' && argb", + "class_g = 'Rofi'", + "class_g = 'i3bar'", + "class_g *= 'i3bar'", + "name *= 'i3bar'", + "class_g ?= 'i3bar'", + "class_g *= 'i3'", + "_GTK_FRAME_EXTENTS@:c", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" +]; + +# shadow-exclude-reg = "x10+0+0"; +# xinerama-shadow-crop = true; + +# ░█▀▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀ +# ░█▀▀░█▀█░█░█░░█░░█░█░█░█ +# ░▀░░░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀ + +fading = true; +fade-in-step = 0.02; +fade-out-step = 0.02; +fade-delta = 2; + +fade-exclude = []; + +no-fading-openclose = false; +no-fading-destroyed-argb = true; + +# ░█▀█░█▀█░█▀█░█▀▀░▀█▀░▀█▀░█░█ +# ░█░█░█▀▀░█▀█░█░░░░█░░░█░░░█░ +# ░▀▀▀░▀░░░▀░▀░▀▀▀░▀▀▀░░▀░░░▀░ + +inactive-opacity =1.0; +frame-opacity = 1; +inactive-opacity-override = false; +active-opacity = 1.0; +inactive-dim = 0.1; + +focus-exclude = [ + "class_g = 'Cairo-clock'", + "class_g ?= 'Brave-browser'", + "class_g ?= 'rofi'", + "class_g ?= 'slop'", + "class_g ?= 'Steam'" +]; + +# inactive-dim-fixed = 1.0; + +opacity-rule = [ + "90:class_g = 'Alacritty'", + # "95:class_g = 'kitty'", + "90:class_g = 'lutris'", +# "95:class_g = 'St'", + "90:class_g = 'URxvt'", + "95:class_g = 'Pcmanfm'", + "95:class_g = 'Emacs'", +# "90:class_g = 'discord'" +] + +# ░█▀▄░█░░░█░█░█▀▄░█▀▄░▀█▀░█▀█░█▀▀ +# ░█▀▄░█░░░█░█░█▀▄░█▀▄░░█░░█░█░█░█ +# ░▀▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀ + +blur: { + method = "dual_kawase"; + strength = 10.0; + deviation = 1.0; + kernel = "11x11gaussian"; +} + +blur-background = false; +blur-background-frame = true; +blur-background-fixed = true; +# blur-kern = "3x3box"; + +blur-background-exclude = [ + "class_g = 'slop'", + "class_g = 'Firefox' && argb", + "name = 'rofi - Global Search'", + "_GTK_FRAME_EXTENTS@:c" +]; + +################################# +# Corners # +################################# + +# Sets the radius of rounded window corners. When > 0, the compositor will +# round the corners of windows. Does not interact well with +# `transparent-clipping`. +# corner-radius = 0 +corner-radius = 6; + +# Exclude conditions for rounded corners. +rounded-corners-exclude = [ + "name *= 'tint2'", + "name *= 'jgmenu'", + "name *= 'screenkey'", + "name *= 'polybar'", + "window_type = 'dock'", + "window_type = 'desktop'", + "class_g = 'i3bar'", + "class_g *= 'i3bar'", + "name *= 'i3bar'", + "class_g ?= 'i3bar'", + "class_g *= 'i3'" +]; + +# ░█▀▀░█▀▀░█▀█░█▀▀░█▀▄░█▀█░█░░░░░█▀▀░█▀▀░▀█▀░▀█▀░▀█▀░█▀█░█▀▀░█▀▀ +# ░█░█░█▀▀░█░█░█▀▀░█▀▄░█▀█░█░░░░░▀▀█░█▀▀░░█░░░█░░░█░░█░█░█░█░▀▀█ +# ░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░░░▀▀▀░▀▀░░▀░░░▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀ + +daemon = false; +#backend = "glx"; +vsync = true; +dbus = false; +mark-wmwin-focused = true; +mark-ovredir-focused = true; +detect-rounded-corners = true; +detect-client-opacity = true; +refresh-rate = 0; +# use-ewmh-active-win = true; +# unredir-if-possible = false; +# unredir-if-possible-delay = 0; + +unredir-if-possible-exclude = []; + +detect-transient = true; +detect-client-leader = true; +resize-damage = 1; + +invert-color-include = []; + +glx-no-stencil = true; +# glx-no-rebind-pixmap = false; +use-damage = true; +# xrender-sync-fence = true; + +# glx-fshader-win = ""; +# force-win-blend = false; + +# no-ewmh-fullscreen = false; +# max-brightness = 1.0; + +transparent-clipping = false; + +#log-level = "warn"; +#log-file = "~/.cache/picom-log.log"; +show-all-xerrors = true; +# write-pid-path = '/path/to/your/mom'; + +wintypes: { + tooltip = { fade = true; shadow = false; focus = false; }; + normal = { shadow = true; }; + dock = { shadow = false; }; + dnd = { shadow = false; }; + popup_menu = { shadow = true; focus = false; }; + dropdown_menu = { shadow = true; focus = false; }; + above = { shadow = true; }; + splash = { shadow = false; }; + utility = { focus = false; shadow = false; blur-background = false; }; + notification = { shadow = true; }; + desktop = { shadow = false; blur-background = false; }; + menu = { focus = false; }; + dialog = { shadow = true; }; +}; + diff --git a/configs/picom/picom.conf b/configs/picom/picom.conf index 44e2a00..3334644 100644 --- a/configs/picom/picom.conf +++ b/configs/picom/picom.conf @@ -1,193 +1,517 @@ -# ░█▀█░▀█▀░█▀▀░█▀█░█▄█░░░░█▀▀░█▀█░█▀█░█▀▀ -# ░█▀▀░░█░░█░░░█░█░█░█░░░░█░░░█░█░█░█░█▀▀ -# ░▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░░▀▀▀░▀▀▀░▀░▀░▀░░ -# -# X compositor configuration -# -# ░█▀▀░█░█░█▀█░█▀▄░█▀█░█░█ -# ░▀▀█░█▀█░█▀█░█░█░█░█░█▄█ -# ░▀▀▀░▀░▀░▀░▀░▀▀░░▀▀▀░▀░▀ +################################# +# Animations # +################################# +# requires https://github.com/jonaburg/picom +# (These are also the default values) +animations = true +transition-length = 300 +transition-pow-x = 0.1 +transition-pow-y = 0.1 +transition-pow-w = 0.1 +transition-pow-h = 0.1 +size-transition = true -shadow = true; -shadow-radius = 25; -shadow-opacity = 0.3; -shadow-offset-x = -32; -shadow-offset-y = -32; +################################# +# Corners # +################################# +# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom +corner-radius = 10.0; +rounded-corners-exclude = [ + #"window_type = 'normal'", + "class_g = 'awesome'", + # "class_g = 'URxvt'", + "class_g = 'XTerm'", + "class_g = 'kitty'", + "class_g = 'Alacritty'", + "class_g = 'Polybar'", + "class_g = 'code-oss'", + #"class_g = 'TelegramDesktop'", + # "class_g = 'firefox'", + # "class_g = 'Thunderbird'" +]; +round-borders = 1; +round-borders-exclude = [ + #"class_g = 'TelegramDesktop'", +]; + +################################# +# Shadows # +################################# + + +# Enabled client-side shadows on windows. Note desktop windows +# (windows with '_NET_WM_WINDOW_TYPE_DESKTOP') never get shadow, +# unless explicitly requested using the wintypes option. +# +# shadow = false +shadow = false; + +# The blur radius for shadows, in pixels. (defaults to 12) +# shadow-radius = 12 +shadow-radius = 7; + +# The opacity of shadows. (0.0 - 1.0, defaults to 0.75) +# shadow-opacity = .75 + +# The left offset for shadows, in pixels. (defaults to -15) +# shadow-offset-x = -15 +shadow-offset-x = -7; + +# The top offset for shadows, in pixels. (defaults to -15) +# shadow-offset-y = -15 +shadow-offset-y = -7; + +# Avoid drawing shadows on dock/panel windows. This option is deprecated, +# you should use the wintypes* option in your config file instead. +# +#no-dock-shadow = false + +# Don't draw shadows on drag-and-drop windows. This option is deprecated, +# you should use the *wintypes* option in your config file instead. +# +# no-dnd-shadow = false +animations-exclude = [ + "class_g = 'steam_app_1172620'" +] +# Red color value of shadow (0.0 - 1.0, defaults to 0). # shadow-red = 0 + +# Green color value of shadow (0.0 - 1.0, defaults to 0). # shadow-green = 0 + +# Blue color value of shadow (0.0 - 1.0, defaults to 0). # shadow-blue = 0 -shadow-color = "#000000"; +# Do not paint shadows on shaped windows. Note shaped windows +# here means windows setting its shape through X Shape extension. +# Those using ARGB background is beyond our control. +# Deprecated, use +# shadow-exclude = 'bounding_shaped' +# or +# shadow-exclude = 'bounding_shaped && !rounded_corners' +# instead. +# +# shadow-ignore-shaped = '' + +# Specify a list of conditions of windows that should have no shadow. +# +# examples: +# shadow-exclude = "n:e:Notification"; +# +# shadow-exclude = [] shadow-exclude = [ - "name = 'Notification'", - "class_g = 'Conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "class_g = 'slop'", - "class_g = 'Firefox' && argb", - "class_g = 'Rofi'", - "class_g = 'i3bar'", - "class_g *= 'i3bar'", - "name *= 'i3bar'", - "class_g ?= 'i3bar'", - "class_g *= 'i3'", - "_GTK_FRAME_EXTENTS@:c", - "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" + "name = 'Notification'", + "class_g = 'Conky'", + "class_g ?= 'Notify-osd'", + "class_g = 'Cairo-clock'", + "class_g = 'slop'", + "class_g = 'trayer'", + "class_g = 'Polybar'", + "_GTK_FRAME_EXTENTS@:c" ]; -# shadow-exclude-reg = "x10+0+0"; -# xinerama-shadow-crop = true; +# Specify a X geometry that describes the region in which shadow should not +# be painted in, such as a dock window region. Use +# shadow-exclude-reg = "x10+0+0" +# for example, if the 10 pixels on the bottom of the screen should not have shadows painted on. +# +# shadow-exclude-reg = "" -# ░█▀▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀ -# ░█▀▀░█▀█░█░█░░█░░█░█░█░█ -# ░▀░░░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀ +# Crop shadow of a window fully on a particular Xinerama screen to the screen. +# xinerama-shadow-crop = false -fading = true; -fade-in-step = 0.02; -fade-out-step = 0.02; -fade-delta = 2; -fade-exclude = []; +################################# +# Fading # +################################# -no-fading-openclose = false; -no-fading-destroyed-argb = true; -# ░█▀█░█▀█░█▀█░█▀▀░▀█▀░▀█▀░█░█ -# ░█░█░█▀▀░█▀█░█░░░░█░░░█░░░█░ -# ░▀▀▀░▀░░░▀░▀░▀▀▀░▀▀▀░░▀░░░▀░ +# Fade windows in/out when opening/closing and when opacity changes, +# unless no-fading-openclose is used. + fading = false; +# fading = true; -inactive-opacity =1.0; -frame-opacity = 1; -inactive-opacity-override = false; -active-opacity = 1.0; -inactive-dim = 0.1; +# Opacity change between steps while fading in. (0.01 - 1.0, defaults to 0.028) +# fade-in-step = 0.028 +fade-in-step = 0.03; -focus-exclude = [ - "class_g = 'Cairo-clock'", - "class_g ?= 'Brave-browser'", - "class_g ?= 'rofi'", - "class_g ?= 'slop'", - "class_g ?= 'Steam'" -]; +# Opacity change between steps while fading out. (0.01 - 1.0, defaults to 0.03) +# fade-out-step = 0.03 +fade-out-step = 0.03; -# inactive-dim-fixed = 1.0; +# The time between steps in fade step, in milliseconds. (> 0, defaults to 10) +# fade-delta = 10 -opacity-rule = [ - "90:class_g = 'Alacritty'", - "90:class_g = 'kitty'", - "90:class_g = 'lutris'", -# "95:class_g = 'St'", - "90:class_g = 'URxvt'", - "95:class_g = 'Pcmanfm'", - "95:class_g = 'Emacs'", -# "90:class_g = 'discord'" +# Specify a list of conditions of windows that should not be faded. +# don't need this, we disable fading for all normal windows with wintypes: {} +fade-exclude = [ + "class_g = 'slop'" # maim ] -# ░█▀▄░█░░░█░█░█▀▄░█▀▄░▀█▀░█▀█░█▀▀ -# ░█▀▄░█░░░█░█░█▀▄░█▀▄░░█░░█░█░█░█ -# ░▀▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀ +# Do not fade on window open/close. +# no-fading-openclose = false -blur: { - method = "dual_kawase"; - strength = 10.0; - deviation = 1.0; - kernel = "11x11gaussian"; -} +# Do not fade destroyed ARGB windows with WM frame. Workaround of bugs in Openbox, Fluxbox, etc. +# no-fading-destroyed-argb = false -blur-background = false; -blur-background-frame = true; -blur-background-fixed = true; + +################################# +# Transparency / Opacity # +################################# + + +# Opacity of inactive windows. (0.1 - 1.0, defaults to 1.0) +# inactive-opacity = 1 +# inactive-opacity = 0.8; + +# Opacity of window titlebars and borders. (0.1 - 1.0, disabled by default) +# frame-opacity = 1.0 +# frame-opacity = 0.7; + +# Default opacity for dropdown menus and popup menus. (0.0 - 1.0, defaults to 1.0) +# menu-opacity = 1.0 +# menu-opacity is depreciated use dropdown-menu and popup-menu instead. + +#If using these 2 below change their values in line 510 & 511 aswell +# popup_menu = { opacity = 0.8; } +# dropdown_menu = { opacity = 0.8; } + + +# Let inactive opacity set by -i override the '_NET_WM_OPACITY' values of windows. +# inactive-opacity-override = true +inactive-opacity-override = false; + +# Default opacity for active windows. (0.0 - 1.0, defaults to 1.0) +active-opacity = 1.0; + +# Dim inactive windows. (0.0 - 1.0, defaults to 0.0) +# inactive-dim = 0.0 + +# Specify a list of conditions of windows that should always be considered focused. +# focus-exclude = [] +focus-exclude = [ + "class_g = 'Cairo-clock'", + "class_g = 'Bar'", # lemonbar + "class_g = 'slop'" # maim +]; + +# Use fixed inactive dim value, instead of adjusting according to window opacity. +# inactive-dim-fixed = 1.0 + +# Specify a list of opacity rules, in the format `PERCENT:PATTERN`, +# like `50:name *= "Firefox"`. picom-trans is recommended over this. +# Note we don't make any guarantee about possible conflicts with other +# programs that set '_NET_WM_WINDOW_OPACITY' on frame or client windows. +# example: +# opacity-rule = [ "80:class_g = 'URxvt'" ]; +# +# opacity-rule = [] +opacity-rule = [ + "80:class_g = 'Bar'", # lemonbar + "100:class_g = 'slop'", # maim + "100:class_g = 'XTerm'", + "95:class_g = 'URxvt'", + "90:class_g = 'kitty'", + "100:class_g = 'Alacritty'", + "80:class_g = 'Polybar'", + "100:class_g = 'code-oss'", + "100:class_g = 'Meld'", + "70:class_g = 'TelegramDesktop'", + "90:class_g = 'Joplin'", + "100:class_g = 'firefox'", + "100:class_g = 'Thunderbird'" +]; + + +################################# +# Background-Blurring # +################################# + + +# Parameters for background blurring, see the *BLUR* section for more information. +# blur-method = +# blur-size = 12 +# +# blur-deviation = false + +# Blur background of semi-transparent / ARGB windows. +# Bad in performance, with driver-dependent behavior. +# The name of the switch may change without prior notifications. +# +# blur-background = true; + +# Blur background of windows when the window frame is not opaque. +# Implies: +# blur-background +# Bad in performance, with driver-dependent behavior. The name may change. +# +# blur-background-frame = false; + + +# Use fixed blur strength rather than adjusting according to window opacity. +# blur-background-fixed = false; + + +# Specify the blur convolution kernel, with the following format: +# example: +# blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1"; +# +# blur-kern = '' # blur-kern = "3x3box"; +blur: { + # requires: https://github.com/ibhagwan/picom + method = "kawase"; + #method = "kernel"; + strength = 9; + # deviation = 1.0; + # kernel = "11x11gaussian"; + background = false; + background-frame = false; + background-fixed = false; + kern = "3x3box"; +} + +# Exclude conditions for background blur. blur-background-exclude = [ - "class_g = 'slop'", - "class_g = 'Firefox' && argb", - "name = 'rofi - Global Search'", - "_GTK_FRAME_EXTENTS@:c" + #"window_type = 'dock'", + #"window_type = 'desktop'", + #"class_g = 'URxvt'", + # + # prevents picom from blurring the background + # when taking selection screenshot with `main` + # https://github.com/naelstrof/maim/issues/130 + "class_g = 'slop'", + "_GTK_FRAME_EXTENTS@:c" ]; + ################################# -# Corners # +# General Settings # ################################# -# Sets the radius of rounded window corners. When > 0, the compositor will -# round the corners of windows. Does not interact well with -# `transparent-clipping`. -# corner-radius = 0 -corner-radius = 6; +# Daemonize process. Fork to background after initialization. Causes issues with certain (badly-written) drivers. +# daemon = true -# Exclude conditions for rounded corners. -rounded-corners-exclude = [ - "name *= 'tint2'", - "name *= 'jgmenu'", - "name *= 'screenkey'", - "name *= 'polybar'", - "window_type = 'dock'", - "window_type = 'desktop'", - "class_g = 'i3bar'", - "class_g *= 'i3bar'", - "name *= 'i3bar'", - "class_g ?= 'i3bar'", - "class_g *= 'i3'" -]; +# Specify the backend to use: `xrender`, `glx`, or `xr_glx_hybrid`. +# `xrender` is the default one. +# +experimental-backends = true; +backend = "glx"; +#backend = "xrender"; -# ░█▀▀░█▀▀░█▀█░█▀▀░█▀▄░█▀█░█░░░░░█▀▀░█▀▀░▀█▀░▀█▀░▀█▀░█▀█░█▀▀░█▀▀ -# ░█░█░█▀▀░█░█░█▀▀░█▀▄░█▀█░█░░░░░▀▀█░█▀▀░░█░░░█░░░█░░█░█░█░█░▀▀█ -# ░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░░░▀▀▀░▀▀░░▀░░░▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀ -daemon = false; -#backend = "glx"; -vsync = true; -dbus = false; +# Enable/disable VSync. +# vsync = false +#vsync = true + +# Enable remote control via D-Bus. See the *D-BUS API* section below for more details. +# dbus = false + +# Try to detect WM windows (a non-override-redirect window with no +# child that has 'WM_STATE') and mark them as active. +# +# mark-wmwin-focused = false mark-wmwin-focused = true; + +# Mark override-redirect windows that doesn't have a child window with 'WM_STATE' focused. +# mark-ovredir-focused = false mark-ovredir-focused = true; + +# Try to detect windows with rounded corners and don't consider them +# shaped windows. The accuracy is not very high, unfortunately. +# +# detect-rounded-corners = false detect-rounded-corners = true; + +# Detect '_NET_WM_OPACITY' on client windows, useful for window managers +# not passing '_NET_WM_OPACITY' of client windows to frame windows. +# +# detect-client-opacity = false detect-client-opacity = true; -refresh-rate = 0; -# use-ewmh-active-win = true; -# unredir-if-possible = false; -# unredir-if-possible-delay = 0; -unredir-if-possible-exclude = []; +# Specify refresh rate of the screen. If not specified or 0, picom will +# try detecting this with X RandR extension. +# +# refresh-rate = 60 +refresh-rate = 0 -detect-transient = true; -detect-client-leader = true; -resize-damage = 1; +# Limit picom to repaint at most once every 1 / 'refresh_rate' second to +# boost performance. This should not be used with +# vsync drm/opengl/opengl-oml +# as they essentially does sw-opti's job already, +# unless you wish to specify a lower refresh rate than the actual value. +# +# sw-opti = -invert-color-include = []; +# Use EWMH '_NET_ACTIVE_WINDOW' to determine currently focused window, +# rather than listening to 'FocusIn'/'FocusOut' event. Might have more accuracy, +# provided that the WM supports it. +# +# use-ewmh-active-win = false -glx-no-stencil = true; -# glx-no-rebind-pixmap = false; -use-damage = true; -# xrender-sync-fence = true; +# Unredirect all windows if a full-screen opaque window is detected, +# to maximize performance for full-screen windows. Known to cause flickering +# when redirecting/unredirecting windows. paint-on-overlay may make the flickering less obvious. +# +# unredir-if-possible = false -# glx-fshader-win = ""; -# force-win-blend = false; +# Delay before unredirecting the window, in milliseconds. Defaults to 0. +# unredir-if-possible-delay = 0 -# no-ewmh-fullscreen = false; -# max-brightness = 1.0; +# Conditions of windows that shouldn't be considered full-screen for unredirecting screen. +# unredir-if-possible-exclude = [] -transparent-clipping = false; +# Use 'WM_TRANSIENT_FOR' to group windows, and consider windows +# in the same group focused at the same time. +# +# detect-transient = false +detect-transient = true -#log-level = "warn"; -#log-file = "~/.cache/picom-log.log"; -show-all-xerrors = true; -# write-pid-path = '/path/to/your/mom'; +# Use 'WM_CLIENT_LEADER' to group windows, and consider windows in the same +# group focused at the same time. 'WM_TRANSIENT_FOR' has higher priority if +# detect-transient is enabled, too. +# +# detect-client-leader = false +detect-client-leader = true -wintypes: { - tooltip = { fade = true; shadow = false; focus = false; }; - normal = { shadow = true; }; - dock = { shadow = false; }; - dnd = { shadow = false; }; - popup_menu = { shadow = true; focus = false; }; - dropdown_menu = { shadow = true; focus = false; }; - above = { shadow = true; }; - splash = { shadow = false; }; - utility = { focus = false; shadow = false; blur-background = false; }; - notification = { shadow = true; }; - desktop = { shadow = false; blur-background = false; }; - menu = { focus = false; }; - dialog = { shadow = true; }; +# Resize damaged region by a specific number of pixels. +# A positive value enlarges it while a negative one shrinks it. +# If the value is positive, those additional pixels will not be actually painted +# to screen, only used in blur calculation, and such. (Due to technical limitations, +# with use-damage, those pixels will still be incorrectly painted to screen.) +# Primarily used to fix the line corruption issues of blur, +# in which case you should use the blur radius value here +# (e.g. with a 3x3 kernel, you should use `--resize-damage 1`, +# with a 5x5 one you use `--resize-damage 2`, and so on). +# May or may not work with *--glx-no-stencil*. Shrinking doesn't function correctly. +# +# resize-damage = 1 + +# Specify a list of conditions of windows that should be painted with inverted color. +# Resource-hogging, and is not well tested. +# +# invert-color-include = [] + +# GLX backend: Avoid using stencil buffer, useful if you don't have a stencil buffer. +# Might cause incorrect opacity when rendering transparent content (but never +# practically happened) and may not work with blur-background. +# My tests show a 15% performance boost. Recommended. +# +# glx-no-stencil = false + +# GLX backend: Avoid rebinding pixmap on window damage. +# Probably could improve performance on rapid window content changes, +# but is known to break things on some drivers (LLVMpipe, xf86-video-intel, etc.). +# Recommended if it works. +# +# glx-no-rebind-pixmap = false + +# Disable the use of damage information. +# This cause the whole screen to be redrawn everytime, instead of the part of the screen +# has actually changed. Potentially degrades the performance, but might fix some artifacts. +# The opposing option is use-damage +# +# no-use-damage = false +#use-damage = true (Causing Weird Black semi opaque rectangles when terminal is opened) +#Changing use-damage to false fixes the problem +use-damage = false + +# Use X Sync fence to sync clients' draw calls, to make sure all draw +# calls are finished before picom starts drawing. Needed on nvidia-drivers +# with GLX backend for some users. +# +# xrender-sync-fence = false + +# GLX backend: Use specified GLSL fragment shader for rendering window contents. +# See `compton-default-fshader-win.glsl` and `compton-fake-transparency-fshader-win.glsl` +# in the source tree for examples. +# +# glx-fshader-win = '' + +# Force all windows to be painted with blending. Useful if you +# have a glx-fshader-win that could turn opaque pixels transparent. +# +# force-win-blend = false + +# Do not use EWMH to detect fullscreen windows. +# Reverts to checking if a window is fullscreen based only on its size and coordinates. +# +# no-ewmh-fullscreen = false + +# Dimming bright windows so their brightness doesn't exceed this set value. +# Brightness of a window is estimated by averaging all pixels in the window, +# so this could comes with a performance hit. +# Setting this to 1.0 disables this behaviour. Requires --use-damage to be disabled. (default: 1.0) +# +# max-brightness = 1.0 + +# Make transparent windows clip other windows like non-transparent windows do, +# instead of blending on top of them. +# +# transparent-clipping = false + +# Set the log level. Possible values are: +# "trace", "debug", "info", "warn", "error" +# in increasing level of importance. Case doesn't matter. +# If using the "TRACE" log level, it's better to log into a file +# using *--log-file*, since it can generate a huge stream of logs. +# +# log-level = "debug" +log-level = "info"; + +# Set the log file. +# If *--log-file* is never specified, logs will be written to stderr. +# Otherwise, logs will to written to the given file, though some of the early +# logs might still be written to the stderr. +# When setting this option from the config file, it is recommended to use an absolute path. +# +# log-file = '/path/to/your/log/file' + +# Show all X errors (for debugging) +# show-all-xerrors = false + +# Write process ID to a file. +# write-pid-path = '/path/to/your/log/file' + +# Window type settings +# +# 'WINDOW_TYPE' is one of the 15 window types defined in EWMH standard: +# "unknown", "desktop", "dock", "toolbar", "menu", "utility", +# "splash", "dialog", "normal", "dropdown_menu", "popup_menu", +# "tooltip", "notification", "combo", and "dnd". +# +# Following per window-type options are available: :: +# +# fade, shadow::: +# Controls window-type-specific shadow and fade settings. +# +# opacity::: +# Controls default opacity of the window type. +# +# focus::: +# Controls whether the window of this type is to be always considered focused. +# (By default, all window types except "normal" and "dialog" has this on.) +# +# full-shadow::: +# Controls whether shadow is drawn under the parts of the window that you +# normally won't be able to see. Useful when the window has parts of it +# transparent, and you want shadows in those areas. +# +# redir-ignore::: +# Controls whether this type of windows should cause screen to become +# redirected again after been unredirected. If you have unredir-if-possible +# set, and doesn't want certain window to cause unnecessary screen redirection, +# you can set this to `true`. +# +wintypes: +{ + normal = { fade = false; shadow = false; } + tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; full-shadow = false; }; + dock = { shadow = false; } + dnd = { shadow = false; } + popup_menu = { opacity = 0.8; } + dropdown_menu = { opacity = 0.8; } }; diff --git a/configs/rofi.klein/colors.rasi b/configs/rofi.klein/colors.rasi new file mode 100644 index 0000000..c7b4245 --- /dev/null +++ b/configs/rofi.klein/colors.rasi @@ -0,0 +1,9 @@ +/* Colors by SzeligBalazs */ + +* { + al: #00000000; + bg: #181818ff; + se: #101010ff; + fg: #D8D8D8ff; + ac: #D8D8D8ff; +} diff --git a/configs/rofi.klein/config.rasi b/configs/rofi.klein/config.rasi new file mode 100644 index 0000000..5936926 --- /dev/null +++ b/configs/rofi.klein/config.rasi @@ -0,0 +1,110 @@ +configuration { + font: "Iosevka Nerd Font 10"; + show-icons: true; + icon-theme: "Papirus"; + display-drun: ""; + drun-display-format: "{name}"; + disable-history: false; + sidebar-mode: false; +} + +@import "colors.rasi" + +window { + transparency: "real"; + background-color: @bg; + text-color: @fg; + border: 3px; + border-color: @ac; + border-radius: 12px; + width: 30%; + location: center; + x-offset: 0; + y-offset: 0; +} + +prompt { + enabled: true; + padding: 0.30% 1% 0% -0.5%; + background-color: @al; + text-color: @fg; + font: "FantasqueSansMono Nerd Font 12"; +} + +entry { + background-color: @al; + text-color: @fg; + placeholder-color: @fg; + expand: true; + horizontal-align: 0; + placeholder: "Search"; + padding: 0.10% 0% 0% 0%; + blink: true; +} + +inputbar { + children: [ prompt, entry ]; + background-color: @bg; + text-color: @fg; + expand: false; + border: 0% 0% 0% 0%; + border-radius: 0px; + border-color: @ac; + margin: 0% 0% 0% 0%; + padding: 1.5%; +} + +listview { + background-color: @al; + padding: 10px; + columns: 2; + lines: 7; + spacing: 1%; + cycle: false; + dynamic: true; + layout: vertical; +} + +mainbox { + background-color: @al; + border: 0% 0% 0% 0%; + border-radius: 0% 0% 0% 0%; + border-color: @ac; + children: [ inputbar, listview ]; + spacing: 0%; + padding: 0%; +} + +element { + background-color: @al; + text-color: @fg; + orientation: horizontal; + border-radius: 0%; + padding: 0.5% 0.5% 0.5% 0.5%; +} + +element-icon { + background-color: inherit; + text-color: inherit; + horizontal-align: 0.5; + vertical-align: 0.5; + size: 24px; + border: 0px; +} + +element-text { + background-color: @al; + text-color: inherit; + expand: true; + horizontal-align: 0; + vertical-align: 0.5; + margin: 0% 0.25% 0% 0.25%; +} + +element selected { + background-color: @ac; + text-color: @bg; + border: 0% 0% 0% 0%; + border-radius: 12px; + border-color: @bg; +} diff --git a/configs/rofi.klein/power-menu.sh b/configs/rofi.klein/power-menu.sh new file mode 100755 index 0000000..cdc0be4 --- /dev/null +++ b/configs/rofi.klein/power-menu.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +## Author : Aditya Shakya (adi1090x) +## Mail : adi1090x@gmail.com +## Github : @adi1090x +## Reddit : @adi1090x + +# Available Styles +# >> Styles Below Only Works With "rofi-git(AUR)", Current Version: 1.5.4-76-gca067234 +# full full_circle full_rounded full_alt +# card card_circle column column_circle +# row row_alt row_circle +# single single_circle single_full single_full_circle single_rounded single_text + +style="power" +rofi_command="rofi -theme /usr/share/rofi/themes/dmenu.rasi" +uptime=$(uptime -p) +my_hostname=$(hostname) + +# Options +shutdown=" Shutdown" +reboot=" Reboot" +logout=" Logout" + +# Variable passed to rofi +options="$shutdown\n$reboot\n$logout" + +chosen="$(echo -e "$options" | $rofi_command -p " $my_hostname | $uptime" -dmenu -selected-row 2)" +case $chosen in + $shutdown) + poweroff + ;; + $reboot) + reboot + ;; + $logout) + pkill -KILL -u $USER + ;; +esac diff --git a/configs/scripts/autostart.sh b/configs/scripts/autostart.sh index 4bfcda9..c7cce2a 100755 --- a/configs/scripts/autostart.sh +++ b/configs/scripts/autostart.sh @@ -1,23 +1,23 @@ #!/bin/bash -sh ~/.dwm/screenlayout.sh - -sleep 1 +sh ~/scripts/screenlayout.sh nitrogen --restore & +nvidia-settings --load-config-only + setxkbmap br abnt2 xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1 -pulseaudio --start +#pulseaudio --start -picom & +#picom & +/home/klein/.local/bin/picom-pijulius -b --experimental-backends --animations --animation-for-open-window zoom --vsync & +# /home/klein/.local/bin/picom-jonaburg & numlockx on -dwmblocks & - mpd & dunst & @@ -27,16 +27,16 @@ lxqt-policykit-agent & touch ~/tmp/touchy rm -rf ~/tmp/* -killall pasystray; pasystray & # killlall is needed in case you reset dwm, it will just spawn infinites pasystrays +#killall pasystray; pasystray & # killlall is needed in case you reset dwm, it will just spawn infinites pasystrays /usr/bin/emacs --daemon & -/home/lucas/.local/bin/idle & +#/home/lucas/.local/bin/idle & #urxvtd --quiet --opendisplay --fork #xrdb -merge ~/.Xresources -otd & +#otd & #discord & # If using regular discord. #flatpak run com.discordapp.Discord & # If using flatpak diff --git a/configs/scripts/cpu.sh b/configs/scripts/cpu.sh new file mode 100755 index 0000000..afa7c7f --- /dev/null +++ b/configs/scripts/cpu.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +top -bn2 | grep '%Cpu' | tail -1 | grep -P '(....|...) id,'|awk '{print "" 100-$8 "%"}' diff --git a/configs/scripts/memory.sh b/configs/scripts/memory.sh new file mode 100755 index 0000000..057b68f --- /dev/null +++ b/configs/scripts/memory.sh @@ -0,0 +1,12 @@ +#!/bin/bash + + +# More efficient version of the above. +free -h | while read What TTL Used _; do + if [ "$What" = 'Mem:' ]; then + printf '%s/%s \n' "$Used" "$TTL" + break + fi +done + + diff --git a/configs/scripts/mouse.sh b/configs/scripts/mouse.sh new file mode 100755 index 0000000..11844a9 --- /dev/null +++ b/configs/scripts/mouse.sh @@ -0,0 +1,9 @@ +#!/bin/bash + + +setxkbmap br abnt2 + +xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 +xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1 +# xinput --set-prop 'pointer:''Microsoft Microsoft Basic Optical Mouse v2.0 ' 'libinput Accel Profile Enabled' 0, 1 +# xinput --set-prop 'pointer:''Microsoft Microsoft Basic Optical Mouse v2.0 ' 'libinput Accel Speed' 0.1 diff --git a/configs/scripts/mpd.sh b/configs/scripts/mpd.sh new file mode 100755 index 0000000..e54a8b4 --- /dev/null +++ b/configs/scripts/mpd.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +mpt=$(mpc current -f %title%) +mpa=$(mpc current -f %artist%) +icon1=' ' +icon2='' +echo "$mpt" + + diff --git a/configs/scripts/screenlayout.sh b/configs/scripts/screenlayout.sh index c3aff5a..253ecb3 100755 --- a/configs/scripts/screenlayout.sh +++ b/configs/scripts/screenlayout.sh @@ -1,2 +1,2 @@ #!/bin/sh -xrandr --output DVI-D-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output HDMI-0 --mode 1400x900 --pos 1920x180 --rotate normal --output DP-0 --off --output DP-1 --off +xrandr --output DVI-D-0 --off --output HDMI-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-0 --off --output DP-1 --mode 1920x1080 --pos 1920x148 --rotate normal diff --git a/configs/scripts/upt.sh b/configs/scripts/upt.sh new file mode 100755 index 0000000..d4c778c --- /dev/null +++ b/configs/scripts/upt.sh @@ -0,0 +1,7 @@ +#!/bin/sh + + +upt="$(uptime --pretty | sed -e 's/up //g' -e 's/ days/d/g' -e 's/ day/d/g' -e 's/ hours/h/g' -e 's/ hour/h/g' -e 's/ minutes/m/g' -e 's/, / /g')" +echo -e "$upt " + + diff --git a/configs/scripts/volume.sh b/configs/scripts/volume.sh new file mode 100755 index 0000000..8d5ff8e --- /dev/null +++ b/configs/scripts/volume.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +vol="$(amixer get Master | tail -n1 | sed -r 's/.*\[(.*)%\].*/\1/')" +echo "${vol}%" + diff --git a/configs/scripts/xfce.sh b/configs/scripts/xfce.sh index 7228d09..f4fb5f2 100755 --- a/configs/scripts/xfce.sh +++ b/configs/scripts/xfce.sh @@ -5,11 +5,11 @@ setxkbmap br abnt2 xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1 -pulseaudio --start +#pulseaudio --start -picom & +#picom & -numlockx on +#numlockx on mpd & diff --git a/configs/scripts/xmonad.sh b/configs/scripts/xmonad.sh index 2708714..a76ad09 100755 --- a/configs/scripts/xmonad.sh +++ b/configs/scripts/xmonad.sh @@ -1,14 +1,30 @@ #!/bin/bash +sh ~/scripts/screenlayout.sh + nitrogen --restore & -picom & +nvidia-settings --load-config-only + +trayer-srg -l --edge top --align right --SetDockType true --SetPartialStrut true \ + --expand true --width 9 --tint 0xFF181814 --height 27 --transparent false --distance 2 --margin 1 & + +# /usr/bin/gentoo-pipewire-launcher & + +if [ -x /usr/bin/nm-applet ] ; then + nm-applet --sm-disable & +fi setxkbmap br abnt2 xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Profile Enabled' 0, 1 xinput --set-prop 'pointer:''Gaming Mouse' 'libinput Accel Speed' 0.1 -pulseaudio --start +#pulseaudio --start + +#picom & +# /home/klein/.local/bin/picom-pijulius -b --experimental-backends --animations --animation-for-open-window zoom --vsync & +/home/klein/.local/bin/picom-pijulius --experimental-backends --animations --animation-for-open-window zoom --glx-no-stencil --xrender-sync-fence -b & +# /home/klein/.local/bin/picom-jonaburg & numlockx on @@ -21,14 +37,16 @@ lxqt-policykit-agent & touch ~/tmp/touchy rm -rf ~/tmp/* -killall pasystray; pasystray & # killlall is needed in case you reset dwm, it will just spawn infinites pasystrays +#killall pasystray; pasystray & # killlall is needed in case you reset dwm, it will just spawn infinites pasystrays /usr/bin/emacs --daemon & +#/home/lucas/.local/bin/idle & + #urxvtd --quiet --opendisplay --fork #xrdb -merge ~/.Xresources -otd & +# otd & #discord & # If using regular discord. #flatpak run com.discordapp.Discord & # If using flatpak diff --git a/configs/xmobar/trayer-padding-icon.sh b/configs/xmobar/trayer-padding-icon.sh deleted file mode 100755 index adee04a..0000000 --- a/configs/xmobar/trayer-padding-icon.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Copied from https://github.com/jaor/xmobar/issues/239#issuecomment-233206552 -# Detects the width of running trayer-srg window (xprop name 'panel') -# and creates an XPM icon of that width, 1px height, and transparent. -# Outputs an -tag for use in xmobar to display the generated -# XPM icon. -# -# Run script from xmobar: -# `Run Com "/where/ever/trayer-padding-icon.sh" [] "trayerpad" 10` -# and use `%trayerpad%` in your template. - - -# Function to create a transparent Wx1 px XPM icon -create_xpm_icon () { - timestamp=$(date) - pixels=$(for i in `seq $1`; do echo -n "."; done) - - cat << EOF > "$2" -/* XPM * -static char * trayer_pad_xpm[] = { -/* This XPM icon is used for padding in xmobar to */ -/* leave room for trayer-srg. It is dynamically */ -/* updated by by trayer-padding-icon.sh which is run */ -/* by xmobar. */ -/* Created: ${timestamp} */ -/* */ -"$1 1 1 1", -/* Colors (none: transparent) */ -". c none", -/* Pixels */ -"$pixels" -}; -EOF -} - -# Width of the trayer window -width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5) - -# Icon file name -iconfile="/tmp/trayer-padding-${width}px.xpm" - -# If the desired icon does not exist create it -if [ ! -f $iconfile ]; then - create_xpm_icon $width $iconfile -fi - -# Output the icon tag for xmobar -echo "" diff --git a/configs/xmobar/xmobarrc b/configs/xmobar/xmobarrc deleted file mode 100644 index 659cac1..0000000 --- a/configs/xmobar/xmobarrc +++ /dev/null @@ -1,42 +0,0 @@ -Config { font = "xft:mononoki Nerd Font Mono:pixelsize=16:antialiasing=true:hinting=true" - , additionalFonts = [ "xft:InconsolataGo Nerd Font:pixelsize=16:antialias=true:hinting=true" - , "xft:Font Awesome 6 Brands:pixelsize=18" - , "xft:Font Awesome 6 Free:pixelsize=18" - ] - , borderColor = "black" - , border = TopB - , bgColor = "#2e3440" - , fgColor = "#d8dee9" - , alpha = 255 - , position = Top - , textOffset = -1 - , iconOffset = -1 - , lowerOnStart = True - , pickBroadest = False - , persistent = True - , hideOnStart = False - , iconRoot = "." - , allDesktops = False - , overrideRedirect = True - , commands = [ Run Network "enp2s0" ["-t", "\xf0aa kb \xf0ab kb"] 20 - , Run Cpu ["-t", "\xf108 cpu: (%)","-H","50","--high","red"] 10 - , Run Memory ["-t", "\xf233 mem: M (%)"] 10 --- , Run Swap [] 10 - , Run Com "echo" ["\xf17c"] "penguin" 3600 --- , Run Com "ncmpcpp --current-song" "song" 1 - , Run Com ".local/bin/kernel" [] "kernel" 36000 - , Run Date "\xf133 %d %b %Y - (%H:%M) " "date" 50 - , Run DiskU [("/", "\xf0c7 hdd: free")] [] 60 - , Run Uptime ["-t", "uptime: d h"] 360 - , Run Com "/home/lucas/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20 - , Run UnsafeXMonadLog - ] - , sepChar = "%" - , alignSep = "}{" - , template = "| %UnsafeXMonadLog%}\ - \{ %cpu% | %memory% | %enp2s0% | %date% | %trayerpad% ) " - } - --- , template = "| %XMonadLog%}\ --- \{ %penguin% %kernel%| %cpu% | %song% | %memory% | %enp2s0% | %date% | %trayerpad% ) " --- } diff --git a/configs/xmobar/xmobarrc1 b/configs/xmobar/xmobarrc1 deleted file mode 100644 index aac9461..0000000 --- a/configs/xmobar/xmobarrc1 +++ /dev/null @@ -1,38 +0,0 @@ -Config { font = "xft:mononoki Nerd Font Mono:pixelsize=16:antialiasing=true:hinting=true" - , additionalFonts = [ "xft:InconsolataGo Nerd Font:pixelsize=16:antialias=true:hinting=true" - , "xft:Font Awesome 6 Brands:pixelsize=18" - , "xft:Font Awesome 6 Free:pixelsize=18" - ] - , borderColor = "black" - , border = TopB - , bgColor = "#2e3440" - , fgColor = "#d8dee9" - , alpha = 255 - , position = Top - , textOffset = -1 - , iconOffset = -1 - , lowerOnStart = True - , pickBroadest = False - , persistent = True - , hideOnStart = False - , iconRoot = "." - , allDesktops = False - , overrideRedirect = True - , commands = [ Run Network "enp2s0" ["-t", "\xf0aa kb \xf0ab kb"] 20 - , Run Cpu ["-t", "\xf108 cpu: (%)","-H","50","--high","red"] 10 - , Run Memory ["-t", "\xf233 mem: M (%)"] 10 --- , Run Swap [] 10 - , Run Com "echo" ["\xf17c"] "penguin" 3600 --- , Run Com "ncmpcpp --current-song" "song" 1 - , Run Com ".local/bin/kernel" [] "kernel" 36000 - , Run Date "\xf133 %d %b %Y - (%H:%M) " "date" 50 - , Run DiskU [("/", "\xf0c7 hdd: free")] [] 60 - , Run Uptime ["-t", "uptime: d h"] 360 - , Run Com "/home/lucas/.config/xmobar/trayer-padding-icon.sh" [] "trayerpad" 20 - , Run UnsafeXMonadLog - ] - , sepChar = "%" - , alignSep = "}{" - , template = "| %UnsafeXMonadLog%}\ - \{ %cpu% | %memory% | %enp2s0% | %date% | %trayerpad% ) " - } diff --git a/configs/xmonad/build b/configs/xmonad/build new file mode 100755 index 0000000..a2816ac --- /dev/null +++ b/configs/xmonad/build @@ -0,0 +1,7 @@ +#!/bin/sh + +# Recompile +cd "$XMONAD_CONFIG_DIR" && stack install || exit + +# Create a hard link at the requested destination, replacing any existing one. +ln -f -T "$(stack exec -- which xmonad)" "$1" diff --git a/configs/xmonad/icons/full.xpm b/configs/xmonad/icons/full.xpm new file mode 100644 index 0000000..3ef5307 --- /dev/null +++ b/configs/xmonad/icons/full.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * Monocle_xpm[] = { +"20 20 2 1", +" c #31353F", +". c #ABB2BF", +" ", +" ", +" ", +" ", +" ...... ...... ", +" ...... ...... ", +" .. .. ", +" .. .. ", +" .. .. ", +" ", +" ", +" .. .. ", +" .. .. ", +" .. .. ", +" ...... ...... ", +" ...... ...... ", +" ", +" ", +" ", +" "}; \ No newline at end of file diff --git a/configs/xmonad/icons/mirrortiled.xpm b/configs/xmonad/icons/mirrortiled.xpm new file mode 100644 index 0000000..ad74fd3 --- /dev/null +++ b/configs/xmonad/icons/mirrortiled.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * MirrorTall_xpm[] = { +"20 20 2 1", +" c #31353F", +". c #ABB2BF", +" ", +" ", +" ", +" ", +" .............. ", +" .............. ", +" .............. ", +" .............. ", +" .............. ", +" ", +" ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ", +" ", +" ", +" "}; \ No newline at end of file diff --git a/configs/xmonad/icons/tiled.xpm b/configs/xmonad/icons/tiled.xpm new file mode 100644 index 0000000..fbcf3c2 --- /dev/null +++ b/configs/xmonad/icons/tiled.xpm @@ -0,0 +1,25 @@ +/* XPM */ +static char * Tall_xpm[] = { +"20 20 2 1", +" c #31353F", +". c #ABB2BF", +" ", +" ", +" ", +" ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ", +" ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ...... ...... ", +" ", +" ", +" ", +" "}; \ No newline at end of file diff --git a/configs/xmonad/log.txt b/configs/xmonad/log.txt new file mode 100644 index 0000000..89446fe --- /dev/null +++ b/configs/xmonad/log.txt @@ -0,0 +1,24 @@ +Discord 0.0.21 +Starting app. +Starting updater. +[Modules] Modules initializing +[Modules] Distribution: remote +[Modules] Host updates: enabled +[Modules] Module updates: enabled +[Modules] Module install path: /home/klein/.config/discord/0.0.21/modules +[Modules] Module installed file path: /home/klein/.config/discord/0.0.21/modules/installed.json +[Modules] Module download path: /home/klein/.config/discord/0.0.21/modules/pending +[Modules] No updates to install +[Modules] Checking for host updates. +[Modules] Host is up to date. +[Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json +[Modules] No module updates available. +Optional module ./ElectronTestRpc was not included. +WEIGHT /home/klein/.config/discord/0.0.21/modules/discord_krisp/NC_small_8k.thw +WEIGHT /home/klein/.config/discord/0.0.21/modules/discord_krisp/NC_small_16k.thw +WEIGHT /home/klein/.config/discord/0.0.21/modules/discord_krisp/c6.s.f.27f1a3.thw +WEIGHT /home/klein/.config/discord/0.0.21/modules/discord_krisp/VAD_weight.thw +[Modules] Checking for host updates. +[Modules] Host is up to date. +[Modules] Checking for module updates at https://discord.com/api/modules/stable/versions.json +[Modules] No module updates available. diff --git a/configs/xmonad/package.yaml b/configs/xmonad/package.yaml new file mode 100644 index 0000000..2eb2341 --- /dev/null +++ b/configs/xmonad/package.yaml @@ -0,0 +1,27 @@ +name: xmonad-scherso +version: 0.1.0 +synopsis: My XMonad configuration. +license: DBAD +author: Scherso +homepage: https://github.com/Scherso/Dotfiles + +ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -O2 -j -dynamic + +dependencies: + - base + - xmonad-contrib >= 0.16 + +source-dirs: src + +executables: + xmonad: + main: xmonad.hs + dependencies: + - xmonad + - containers + - X11 >= 1.10 + xmobar: + main: xmobar.hs + dependencies: + - xmobar + ghc-options: -rtsopts -threaded -with-rtsopts=-N diff --git a/configs/xmonad/scripts/gputemp.sh b/configs/xmonad/scripts/gputemp.sh new file mode 100755 index 0000000..7ee6907 --- /dev/null +++ b/configs/xmonad/scripts/gputemp.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +TEMP=${TEMP:-$(sensors | grep 'edge: ' | awk '{print $2}' | sed 's/+//' | sed 's/.0°C//')} +TEMP=${TEMP%???} + +echo "$TEMP°C" \ No newline at end of file diff --git a/configs/xmonad/scripts/volume.sh b/configs/xmonad/scripts/volume.sh new file mode 100755 index 0000000..ef591e1 --- /dev/null +++ b/configs/xmonad/scripts/volume.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +MUTE=${MUTE:-$(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}')} +VOLUME=${VOLUME:-$(pactl get-sink-volume @DEFAULT_SINK@ | awk '{print $5}' | sed "s/%//")} + +if [[ "${MUTE}" = "yes" ]] ; then + echo "" +elif [[ "${MUTE}" = "no" ]] && [[ "${VOLUME}" -eq 0 ]] ; then + echo " ${VOLUME}%" +elif [[ "${MUTE}" = "no" ]] && [[ "${VOLUME}" -gt 0 ]] ; then + echo " ${VOLUME}%" +fi \ No newline at end of file diff --git a/configs/xmonad/src/123.hs b/configs/xmonad/src/123.hs new file mode 100644 index 0000000..1750639 --- /dev/null +++ b/configs/xmonad/src/123.hs @@ -0,0 +1,273 @@ +-- ## Modules ## ------------------------------------------------------------------- +{-# LANGUAGE MultiWayIf #-} +import XMonad +import XMonad.Util.SpawnOnce +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.ManageHook +import XMonad.Util.Ungrab +import XMonad.Util.Hacks as Hacks +import XMonad.Hooks.WindowSwallowing +import XMonad.Layout.Fullscreen +import XMonad.Layout.NoBorders +import XMonad.Layout.Spacing +import XMonad.Layout.Gaps +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import System.Exit +import Control.Monad +import Data.Monoid +import Data.Maybe +import XMonad.Util.Cursor +import Graphics.X11.ExtraTypes.XF86 +import XMonad.Util.ClickableWorkspaces + +import qualified XMonad.StackSet as W +import qualified Data.Map as M + +-- focus follows the mouse pointer +myFocusFollowsMouse :: Bool +myFocusFollowsMouse = True + +-- clicking on a window to focus +myClickJustFocuses :: Bool +myClickJustFocuses = True + +-- Width of the window border in pixels +myBorderWidth = 2 + +-- Border colors for focused & unfocused windows +myFocusedBorderColor = "#de935f" +myNormalBorderColor = "#5f819d" + +-- modMask : modkey you want to use +-- mod1Mask : left alt Key +-- mod4Mask : Windows or Super Key +myModMask = mod4Mask +myTerminal = "kitty" +-- Workspaces (ewmh) +myWorkspaces = ["dev", "web", "irc", "gfx", "vm", "music", "email", "x"] + +myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ + -- Close focused window + [ ((modm .|. shiftMask, xK_c), kill) + , ((modm, xK_Escape), spawn "mpc toggle") + , ((modm .|. shiftMask, xK_m), spawn "kitty -e ncmpcpp") + , ((modm, xK_e), spawn "pcmanfm") + , ((modm, xK_v), spawn "vscodium") + , ((modm, xK_Return), spawn myTerminal) + , ((modm .|. shiftMask, xK_Escape), spawn "/home/klein/.config/rofi/powermenu/type-6/powermenu.sh") + , ((modm .|. shiftMask, xK_Return), spawn "/home/klein/.config/rofi/launchers/type-7/launcher.sh") + , ((0 .|. shiftMask, xK_Print), unGrab >> spawn "/home/klein/.local/bin/print-select") + , ((0, xK_Print), spawn "/home/klein/.local/bin/print-fullscreen") + -- Change gaps on the fly + , ((modm .|. controlMask, xK_o), sendMessage $ IncGap 10 L) -- increment the left-hand gap + , ((modm .|. shiftMask, xK_o), sendMessage $ DecGap 10 L) -- decrement the left-hand gap + , ((modm .|. controlMask, xK_y), sendMessage $ IncGap 10 U) -- increment the top gap + , ((modm .|. shiftMask, xK_y), sendMessage $ DecGap 10 U) -- decrement the top gap + , ((modm .|. controlMask, xK_u), sendMessage $ IncGap 10 D) -- increment the bottom gap + , ((modm .|. shiftMask, xK_u), sendMessage $ DecGap 10 D) -- decrement the bottom gap + , ((modm .|. controlMask, xK_i), sendMessage $ IncGap 10 R) -- increment the right-hand gap + , ((modm .|. shiftMask, xK_i), sendMessage $ DecGap 10 R) -- decrement the right-hand gap + -- Resize viewed windows to the correct size + , ((modm, xK_r), refresh) + -- Move focus to the master window + , ((modm, xK_m), windows W.focusMaster) + -- Push window back into tiling + , ((modm, xK_t), withFocused $ windows . W.sink) + -- Rotate through the available layout algorithms + , ((modm, xK_space), sendMessage NextLayout) + -- Reset the layouts on the current workspace to default + , ((modm .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf) + -- Move focus to the next window + , ((modm, xK_Tab), windows W.focusDown) + -- Move focus to the next window + , ((modm, xK_j), windows W.focusDown) + , ((modm, xK_Left), windows W.focusDown) + -- Move focus to the previous window + , ((modm, xK_k), windows W.focusUp) + , ((modm, xK_Right), windows W.focusUp) + -- Swap the focused window with the next window + , ((modm .|. shiftMask, xK_j), windows W.swapDown) + , ((modm .|. shiftMask, xK_h), windows W.swapDown) + -- Swap the focused window with the previous window + , ((modm .|. shiftMask, xK_k), windows W.swapUp) + , ((modm .|. shiftMask, xK_l), windows W.swapUp) + -- Shrink the master area + , ((modm, xK_h), sendMessage Shrink) + , ((modm .|. controlMask, xK_Left), sendMessage Shrink) + -- Expand the master area + , ((modm, xK_l), sendMessage Expand) + , ((modm .|. controlMask, xK_Right), sendMessage Expand) + -- Increment the number of windows in the master area + , ((modm, xK_comma), sendMessage (IncMasterN 1)) + -- Deincrement the number of windows in the master area + , ((modm, xK_period), sendMessage (IncMasterN (-1))) + -- volume + , ((0,xF86XK_AudioMute), spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle") + , ((0,xF86XK_AudioLowerVolume), spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%") + , ((0,xF86XK_AudioRaiseVolume), spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%") + -- Restart xmonad + , ((controlMask .|. shiftMask, xK_r), spawn "xmonad --recompile; xmonad --restart") + -- Quit xmonad + , ((controlMask .|. shiftMask, xK_q), spawn "pkill -KILL -u $USER") + -- programs + , ((modm, xK_d), spawn "cd ~/.config && ./webcordx") + , ((modm, xK_s), spawn "spotify") + , ((modm , xK_y ), sendMessage ToggleStruts) + , ((modm .|. shiftMask, xK_b), spawn "firefox") + -- , ((modm, xK_F1), spawn "dmenu_run") + -- spotify controls, handy af + , ((modm, xK_F9), spawn "playerctl play-pause") + , ((modm, xK_F11), spawn "playerctl previous") + , ((modm, xK_F12), spawn "playerctl next") + , ((modm, xK_p), spawn "flameshot") + , ((modm, xK_F4), withFocused toggleFull) + ] + ++ + -- mod-[1..9], Switch to workspace N + -- mod-shift-[1..9], Move client to workspace N + [ ((m .|. modm, k), windows $ f i) + | (i, k) <- zip (XMonad.workspaces conf) [xK_1,xK_2,xK_3,xK_4,xK_5,xK_6,xK_7,xK_8,xK_9,xK_0] + , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] + ] + ++ + -- mod-{q,a,z}, Switch to physical/Xinerama screens 1, 2, or 3 + -- mod-shift-{q,a,z}, Move client to screen 1, 2, or 3 + [ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) + | (key, sc) <- zip [xK_comma, xK_period, xK_z] [0..] + , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] + ] + +-- ## Mouse Bindings ## ------------------------------------------------------------------ +myMouseBindings :: XConfig l -> M.Map (KeyMask, Button) (Window -> X ()) +myMouseBindings XConfig {XMonad.modMask = modm} = M.fromList + -- Set the window to floating mode and move by dragging. + [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster) + -- Raise the window to the top of the stack. + , ((modm, button2), \w -> focus w >> windows W.shiftMaster) + -- Set the window to floating mode and resize by dragging. + , ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster) + ] + +myLayout = + avoidStruts + $ lessBorders OnlyScreenFloat + $ gaps [(L,5), (R,5), (U,5), (D,5)] + $ spacingRaw False (Border 10 0 10 0) True (Border 0 10 0 10) True + $ tiled ||| Mirror tiled ||| Full + where + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane. + ratio = 1 / 2 -- Default proportion of screen occupied by master panes. + delta = 3 / 100 -- Percent of screen increment by when resizing panes. + +myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) +myManageHook = manageRules + where + viewShift = doF . liftM2 (.) W.greedyView W.shift + manageRules = composeAll . concat $ + [ [ isDialog --> doCenterFloat ] + , [ className =? c --> doCenterFloat | c <- myCFloats ] + , [ title =? t --> doCenterFloat | t <- myTFloats ] + , [ resource =? r --> doFloat | r <- myRFloats ] + , [ resource =? i --> doIgnore | i <- myIgnores ] + , [ className =? "firefox" --> viewShift "web" ] + , [ className =? "firefox-esr" --> doShift "web" ] + , [ className =? "discord" --> doShift "irc" ] + , [ className =? "Spotify" --> doShift "music" ] + , [ className =? "thunderbird" --> doShift "email" ] + , [ className =? "Steam" --> doShift "x" ] + , [ className =? "leagueclientux.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "Lutris" --> doShift "gfx" <> doFloat] + , [ className =? "league of legends.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "riotclientux.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "dauntless-win64-shipping.exe" --> doShift "gfx" ] + , [ className =? "leagueclient.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "battle.net.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "Pcmanfm" --> doFloat ] + , [ className =? "Pavucontrol" --> doFloat ] + , [ className =? "Nitrogen" --> doFloat ] + + ] + where + myCFloats = ["Viewnior", "Alafloat"] + myTFloats = ["Downloads", "Save As...", "Getting Started"] + myRFloats = [] + myIgnores = ["desktop_window"] + +-- , [className =? "Alacritty" --> viewShift "1"] +-- , [className =? "Thunar" --> viewShift "3"] +-- , [className =? "Geany" --> viewShift "4"] +-- , [className =? "Inkscape" --> viewShift "5"] +-- , [className =? "vlc" --> viewShift "6"] +-- , [className =? "Xfce4-settings-manager" --> viewShift "7"] + +toggleFull :: Window -> X () +toggleFull w = windows $ \s -> if + | M.lookup w (W.floating s) == Just fullscreen -> W.sink w s + | otherwise -> W.float w fullscreen s + where + fullscreen = W.RationalRect 0 0 1 1 + +myEventHook :: Event -> X All +myEventHook = mempty $ swallowEventHook (className =? "Alacritty" <||> className =? "kitty") (return True) -- ewmh + +myStartupHook :: X () +myStartupHook = do + setDefaultCursor xC_left_ptr + spawnOnce "nitrogen --restore &" + spawnOnce "/home/klein/scripts/xmonad.sh &" + -- spawnOnce "/home/klein/.local/bin/xmobar ~/.config/xmonad/src/xmobar.hs &" + -- spawnOnce "/home/klein/.local/bin/xmobar-2nd &" + -- spawnOnce "picom --daemon --experimental-backends --backend glx --blur-method dual_kawase --transparent-clipping" + -- spawnOnce "killall trayer; trayer --edge top --align right --widthtype request --padding 2 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x161814 --height 25 --distance 3 &" + -- spawnOnce "dunst" + +myLogHook = return () + +myXmobarPP :: PP +myXmobarPP = + def + { ppCurrent = xmobarColor "#de935f" "" . wrap "[" "]", + ppHidden = xmobarColor "#d2ba8b" "", + ppHiddenNoWindows = xmobarColor "#a3846e" "", + ppSep = " > ", + ppOrder = \(ws : l : t : ex) -> [ws] ++ map (xmobarColor "#E06C75" "") ex ++ [xmobarColor "#ABB2BF" "" t], + ppExtras = [] + } + +myConfig = + def + { focusFollowsMouse = myFocusFollowsMouse + , clickJustFocuses = myClickJustFocuses + , borderWidth = myBorderWidth + , modMask = myModMask + , workspaces = myWorkspaces + , normalBorderColor = myNormalBorderColor + , focusedBorderColor = myFocusedBorderColor + , terminal = myTerminal + -- Keybindings + , keys = myKeys + , mouseBindings = myMouseBindings + -- Hooks and layouts + , manageHook = myManageHook + , layoutHook = myLayout + , handleEventHook = myEventHook + <> Hacks.trayerAboveXmobarEventHook + , logHook = myLogHook + , startupHook = myStartupHook + } + +main :: IO () +main = + do + xmonad + . ewmhFullscreen + . docks + . ewmh + . fullscreenSupport + . withEasySB (statusBarProp "xmobar" (pure myXmobarPP)) defToggleStrutsKey + . withEasySB (statusBarProp "xmobar-2nd" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig diff --git a/configs/xmonad/src/jabuxa.hs b/configs/xmonad/src/jabuxa.hs new file mode 100644 index 0000000..9034423 --- /dev/null +++ b/configs/xmonad/src/jabuxa.hs @@ -0,0 +1,36 @@ +-- vim: ft=haskell +-- +-- xmobar config - https://github.com/jaor/xmobar +-- depends on: +-- - xmonad +-- +Config { + -- BEHAVIOUR + overrideRedirect = True + , lowerOnStart = True + , persistent = True + -- APPEARANCE + , font = "xft:FiraCode Nerd Font:style=Regular:size=12" + , additionalFonts = ["xft:Open Sans:style=Regular:size=12"] + --bgColor = "#0d0e0c", + , bgColor = "#212121" + , fgColor = "#c8b6b8" + , position = Static { xpos = 0, ypos = 0, width = 1920, height = 30 } + -- MODULES + , commands = + [ Run Date "%a %b %d, %H:%M" "date" 10 + , Run Cpu [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Memory [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Com "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" [] "volume" 1 + -- , Run ComX "tail" ["-n1", "/tmp/.xmonad-workspace-log"] " Xmonad" "ws" 1 + , Run ComX "tail" ["-n1", "/tmp/.xmonad-title-log"] "" "title" 1 + -- , Run ComX "xkb-switch" [] "en" "lang" 1 + , Run Com "/home/klein/.config/xmonad/xmobar/trayer-padding.sh" [] "trayerpad" 10 + , Run UnsafeStdinReader + , Run UnsafeXMonadLog + ] + -- DISPLAY + , alignSep = "}{" + , sepChar = "%" + , template = "  %UnsafeXMonadLog% }{ CPU: %cpu% Mem: %memory% %date% %trayerpad%" + } diff --git a/configs/xmonad/src/jabuxa1.hs b/configs/xmonad/src/jabuxa1.hs new file mode 100644 index 0000000..86f7d81 --- /dev/null +++ b/configs/xmonad/src/jabuxa1.hs @@ -0,0 +1,36 @@ +-- vim: ft=haskell +-- +-- xmobar config - https://github.com/jaor/xmobar +-- depends on: +-- - xmonad +-- +Config { + -- BEHAVIOUR + overrideRedirect = True + , lowerOnStart = True + , persistent = True + -- APPEARANCE + , font = "xft:FiraCode Nerd Font:style=Regular:size=12" + , additionalFonts = ["xft:Open Sans:style=Regular:size=12"] + --bgColor = "#0d0e0c", + , bgColor = "#181814" + , fgColor = "#c8b6b8" + , position = Static { xpos = 1920, ypos = 148, width = 1920, height = 35 } + -- MODULES + , commands = + [ Run Date "%a %b %d, %H:%M" "date" 10 + , Run Cpu [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Memory [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Com "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" [] "volume" 1 + -- , Run ComX "tail" ["-n1", "/tmp/.xmonad-workspace-log"] " Xmonad" "ws" 1 + , Run ComX "tail" ["-n1", "/tmp/.xmonad-title-log"] "" "title" 1 + -- , Run ComX "xkb-switch" [] "en" "lang" 1 + -- , Run Com "/home/klein/.config/xmonad/xmobar/trayer-padding.sh" [] "trayerpad" 10 + , Run UnsafeStdinReader + , Run UnsafeXMonadLog + ] + -- DISPLAY + , alignSep = "}{" + , sepChar = "%" + , template = "  %UnsafeXMonadLog% %title%}{ CPU: %cpu% Mem: %memory% %date%" + } diff --git a/configs/xmonad/src/trayer-padding.sh b/configs/xmonad/src/trayer-padding.sh new file mode 100755 index 0000000..e3112ac --- /dev/null +++ b/configs/xmonad/src/trayer-padding.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Detects the width of running window with name given as first +# argument (xprop name '$1') and creates an XPM icon of that width, +# 1px height, and transparent. Outputs an -tag for use in +# xmobar to display the generated XPM icon. +# +# Run script from xmobar and trayer: +# `Run Com "/where/ever/padding-icon.sh" ["panel"] "trayerpad" 10` +# and use `%trayerpad%` in your template. +# or, if you're using for instance stalonetray: +# `Run Com "/where/ever/padding-icon.sh" ["stalonetray"] "tray" 10` + +# Very heavily based on Jonas Camillus Jeppensen code +# https://github.com/jaor/xmobar/issues/239#issuecomment-233206552 + +# Function to create a transparent Wx1 px XPM icon +create_xpm_icon () { +timestamp=$(date) +pixels=$(for i in `seq $1`; do echo -n "."; done) + +cat << EOF > "$2" +/* XPM * +static char * trayer_pad_xpm[] = { +/* This XPM icon is used for padding in xmobar to */ +/* leave room for trayer-srg. It is dynamically */ +/* updated by by trayer-pad-icon.sh which is run */ +/* by xmobar. */ +/* Created: ${timestamp} */ +/* */ +"$1 1 1 1", +/* Colors (none: transparent) */ +". c none", +/* Pixels */ +"$pixels" +}; +EOF +} + +# Width of the trayer window +width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5) + +# Icon file name +iconfile="/tmp/$pname-padding-${width:-0}px.xpm" + +# If the desired icon does not exist create it +if [ ! -f $iconfile ] +then + create_xpm_icon $width $iconfile +fi + +# Output the icon tag for xmobar +echo "" diff --git a/configs/xmonad/src/xmobar.hs b/configs/xmonad/src/xmobar.hs new file mode 100644 index 0000000..d93fa25 --- /dev/null +++ b/configs/xmonad/src/xmobar.hs @@ -0,0 +1,96 @@ +import System.Environment (getEnv) +import System.IO.Unsafe (unsafeDupablePerformIO) + +import Xmobar + +main :: IO () +main = xmobar =<< myConfig + +myHomeDir :: String +myHomeDir = unsafeDupablePerformIO (getEnv "HOME") + +myConfig :: IO Config +myConfig = + do + pure baseConfig + { template = concat $ + [ " \xe0b6\ + \\xf30d \ + \\xe0b4 " + ] + <> + [ "%UnsafeXMonadLog%}{" ] + -- <> + -- [ "\xe0b6\ + -- \%wlp5s0%\ + -- \\xe0b4 " + -- ] + <> + [ "\xe0b6\ + \CPU: %cpu%\ + \\xe0b4 " + ] + <> + [ "\xe0b6\ + \Mem: %memory%\ + \\xe0b4 " + ] + <> + [ "\xe0b6\ + \%vol%\ + \\xe0b4 " + ] + <> + [ "\xe0b6\ + \%date%\ + \\xe0b4 " + ] + <> + [ "%trayer%"] + , commands = myCommands + } + +myCommands :: [Runnable] +myCommands = + [ Run UnsafeXMonadLog + , Run $ Com (myHomeDir <> "/.config/xmonad/scripts/volume.sh" ) ["vol"] "vol" 1 + , Run $ Date "\xf017 %-l:%M %p" "date" 10 + , Run $ Cpu [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#56B6C2", "-n", "#4797a1", "-l", "#3a7b83" ] 10 + , Run $ Memory [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#c678dd", "-n", "#9f60b1", "-l", "#855094" ] 10 + -- , Run $ Com (myHomeDir <> "/.config/xmonad/scripts/gputemp.sh") ["gpu"] "gpu" 5 + , Run $ Com (myHomeDir <> "/.config/xmonad/src/trayer-padding.sh") ["trayer"] "trayer" 10 + ] + +baseConfig :: Config +baseConfig = + defaultConfig + { font = "xft:InconsolataGo Nerd Font:pixelsize=12:antialias=true:hinting=true" + , additionalFonts = [ "xft:InconsolataGo Nerd Font:pixelsize=10:antialias=true:hinting=true" + , "xft:InconsolataGo Nerd Font:size=13:antialias=true:hinting=true" + , "xft:InconsolataGo Nerd Font:size=11:antialias=true:hinting=true" + , "xft:InconsolataGo Nerd Font:size=11:antialias=true:hinting=true" + , "xft:InconsolataGo Nerd Font:pixelsize=13:antialias=true:hinting=true" + ] + , textOffsets = [20, 22, 21, 21, 20] + , bgColor = "#212121" + , fgColor = "#c8b6b8" + , borderColor = "#de935f" + , border = FullB + , borderWidth = 1 + {- + , position = Static { xpos = 13, ypos = 1034, width = 1893, height = 32 } Bottom Padded + , position = Static { xpos = 0, ypos = 1048, width = 1920, height = 32 } Bottom Flat + , position = Static { xpos = 0, ypos = 0, width = 1920, height = 32 } Top Flat + -} + , position = Static { xpos = 0, ypos = 0, width = 1920, height = 30 } + , alpha = 255 + , overrideRedirect = False + , lowerOnStart = True + , hideOnStart = False + , allDesktops = True + , persistent = True + , iconRoot = myHomeDir ++ "/.config/xmonad/icons" + , iconOffset = -1 + , sepChar = "%" + , alignSep = "}{" + } diff --git a/configs/xmonad/src/xmonad.hs b/configs/xmonad/src/xmonad.hs new file mode 100644 index 0000000..8ef6743 --- /dev/null +++ b/configs/xmonad/src/xmonad.hs @@ -0,0 +1,374 @@ +{-# LANGUAGE + MultiWayIf -- Required for `toggleFull` in `myAdditionalKeys` + , LambdaCase -- Required for `(\case)` statement in `myXmobarPP` + , FlexibleContexts +#-} +{-# OPTIONS_GHC + -Wno-missing-signatures + -Wno-orphans +#-} + +-- Data Imports +import qualified Data.Map as M +import Data.Functor +import Data.Monoid + +-- Used in io exitSuccess +import System.Exit +import System.Environment (getEnv) +import System.IO.Unsafe (unsafeDupablePerformIO) + +-- XMonad imports +import XMonad +import XMonad.Hooks.WindowSwallowing +import XMonad.Actions.NoBorders (toggleBorder) +import XMonad.Util.Ungrab +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers +import XMonad.Hooks.SetWMName +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import XMonad.Layout.Fullscreen +import XMonad.Layout.NoBorders +import XMonad.Layout.Spacing +import qualified XMonad.StackSet as W +import XMonad.Util.ClickableWorkspaces +import XMonad.Util.Cursor +import XMonad.Util.EZConfig +import qualified XMonad.Util.Hacks as Hacks +import XMonad.Util.SpawnOnce + +main :: IO () +main = do + xmonad + . docks + . ewmhFullscreen + . fullscreenSupport + . ewmh + . Hacks.javaHack + . withEasySB xmobar toggleSB + . withSB xmobar2 + $ myConfig + where + toggleSB XConfig {modMask = modm} = (modm, xK_m) + + -- Windows key/Super key +myModMask :: KeyMask +myModMask = mod4Mask + + -- Default Terminal +myTerminal :: String +myTerminal = "kitty" + + -- Default Launcher +myLauncher :: String +myLauncher = "/home/klein/.config/rofi/launchers/type-7/launcher.sh" + + -- Default Launcher +myFileManager :: String +myFileManager = "pcmanfm" + + -- Default Browser +myBrowser :: String +myBrowser = "firefox" + + -- Workspaces +myWorkspaces :: [String] +-- myWorkspaces = map show [1 .. 9] +myWorkspaces = ["dev", "web", "irc", "gfx", "vm", "music", "email", "x"] + + -- Border Width +myBorderWidth :: Dimension +myBorderWidth = 2 + + -- Formal Unfocused Color +myNormColor :: String +myNormColor = "#5f819d" + + -- Focused Color +myFocusColor :: String +myFocusColor = "#de935f" + + -- Home Directory +myHomeDir :: String +myHomeDir = unsafeDupablePerformIO (getEnv "HOME") + +-- focus follows the mouse pointer +myFocusFollowsMouse :: Bool +myFocusFollowsMouse = True + +myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ + [ ((m .|. modm, k), windows $ f i) + | (i, k) <- zip (XMonad.workspaces conf) [xK_1,xK_2,xK_3,xK_4,xK_5,xK_6,xK_7,xK_8,xK_9,xK_0] + , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] + ] + ++ + [ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) + | (key, sc) <- zip [xK_comma, xK_period, xK_z] [0..] + , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] + ] + + +myAdditionalKeys :: [(String, X ())] +myAdditionalKeys = + base + ++ window + ++ applications + ++ multimedia + where + -- Force killing a frozen window. + forceKillWindow :: Window -> X () + forceKillWindow w = withDisplay $ \d -> + io $ void $ killClient d w + -- Making a window have a full float over a workspace. + toggleFull :: Window -> X () + toggleFull w = windows $ \s -> if + | M.lookup w (W.floating s) == Just fullscreen -> W.sink w s + | otherwise -> W.float w fullscreen s + where + fullscreen = W.RationalRect 0 0 1 1 + -- Screenshots + screenShotSelection = "/home/klein/.local/bin/print-select" :: String + screenShotFullscreen = "/home/klein/.local/bin/print-fullscreen" :: String + -- XMonad base keybinds. + base = + [ ("M-g", withFocused toggleBorder) + , ("M-S-c", kill) + , ("M-S-x", withFocused forceKillWindow) + , ("M-", sendMessage NextLayout) + , ("M-n", refresh) + , ("M-S-q", io exitSuccess) + , ("C-S-r", spawn "xmonad --recompile; killall xmobar; xmonad --restart") + , ("C-S-q", spawn "pkill -KILL -u $USER") + ] + -- Window management keybinds. + window = + [ ("M-", windows W.focusDown) + , ("M-j", windows W.focusDown) + , ("M-k", windows W.focusUp) + , ("M-S-m", windows W.focusMaster) + , ("M-m", sendMessage ToggleStruts) + , ("M-p", windows W.swapMaster) + , ("M-S-j", windows W.swapDown) + , ("M-S-h", windows W.swapDown) + , ("M-S-k", windows W.swapUp) + , ("M-S-l", windows W.swapUp) + , ("M-h", sendMessage Shrink) + , ("M-l", sendMessage Expand) + , ("M-t", withFocused $ windows . W.sink) + , ("M-f", withFocused toggleFull) + ] + -- Spawning applications. + applications = + [ ("M-", spawn myTerminal) + , ("M-S-", spawn "/home/klein/.config/rofi/powermenu/type-6/powermenu.sh") + , ("M-b", spawn myBrowser) + , ("M-S-d", spawn "/home/klein/Documents/discord-screenaudio/build/discord-screenaudio") + , ("S-", unGrab *> spawn screenShotSelection) + , ("", spawn screenShotFullscreen) + , ("M-S-", spawn myLauncher) + , ("M-e", spawn myFileManager) + ] + -- Multimedia keybinds. + multimedia = + [ ("", spawn "playerctl play-pause") + , ("", spawn "playerctl previous") + , ("", spawn "playerctl next") + , ("", spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle") + , ("", spawn "pactl set-sink-volume @DEFAULT_SINK@ -1.5%") + , ("", spawn "pactl set-sink-volume @DEFAULT_SINK@ +1.5%") + , ("", spawn "amixer sset Capture toggle") + , ("M-", spawn "mpc toggle") + , ("M-", spawn "mpc prev") + , ("M-", spawn "mpc next") + ] + +myMouseBindings :: XConfig l -> M.Map (KeyMask, Button) (Window -> X ()) +myMouseBindings XConfig {XMonad.modMask = modm} = M.fromList + -- Set the window to floating mode and move by dragging. + [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster) + -- Raise the window to the top of the stack. + , ((modm, button2), \w -> focus w >> windows W.shiftMaster) + -- Set the window to floating mode and resize by dragging. + , ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster) + ] + +myStartupHook :: X () +myStartupHook = do + traverse spawnOnce + [ "nitrogen --restore" + -- , "" + , "$HOME/scripts/xmonad.sh" + ] + setDefaultCursor xC_left_ptr + setWMName "xmonad" + +isInstance (ClassApp c _) = className =? c +isInstance (TitleApp t _) = title =? t +isInstance (NameApp n _) = appName =? n + +type AppName = String +type AppTitle = String +type AppClassName = String +type AppCommand = String + +data App + = ClassApp AppClassName AppCommand + | TitleApp AppTitle AppCommand + | NameApp AppName AppCommand + deriving Show + +gimp = ClassApp "Gimp" "gimp" +gimp2 = ClassApp "Gimp-2.99" "gimp-2.99" +multimc = ClassApp "MultiMC" "MultiMC" +about = TitleApp "About Mozilla Firefox" "About Mozilla Firefox" +message = ClassApp "Xmessage" "Xmessage" + +myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) +myManageHook = manageRules + where + -- Hides windows without ignoring it, see doHideIgnore in XMonad contrib. + doHide = ask >>= doF . W.delete :: ManageHook + -- WM_WINDOW_ROLE will be parsed with the role variable. + isRole = stringProperty "WM_WINDOW_ROLE" + -- To match multiple properties with one operator. + anyOf = foldl (<||>) (pure False) :: [Query Bool] -> Query Bool + -- To match multiple classNames with one operator. + match = anyOf . fmap isInstance :: [App] -> Query Bool + -- Checking for splash dialogs. + isSplash = isInProperty "_NET_WM_WINDOW_TYPE" "_NET_WM_WINDOW_TYPE_SPLASH" + -- Checking for pop-ups. + isPopup = isRole =? "pop-up" + -- Checking for file chooser dialog. + isFileChooserDialog = isRole =? "GtkFileChooserDialog" + -- Managing rules for applications. + manageRules = composeOne + [ transience + , isDialog -?> doCenterFloat + , isFullscreen -?> (doF W.focusDown <+> doFullFloat) + , match [ gimp + , gimp2 + , about + , message + ] -?> doFloat + , match [ + multimc + ] -?> doCenterFloat + , anyOf [ isFileChooserDialog + , isDialog + , isPopup + , isSplash + ] -?> doCenterFloat + ] <> composeAll + [ manageDocks + , className =? "firefox" <&&> title =? "File Upload" --> doFloat + , className =? "firefox" <&&> title =? "Library" --> doCenterFloat + , className =? "firefox" <&&> title ^? "Save" --> doFloat + , className =? "firefox" <&&> resource =? "Toolkit" --> doFloat + , className =? "firefox" <&&> title ^? "Sign in" --> doFloat + , className ^? "jetbrains-" <&&> title ^? "Welcome to " --> doCenterFloat + , className ^? "jetbrains-" <&&> title =? "splash" --> doFloat + , className ^? "Visual " <&&> isDialog --> doCenterFloat + , className =? "firefox-esr" --> doShift "web" + , className =? "discord" --> doShift "irc" + , className =? "discord-screenaudio" --> doShift "irc" + , className =? "Spotify" --> doShift "music" + , className =? "thunderbird" --> doShift "email" + , className =? "Steam" --> doShift "x" + , className =? "leagueclientux.exe" --> doShift "gfx" <> doFloat + , className =? "Lutris" --> doShift "gfx" <> doFloat + , className =? "league of legends.exe" --> doShift "gfx" <> doFloat + , className =? "riotclientux.exe" --> doShift "gfx" <> doFloat + , className =? "dauntless-win64-shipping.exe" --> doShift "gfx" + , className =? "leagueclient.exe" --> doShift "gfx" <> doFloat + , className =? "battle.net.exe" --> doShift "gfx" <> doFloat + , className =? "Pcmanfm" --> doFloat + , className =? "Pavucontrol" --> doFloat + , className =? "Nitrogen" --> doFloat + , resource =? "desktop_window" --> doIgnore + , resource =? "kdesktop" --> doIgnore + , isRole ^? "About" <||> isRole ^? "about" --> doFloat + , "_NET_WM_WINDOW_TYPE" `isInProperty` "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE" --> doIgnore <> doRaise + -- Steam Game Fixes + , className =? "steam_app_1551360" <&&> title /=? "Forza Horizon 5" --> doHide -- Prevents black screen when fullscreening. + -- , title =? "Wine System Tray" --> doHide -- Prevents Wine System Trays from taking input focus. + -- , title ^? "Steam - News" --> doHide -- I don't like the Steam news menu + ] + +{- May be useful one day +doClose = ask >>= liftX . killWindow >> mempty :: ManageHook +doForceKill = ask >>= liftX . forceKillWindow >> mempty :: ManageHook +-} + +myEventHook :: Event -> X All +myEventHook _ = swallowEventHook (className =? "kitty" <||> className =? "Alacritty") (return True) + +myLayoutHook = + avoidStruts + $ lessBorders OnlyScreenFloat + $ spacingRaw False(Border w w w w) True(Border w w w w) True + $ tiled ||| Mirror tiled ||| Full + where + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane. + ratio = 1 / 2 -- Default proportion of screen occupied by master panes. + delta = 3 / 100 -- Percent of screen increment by when resizing panes. + w = 5 -- Width of pixel size between windows while tiled. + +myXmobarPP :: X PP +myXmobarPP = + clickablePP $ def + { ppCurrent = xmobarColor "#de935f" "" . xmobarFont 5 . wrap "[" "]" + , ppVisibleNoWindows = Just (xmobarColor "#cc6666" "") + , ppHidden = xmobarColor "#d2ba8b" "" + , ppHiddenNoWindows = xmobarColor "#a3846e" "" + , ppUrgent = xmobarColor "#F7768E" "" . wrap "!" "!" + , ppTitle = xmobarColor "#98C379" "" . shorten 49 + , ppSep = wrapSep " " + , ppTitleSanitize = xmobarStrip + , ppWsSep = xmobarColor "" "#212121" " " + , ppLayout = xmobarColor "#212121" "" + . (\case + "Spacing Tall" -> "" + "Spacing Mirror Tall" -> "" + "Spacing Full" -> "" + ) + } + where + wrapSep :: String -> String + wrapSep = + wrap + (xmobarColor "#212121" "#212121:7" (xmobarFont 2 "\xe0b4")) + (xmobarColor "#212121" "#212121:7" (xmobarFont 2 "\xe0b6")) + +xmobar :: StatusBarConfig +xmobar = statusBarProp myXmobar myXmobarPP + +myXmobar :: String +myXmobar = ("xmobar " ++ myHomeDir ++ "/.config/xmonad/src/xmobar.hs") + +xmobar2 :: StatusBarConfig +xmobar2 = statusBarProp myXmobar2 myXmobarPP + +myXmobar2 :: String +myXmobar2 = ("xmobar-2nd") + +myConfig = + def + { modMask = myModMask + , focusFollowsMouse = myFocusFollowsMouse + , terminal = myTerminal + , mouseBindings = myMouseBindings + , borderWidth = myBorderWidth + , normalBorderColor = myNormColor + , focusedBorderColor = myFocusColor + , layoutHook = myLayoutHook + , startupHook = myStartupHook + , manageHook = myManageHook + , handleEventHook = myEventHook + <> Hacks.trayerAboveXmobarEventHook + , workspaces = myWorkspaces + , keys = myKeys + } `additionalKeysP` myAdditionalKeys + diff --git a/configs/xmonad/stack.yaml b/configs/xmonad/stack.yaml new file mode 100644 index 0000000..0d8ca1e --- /dev/null +++ b/configs/xmonad/stack.yaml @@ -0,0 +1,22 @@ +resolver: lts-19.23 + +packages: + - . + +extra-deps: + - github: xmonad/x11 + commit: da9295f8b9d7768a836b5b9dca1b554f8ad1a047 + - github: xmonad/xmonad + commit: 488b52ffaa03456c295575c7a6613d2fe5281903 + - github: xmonad/xmonad-contrib + commit: afd6824ce00063bb8e9b7a1c5daf0737c2f61616 + - xmobar-0.44.2 + +flags: + xmobar: + with_xpm: true + with_threaded: true + with_xft: true + with_rtsopts: true + +arch: x86_64 diff --git a/configs/xmonad/stack.yaml.lock b/configs/xmonad/stack.yaml.lock new file mode 100644 index 0000000..437cc1f --- /dev/null +++ b/configs/xmonad/stack.yaml.lock @@ -0,0 +1,52 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: +- completed: + name: X11 + pantry-tree: + sha256: 498db3650a791ddc061ad184f3fde3f48c6825053ddfab6b137b5f50b7a8afff + size: 3504 + sha256: f76c54965c6ace0a14a898972b5c0ff7ff2dc14cbea1b33aa00b86330509d04f + size: 162967 + url: https://github.com/xmonad/x11/archive/da9295f8b9d7768a836b5b9dca1b554f8ad1a047.tar.gz + version: 1.10.3 + original: + url: https://github.com/xmonad/x11/archive/da9295f8b9d7768a836b5b9dca1b554f8ad1a047.tar.gz +- completed: + name: xmonad + pantry-tree: + sha256: 33d22819ed69d12f0833ce062b431e4330200ae77eb2da2b84172d850e656f25 + size: 3702 + sha256: 21b0722219d9a870e3cca3c44768088077cbd2c9dcb02c9a101d7f2e9efb0525 + size: 106520 + url: https://github.com/xmonad/xmonad/archive/488b52ffaa03456c295575c7a6613d2fe5281903.tar.gz + version: 0.17.1 + original: + url: https://github.com/xmonad/xmonad/archive/488b52ffaa03456c295575c7a6613d2fe5281903.tar.gz +- completed: + name: xmonad-contrib + pantry-tree: + sha256: e965913f4482e3506f6dbd902a3e02ad4629421cad2c971e4f58fb5db0cd079a + size: 24086 + sha256: 753fc8d0331ffb9820aa068e99149f0d20425b031483bae1de2086c9a44b6b1f + size: 660327 + url: https://github.com/xmonad/xmonad-contrib/archive/afd6824ce00063bb8e9b7a1c5daf0737c2f61616.tar.gz + version: 0.17.1 + original: + url: https://github.com/xmonad/xmonad-contrib/archive/afd6824ce00063bb8e9b7a1c5daf0737c2f61616.tar.gz +- completed: + hackage: xmobar-0.44.2@sha256:a2eed5f8833194babd60e45520023cd5698ccb8d40976d1f41a9b53b350297d0,14895 + pantry-tree: + sha256: c7714be550d267369496c484ba727847f50e941d66009d2f8a8268629fe953f8 + size: 9498 + original: + hackage: xmobar-0.44.2 +snapshots: +- completed: + sha256: f5d9002479d87103fd070f17cfe71fcd2147676f1e47a2dabca5ab91a42b846d + size: 619399 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/19/23.yaml + original: lts-19.23 diff --git a/configs/xmonad/tutorial b/configs/xmonad/tutorial new file mode 100644 index 0000000..fb86c48 --- /dev/null +++ b/configs/xmonad/tutorial @@ -0,0 +1,5 @@ +cd ~/.config/xmonad + +stack setup +stack install +./build diff --git a/configs/xmonad/update b/configs/xmonad/update new file mode 100755 index 0000000..89b1031 --- /dev/null +++ b/configs/xmonad/update @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +declare -r LATESTXMONAD=${LATESTXMONAD:-$(git ls-remote https://github.com/xmonad/xmonad.git HEAD | sed "s/HEAD//")} +declare -r LATESTCONTRIB=${LATESTCONTRIB:-$(git ls-remote https://github.com/xmonad/xmonad-contrib.git HEAD | sed "s/HEAD//")} +declare -r LATESTX11=${LATESTX11:-$(git ls-remote https://github.com/xmonad/x11.git HEAD | sed "s/HEAD//")} + +declare CURRENTXMONAD=${CURRENTXMONAD:-$(awk '/xmonad[/]xmonad$/{getline;print$2}' ${HOME}/.config/xmonad/stack.yaml)} +declare CURRENTCONTRIB=${CURRENTCONTRIB:-$(awk '/xmonad[/]xmonad-contrib$/{getline;print$2}' ${HOME}/.config/xmonad/stack.yaml)} +declare CURRENTX11=${CURRENTX11:-$(awk '/xmonad[/]x11$/{getline;print$2}' ${HOME}/.config/xmonad/stack.yaml)} + +function main() { + if [[ "$LATESTXMONAD" != "$CURRENTXMONAD" ]] ; then + sed -i "s/${CURRENTXMONAD}/${LATESTXMONAD}/" ${HOME}/.config/xmonad/stack.yaml + printf "XMonad update completed\n" + fi + + if [[ "$LATESTCONTRIB" != "$CURRENTCONTRIB" ]] ; then + sed -i "s/${CURRENTCONTRIB}/${LATESTCONTRIB}/" ${HOME}/.config/xmonad/stack.yaml + printf "XMonad-Contrib update completed\n" + fi + + if [[ "$LATESTX11" != "$CURRENTX11" ]] ; then + sed -i "s/${CURRENTX11}/${LATESTX11}/" ${HOME}/.config/xmonad/stack.yaml + printf "X11 update completed\n" + fi +} + +main "$@" diff --git a/configs/xmonad/xmobar/trayer-padding.sh b/configs/xmonad/xmobar/trayer-padding.sh new file mode 100755 index 0000000..e3112ac --- /dev/null +++ b/configs/xmonad/xmobar/trayer-padding.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# Detects the width of running window with name given as first +# argument (xprop name '$1') and creates an XPM icon of that width, +# 1px height, and transparent. Outputs an -tag for use in +# xmobar to display the generated XPM icon. +# +# Run script from xmobar and trayer: +# `Run Com "/where/ever/padding-icon.sh" ["panel"] "trayerpad" 10` +# and use `%trayerpad%` in your template. +# or, if you're using for instance stalonetray: +# `Run Com "/where/ever/padding-icon.sh" ["stalonetray"] "tray" 10` + +# Very heavily based on Jonas Camillus Jeppensen code +# https://github.com/jaor/xmobar/issues/239#issuecomment-233206552 + +# Function to create a transparent Wx1 px XPM icon +create_xpm_icon () { +timestamp=$(date) +pixels=$(for i in `seq $1`; do echo -n "."; done) + +cat << EOF > "$2" +/* XPM * +static char * trayer_pad_xpm[] = { +/* This XPM icon is used for padding in xmobar to */ +/* leave room for trayer-srg. It is dynamically */ +/* updated by by trayer-pad-icon.sh which is run */ +/* by xmobar. */ +/* Created: ${timestamp} */ +/* */ +"$1 1 1 1", +/* Colors (none: transparent) */ +". c none", +/* Pixels */ +"$pixels" +}; +EOF +} + +# Width of the trayer window +width=$(xprop -name panel | grep 'program specified minimum size' | cut -d ' ' -f 5) + +# Icon file name +iconfile="/tmp/$pname-padding-${width:-0}px.xpm" + +# If the desired icon does not exist create it +if [ ! -f $iconfile ] +then + create_xpm_icon $width $iconfile +fi + +# Output the icon tag for xmobar +echo "" diff --git a/configs/xmonad/xmobar/xmobar.hs b/configs/xmonad/xmobar/xmobar.hs new file mode 100644 index 0000000..9034423 --- /dev/null +++ b/configs/xmonad/xmobar/xmobar.hs @@ -0,0 +1,36 @@ +-- vim: ft=haskell +-- +-- xmobar config - https://github.com/jaor/xmobar +-- depends on: +-- - xmonad +-- +Config { + -- BEHAVIOUR + overrideRedirect = True + , lowerOnStart = True + , persistent = True + -- APPEARANCE + , font = "xft:FiraCode Nerd Font:style=Regular:size=12" + , additionalFonts = ["xft:Open Sans:style=Regular:size=12"] + --bgColor = "#0d0e0c", + , bgColor = "#212121" + , fgColor = "#c8b6b8" + , position = Static { xpos = 0, ypos = 0, width = 1920, height = 30 } + -- MODULES + , commands = + [ Run Date "%a %b %d, %H:%M" "date" 10 + , Run Cpu [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Memory [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Com "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" [] "volume" 1 + -- , Run ComX "tail" ["-n1", "/tmp/.xmonad-workspace-log"] " Xmonad" "ws" 1 + , Run ComX "tail" ["-n1", "/tmp/.xmonad-title-log"] "" "title" 1 + -- , Run ComX "xkb-switch" [] "en" "lang" 1 + , Run Com "/home/klein/.config/xmonad/xmobar/trayer-padding.sh" [] "trayerpad" 10 + , Run UnsafeStdinReader + , Run UnsafeXMonadLog + ] + -- DISPLAY + , alignSep = "}{" + , sepChar = "%" + , template = "  %UnsafeXMonadLog% }{ CPU: %cpu% Mem: %memory% %date% %trayerpad%" + } diff --git a/configs/xmonad/xmobar/xmobar1.hs b/configs/xmonad/xmobar/xmobar1.hs new file mode 100644 index 0000000..86f7d81 --- /dev/null +++ b/configs/xmonad/xmobar/xmobar1.hs @@ -0,0 +1,36 @@ +-- vim: ft=haskell +-- +-- xmobar config - https://github.com/jaor/xmobar +-- depends on: +-- - xmonad +-- +Config { + -- BEHAVIOUR + overrideRedirect = True + , lowerOnStart = True + , persistent = True + -- APPEARANCE + , font = "xft:FiraCode Nerd Font:style=Regular:size=12" + , additionalFonts = ["xft:Open Sans:style=Regular:size=12"] + --bgColor = "#0d0e0c", + , bgColor = "#181814" + , fgColor = "#c8b6b8" + , position = Static { xpos = 1920, ypos = 148, width = 1920, height = 35 } + -- MODULES + , commands = + [ Run Date "%a %b %d, %H:%M" "date" 10 + , Run Cpu [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Memory [ "-t", "", "-f", ":", "-H", "75", "-L", "25", "-h", "#C15A45", "-n", "#E4966D", "-l", "#BE8961" ] 10 + , Run Com "amixer sget Master | awk -F\"[][]\" '/%/ { print $2 }' | head -n1" [] "volume" 1 + -- , Run ComX "tail" ["-n1", "/tmp/.xmonad-workspace-log"] " Xmonad" "ws" 1 + , Run ComX "tail" ["-n1", "/tmp/.xmonad-title-log"] "" "title" 1 + -- , Run ComX "xkb-switch" [] "en" "lang" 1 + -- , Run Com "/home/klein/.config/xmonad/xmobar/trayer-padding.sh" [] "trayerpad" 10 + , Run UnsafeStdinReader + , Run UnsafeXMonadLog + ] + -- DISPLAY + , alignSep = "}{" + , sepChar = "%" + , template = "  %UnsafeXMonadLog% %title%}{ CPU: %cpu% Mem: %memory% %date%" + } diff --git a/configs/xmonad/xmonad-scherso.cabal b/configs/xmonad/xmonad-scherso.cabal new file mode 100644 index 0000000..cf666ee --- /dev/null +++ b/configs/xmonad/xmonad-scherso.cabal @@ -0,0 +1,42 @@ +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.34.4. +-- +-- see: https://github.com/sol/hpack + +name: xmonad-scherso +version: 0.1.0 +synopsis: My XMonad configuration. +homepage: https://github.com/Scherso/Dotfiles +author: Scherso +maintainer: Scherso +license: DBAD +build-type: Simple + +executable xmobar + main-is: xmobar.hs + other-modules: + Paths_xmonad_scherso + hs-source-dirs: + src + ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -O2 -j -dynamic -rtsopts -threaded -with-rtsopts=-N + build-depends: + base + , xmobar + , xmonad-contrib >=0.16 + default-language: Haskell2010 + +executable xmonad + main-is: xmonad.hs + other-modules: + Paths_xmonad_scherso + hs-source-dirs: + src + ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints -O2 -j -dynamic + build-depends: + X11 >=1.10 + , base + , containers + , xmonad + , xmonad-contrib >=0.16 + default-language: Haskell2010 diff --git a/configs/xmonad/xmonad.hs b/configs/xmonad/xmonad.hs index 98637b7..a2e88be 100644 --- a/configs/xmonad/xmonad.hs +++ b/configs/xmonad/xmonad.hs @@ -1,398 +1,269 @@ --- --- xmonad example config file. --- --- A template showing all available configuration hooks, --- and how to override the defaults in your own xmonad.hs conf file. --- --- Normally, you'd only override those defaults you care about. --- - -import XMonad -import Data.Monoid -import System.Exit -import XMonad.Util.SpawnOnce -import XMonad.Util.Run -import XMonad.Hooks.ManageDocks -import XMonad.Hooks.DynamicLog -import qualified XMonad.StackSet as W -import qualified Data.Map as M -import qualified XMonad.Util.Hacks as Hacks -import XMonad.Util.EZConfig -import XMonad.Util.Ungrab -import XMonad.Layout.ThreeColumns -import XMonad.Layout.Magnifier -import XMonad.Hooks.EwmhDesktops -import XMonad.Hooks.StatusBar -import XMonad.Hooks.StatusBar.PP -import XMonad.Layout.IndependentScreens -import XMonad.Util.Loggers +-- ## Modules ## ------------------------------------------------------------------- +{-# LANGUAGE MultiWayIf #-} +import XMonad +import XMonad.Util.SpawnOnce +import XMonad.Hooks.EwmhDesktops +import XMonad.Hooks.ManageDocks +import XMonad.Hooks.ManageHelpers import XMonad.ManageHook -import XMonad.Hooks.ManageHelpers -import XMonad.Layout.Renamed +import XMonad.Util.Ungrab +import XMonad.Util.Hacks as Hacks +import XMonad.Hooks.WindowSwallowing +import XMonad.Layout.Fullscreen +import XMonad.Layout.NoBorders +import XMonad.Layout.Spacing +import XMonad.Layout.Gaps +import XMonad.Hooks.StatusBar +import XMonad.Hooks.StatusBar.PP +import System.Exit +import Control.Monad +import Data.Monoid +import Data.Maybe +import XMonad.Util.Cursor +import Graphics.X11.ExtraTypes.XF86 import XMonad.Util.ClickableWorkspaces --- The preferred terminal program, which is used in a binding below and by --- certain contrib modules. --- -myTerminal = "alacritty" +import qualified XMonad.StackSet as W +import qualified Data.Map as M --- Whether focus follows the mouse pointer. +-- focus follows the mouse pointer myFocusFollowsMouse :: Bool myFocusFollowsMouse = True --- Whether clicking on a window to focus also passes the click to the window +-- clicking on a window to focus myClickJustFocuses :: Bool -myClickJustFocuses = False +myClickJustFocuses = True --- Width of the window border in pixels. --- -myBorderWidth = 2 +-- Width of the window border in pixels +myBorderWidth = 2 --- modMask lets you specify which modkey you want to use. The default --- is mod1Mask ("left alt"). You may also consider using mod3Mask --- ("right alt"), which does not conflict with emacs keybindings. The --- "windows key" is usually mod4Mask. --- -myModMask = mod4Mask +-- Border colors for focused & unfocused windows +myFocusedBorderColor = "#de935f" +myNormalBorderColor = "#5f819d" --- The default number of workspaces (virtual screens) and their names. --- By default we use numeric strings, but any string may be used as a --- workspace name. The number of workspaces is determined by the length --- of this list. --- --- A tagging example: --- --- > workspaces = ["web", "irc", "code" ] ++ map show [4..9] --- --- myWorkspaces = ["1","2","3","4","5","6","7","8","9"] +-- modMask : modkey you want to use +-- mod1Mask : left alt Key +-- mod4Mask : Windows or Super Key +myModMask = mod4Mask +myTerminal = "kitty" +-- Workspaces (ewmh) +myWorkspaces = ["dev", "web", "irc", "gfx", "vm", "music", "email", "x"] --- Border colors for unfocused and focused windows, respectively. --- -myNormalBorderColor = "#dddddd" -myFocusedBorderColor = "#ff0000" - ------------------------------------------------------------------------- --- Key bindings. Add, modify or remove key bindings here. --- myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $ - - -- launch a terminal - [ ((modm, xK_Return), spawn $ XMonad.terminal conf) - - -- launch rofi drun - , ((modm .|. shiftMask, xK_Return), spawn "rofi -show drun") - - -- launch rofi emoji - , ((modm .|. shiftMask, xK_p ), spawn "rofi -show emoji") - - -- launch betterlockscreen - , ((modm .|. shiftMask, xK_l ), spawn "betterlockscreen --lock dimblur") - - -- take a screenshot - , ((0, xK_Print ), spawn "/home/lucas/.config/rofi/fullscreen.sh") - - -- close focused window - , ((modm .|. shiftMask, xK_c ), kill) - - -- Rotate through the available layout algorithms - , ((modm, xK_space ), sendMessage NextLayout) - - -- Reset the layouts on the current workspace to default - , ((modm .|. shiftMask, xK_space ), setLayout $ XMonad.layoutHook conf) - - -- Resize viewed windows to the correct size - , ((modm, xK_n ), refresh) - - -- Move focus to the next window - , ((modm, xK_Tab ), windows W.focusDown) - - -- Move focus to the next window - , ((modm, xK_j ), windows W.focusDown) - - -- Move focus to the previous window - , ((modm, xK_k ), windows W.focusUp ) - - -- Move focus to the master window - , ((modm, xK_m ), windows W.focusMaster ) - - -- Swap the focused window and the master window - , ((modm, xK_p), windows W.swapMaster) - - -- Swap the focused window with the next window - , ((modm .|. shiftMask, xK_j ), windows W.swapDown ) - - -- Swap the focused window with the previous window - , ((modm .|. shiftMask, xK_k ), windows W.swapUp ) - - -- Shrink the master area - , ((modm, xK_h ), sendMessage Shrink) - - -- Expand the master area - , ((modm, xK_l ), sendMessage Expand) - - -- Push window back into tiling - , ((modm, xK_t ), withFocused $ windows . W.sink) - - -- Increment the number of windows in the master area - , ((modm , xK_comma ), sendMessage (IncMasterN 1)) - - -- Deincrement the number of windows in the master area - , ((modm , xK_period), sendMessage (IncMasterN (-1))) - - -- Toggle the status bar gap - -- Use this binding with avoidStruts from Hooks.ManageDocks. - -- See also the statusBar function from Hooks.DynamicLog. - -- - -- , ((modm , xK_b ), sendMessage ToggleStruts) - - -- Quit xmonad - , ((modm .|. shiftMask, xK_q ), io (exitWith ExitSuccess)) - - -- Restart xmonad - , ((modm , xK_q ), spawn "xmonad --recompile; xmonad --restart") - - -- Run xmessage with a summary of the default keybindings (useful for beginners) - , ((modm .|. shiftMask, xK_slash ), spawn ("echo \"" ++ help ++ "\" | xmessage -file -")) + -- Close focused window + [ ((modm .|. shiftMask, xK_c), kill) + , ((modm, xK_Escape), spawn "mpc toggle") + , ((modm .|. shiftMask, xK_m), spawn "kitty -e ncmpcpp") + , ((modm, xK_e), spawn "pcmanfm") + , ((modm, xK_v), spawn "vscodium") + , ((modm, xK_Return), spawn myTerminal) + , ((modm .|. shiftMask, xK_Escape), spawn "/home/klein/.config/rofi/powermenu/type-6/powermenu.sh") + , ((modm .|. shiftMask, xK_Return), spawn "/home/klein/.config/rofi/launchers/type-7/launcher.sh") + , ((0 .|. shiftMask, xK_Print), unGrab >> spawn "/home/klein/.local/bin/print-select") + , ((0, xK_Print), spawn "/home/klein/.local/bin/print-fullscreen") + -- Change gaps on the fly + , ((modm .|. controlMask, xK_o), sendMessage $ IncGap 10 L) -- increment the left-hand gap + , ((modm .|. shiftMask, xK_o), sendMessage $ DecGap 10 L) -- decrement the left-hand gap + , ((modm .|. controlMask, xK_y), sendMessage $ IncGap 10 U) -- increment the top gap + , ((modm .|. shiftMask, xK_y), sendMessage $ DecGap 10 U) -- decrement the top gap + , ((modm .|. controlMask, xK_u), sendMessage $ IncGap 10 D) -- increment the bottom gap + , ((modm .|. shiftMask, xK_u), sendMessage $ DecGap 10 D) -- decrement the bottom gap + , ((modm .|. controlMask, xK_i), sendMessage $ IncGap 10 R) -- increment the right-hand gap + , ((modm .|. shiftMask, xK_i), sendMessage $ DecGap 10 R) -- decrement the right-hand gap + -- Resize viewed windows to the correct size + , ((modm, xK_r), refresh) + -- Move focus to the master window + , ((modm, xK_m), windows W.focusMaster) + -- Push window back into tiling + , ((modm, xK_t), withFocused $ windows . W.sink) + -- Rotate through the available layout algorithms + , ((modm, xK_space), sendMessage NextLayout) + -- Reset the layouts on the current workspace to default + , ((modm .|. shiftMask, xK_space), setLayout $ XMonad.layoutHook conf) + -- Move focus to the next window + , ((modm, xK_Tab), windows W.focusDown) + -- Move focus to the next window + , ((modm, xK_j), windows W.focusDown) + , ((modm, xK_Left), windows W.focusDown) + -- Move focus to the previous window + , ((modm, xK_k), windows W.focusUp) + , ((modm, xK_Right), windows W.focusUp) + -- Swap the focused window with the next window + , ((modm .|. shiftMask, xK_j), windows W.swapDown) + , ((modm .|. shiftMask, xK_h), windows W.swapDown) + -- Swap the focused window with the previous window + , ((modm .|. shiftMask, xK_k), windows W.swapUp) + , ((modm .|. shiftMask, xK_l), windows W.swapUp) + -- Shrink the master area + , ((modm, xK_h), sendMessage Shrink) + , ((modm .|. controlMask, xK_Left), sendMessage Shrink) + -- Expand the master area + , ((modm, xK_l), sendMessage Expand) + , ((modm .|. controlMask, xK_Right), sendMessage Expand) + -- Increment the number of windows in the master area + , ((modm, xK_comma), sendMessage (IncMasterN 1)) + -- Deincrement the number of windows in the master area + , ((modm, xK_period), sendMessage (IncMasterN (-1))) + -- volume + , ((0,xF86XK_AudioMute), spawn "pactl set-sink-mute @DEFAULT_SINK@ toggle") + , ((0,xF86XK_AudioLowerVolume), spawn "pactl set-sink-volume @DEFAULT_SINK@ -5%") + , ((0,xF86XK_AudioRaiseVolume), spawn "pactl set-sink-volume @DEFAULT_SINK@ +5%") + -- Restart xmonad + , ((controlMask .|. shiftMask, xK_r), spawn "xmonad --recompile; xmonad --restart") + -- Quit xmonad + , ((controlMask .|. shiftMask, xK_q), spawn "pkill -KILL -u $USER") + -- programs + , ((modm, xK_d), spawn "cd ~/.config && ./webcordx") + , ((modm, xK_s), spawn "spotify") + , ((modm , xK_y ), sendMessage ToggleStruts) + , ((modm .|. shiftMask, xK_b), spawn "firefox") + -- , ((modm, xK_F1), spawn "dmenu_run") + -- spotify controls, handy af + , ((modm, xK_F9), spawn "playerctl play-pause") + , ((modm, xK_F11), spawn "playerctl previous") + , ((modm, xK_F12), spawn "playerctl next") + , ((modm, xK_p), spawn "flameshot") + , ((modm, xK_F4), withFocused toggleFull) ] ++ - - -- -- mod-[1..9], Switch to workspace N -- mod-shift-[1..9], Move client to workspace N - -- - [((m .|. modm, k), windows $ onCurrentScreen f i) - | (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9] - , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]] + [ ((m .|. modm, k), windows $ f i) + | (i, k) <- zip (XMonad.workspaces conf) [xK_1,xK_2,xK_3,xK_4,xK_5,xK_6,xK_7,xK_8,xK_9,xK_0] + , (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)] + ] ++ - - -- - -- mod-{w,e,r}, Switch to physical/Xinerama screens 1, 2, or 3 - -- mod-shift-{w,e,r}, Move client to screen 1, 2, or 3 - -- - [((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) - | (key, sc) <- zip [xK_comma, xK_period, xK_backslash] [0..] - , (f, m) <- [(W.view, 0), (W.shift, shiftMask)]] - - ------------------------------------------------------------------------- --- Mouse bindings: default actions bound to mouse events --- -myMouseBindings (XConfig {XMonad.modMask = modm}) = M.fromList $ - - -- mod-button1, Set the window to floating mode and move by dragging - [ ((modm, button1), (\w -> focus w >> mouseMoveWindow w - >> windows W.shiftMaster)) - - -- mod-button2, Raise the window to the top of the stack - , ((modm, button2), (\w -> focus w >> windows W.shiftMaster)) - - -- mod-button3, Set the window to floating mode and resize by dragging - , ((modm, button3), (\w -> focus w >> mouseResizeWindow w - >> windows W.shiftMaster)) - - -- you may also bind events to the mouse scroll wheel (button4 and button5) + -- mod-{q,a,z}, Switch to physical/Xinerama screens 1, 2, or 3 + -- mod-shift-{q,a,z}, Move client to screen 1, 2, or 3 + [ ((m .|. modm, key), screenWorkspace sc >>= flip whenJust (windows . f)) + | (key, sc) <- zip [xK_comma, xK_period, xK_z] [0..] + , (f, m) <- [(W.view, 0), (W.shift, shiftMask)] ] ------------------------------------------------------------------------- --- Layouts: +-- ## Mouse Bindings ## ------------------------------------------------------------------ +myMouseBindings :: XConfig l -> M.Map (KeyMask, Button) (Window -> X ()) +myMouseBindings XConfig {XMonad.modMask = modm} = M.fromList + -- Set the window to floating mode and move by dragging. + [ ((modm, button1), \w -> focus w >> mouseMoveWindow w >> windows W.shiftMaster) + -- Raise the window to the top of the stack. + , ((modm, button2), \w -> focus w >> windows W.shiftMaster) + -- Set the window to floating mode and resize by dragging. + , ((modm, button3), \w -> focus w >> mouseResizeWindow w >> windows W.shiftMaster) + ] --- You can specify and transform your layouts by modifying these values. --- If you change layout bindings be sure to use 'mod-shift-space' after --- restarting (with 'mod-q') to reset your layout state to the new --- defaults, as xmonad preserves your old layout settings by default. --- --- The available layouts. Note that each layout is separated by |||, --- which denotes layout choice. --- -myLayout = avoidStruts tiled ||| Mirror tiled ||| Full ||| threeCol +myLayout = + avoidStruts + $ lessBorders OnlyScreenFloat + $ gaps [(L,5), (R,5), (U,5), (D,5)] + $ spacingRaw False (Border 10 0 10 0) True (Border 0 10 0 10) True + $ tiled ||| Mirror tiled ||| Full where - threeCol - = renamed [Replace "ThreeCol"] - $ magnifiercz' 1.3 - $ ThreeColMid nmaster delta ratio - tiled = Tall nmaster delta ratio - nmaster = 1 -- Default number of windows in the master pane - ratio = 1/2 -- Default proportion of screen occupied by master pane - delta = 3/100 -- Percent of screen to increment by when resizing panes + tiled = Tall nmaster delta ratio + nmaster = 1 -- Default number of windows in the master pane. + ratio = 1 / 2 -- Default proportion of screen occupied by master panes. + delta = 3 / 100 -- Percent of screen increment by when resizing panes. ------------------------------------------------------------------------- --- Window rules: +myManageHook :: XMonad.Query (Data.Monoid.Endo WindowSet) +myManageHook = manageRules + where + viewShift = doF . liftM2 (.) W.greedyView W.shift + manageRules = composeAll . concat $ + [ [ isDialog --> doCenterFloat ] + , [ className =? c --> doCenterFloat | c <- myCFloats ] + , [ title =? t --> doCenterFloat | t <- myTFloats ] + , [ resource =? r --> doFloat | r <- myRFloats ] + , [ resource =? i --> doIgnore | i <- myIgnores ] + , [ className =? "firefox" --> viewShift "web" ] + , [ className =? "firefox-esr" --> doShift "web" ] + , [ className =? "discord" --> doShift "irc" ] + , [ className =? "Spotify" --> doShift "music" ] + , [ className =? "thunderbird" --> doShift "email" ] + , [ className =? "Steam" --> doShift "x" ] + , [ className =? "leagueclientux.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "Lutris" --> doShift "gfx" <> doFloat] + , [ className =? "league of legends.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "riotclientux.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "dauntless-win64-shipping.exe" --> doShift "gfx" ] + , [ className =? "leagueclient.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "battle.net.exe" --> doShift "gfx" <> doFloat ] + , [ className =? "Pcmanfm" --> doFloat ] + , [ className =? "Pavucontrol" --> doFloat ] --- Execute arbitrary actions and WindowSet manipulations when managing --- a new window. You can use this to, for example, always float a --- particular program, or have a client always appear on a particular --- workspace. --- --- To find the property name associated with a program, use --- > xprop | grep WM_CLASS --- and click on the client you're interested in. --- --- To match on the WM_NAME, you can use 'title' in the same way that --- 'className' and 'resource' are used below. --- -myManageHook = composeAll - [ className =? "MPlayer" --> doFloat - , className =? "Gimp" --> doFloat - , isDialog --> doFloat - , resource =? "desktop_window" --> doIgnore - , resource =? "kdesktop" --> doIgnore ] + ] + where + myCFloats = ["Viewnior", "Alafloat"] + myTFloats = ["Downloads", "Save As...", "Getting Started"] + myRFloats = [] + myIgnores = ["desktop_window"] ------------------------------------------------------------------------- --- Event handling +-- , [className =? "Alacritty" --> viewShift "1"] +-- , [className =? "Thunar" --> viewShift "3"] +-- , [className =? "Geany" --> viewShift "4"] +-- , [className =? "Inkscape" --> viewShift "5"] +-- , [className =? "vlc" --> viewShift "6"] +-- , [className =? "Xfce4-settings-manager" --> viewShift "7"] --- * EwmhDesktops users should change this to ewmhDesktopsEventHook --- --- Defines a custom handler function for X Events. The function should --- return (All True) if the default handler is to be run afterwards. To --- combine event hooks use mappend or mconcat from Data.Monoid. --- ---myEventHook = handleEventHook def <> Hacks.windowedFullscreenFixEventHook +toggleFull :: Window -> X () +toggleFull w = windows $ \s -> if + | M.lookup w (W.floating s) == Just fullscreen -> W.sink w s + | otherwise -> W.float w fullscreen s + where + fullscreen = W.RationalRect 0 0 1 1 ------------------------------------------------------------------------- --- Status bars and logging +myEventHook :: Event -> X All +myEventHook = mempty $ swallowEventHook (className =? "Alacritty" <||> className =? "kitty") (return True) -- ewmh --- Perform an arbitrary action on each internal state change or X event. --- See the 'XMonad.Hooks.DynamicLog' extension for examples. --- ---myLogHook h = dynamicLogWithPP $ xmobarPP - -- { ppOutput = hPutStrLn h - -- , ppCurrent = xmobarColor "#8378c7" "" - -- , ppHidden = xmobarColor "#343050" "" - -- , ppHiddenNoWindows = xmobarColor "#ac9b9b" "" - -- } +myStartupHook :: X () +myStartupHook = do + setDefaultCursor xC_left_ptr + spawnOnce "nitrogen --restore" + spawnOnce "/home/klein/scripts/xmonad.sh" + -- spawnOnce "picom --daemon --experimental-backends --backend glx --blur-method dual_kawase --transparent-clipping" + -- spawnOnce "killall trayer; trayer --edge top --align right --widthtype request --padding 2 --SetDockType true --SetPartialStrut true --expand true --transparent true --alpha 0 --tint 0x161814 --height 25 --distance 3 &" + -- spawnOnce "dunst" + +myLogHook = return () myXmobarPP :: PP -myXmobarPP = def - { ppSep = magenta " • " - , ppTitleSanitize = xmobarStrip - , ppCurrent = wrap " " "" . xmobarBorder "Top" "#8be9fd" 2 - , ppHidden = white . wrap " " "" - , ppHiddenNoWindows = lowWhite . wrap " " "" - , ppUrgent = red . wrap (yellow "!") (yellow "!") - , ppOrder = \[ws, l, _, wins] -> [ws, l, wins] - , ppExtras = [logTitles formatFocused formatUnfocused] +myXmobarPP = + def + { ppCurrent = xmobarColor "#de935f" "" . wrap "[" "]", + ppHidden = xmobarColor "#d2ba8b" "", + ppHiddenNoWindows = xmobarColor "#a3846e" "", + ppSep = " > ", + ppOrder = \(ws : l : t : ex) -> [ws] ++ map (xmobarColor "#E06C75" "") ex ++ [xmobarColor "#ABB2BF" "" t], + ppExtras = [] } - where - formatFocused = wrap (white "[") (white "]") . magenta . ppWindow - formatUnfocused = wrap (lowWhite "[") (lowWhite "]") . blue . ppWindow - -- | Windows should have *some* title, which should not not exceed a - -- sane length. - ppWindow :: String -> String - ppWindow = xmobarRaw . (\w -> if null w then "untitled" else w) . shorten 30 +myConfig = + def + { focusFollowsMouse = myFocusFollowsMouse + , clickJustFocuses = myClickJustFocuses + , borderWidth = myBorderWidth + , modMask = myModMask + , workspaces = myWorkspaces + , normalBorderColor = myNormalBorderColor + , focusedBorderColor = myFocusedBorderColor + , terminal = myTerminal + -- Keybindings + , keys = myKeys + , mouseBindings = myMouseBindings + -- Hooks and layouts + , manageHook = myManageHook + , layoutHook = myLayout + , handleEventHook = myEventHook + <> Hacks.trayerAboveXmobarEventHook + , logHook = myLogHook + , startupHook = myStartupHook + } - blue, lowWhite, magenta, red, white, yellow :: String -> String - magenta = xmobarColor "#ff79c6" "" - blue = xmobarColor "#bd93f9" "" - white = xmobarColor "#f8f8f2" "" - yellow = xmobarColor "#f1fa8c" "" - red = xmobarColor "#ff5555" "" - lowWhite = xmobarColor "#bbbbbb" "" - -mySBL = statusBarProp "xmobar ~/.config/xmobar/xmobarrc" $ clickablePP (marshallPP (S 0) myXmobarPP) -mySBR = statusBarProp "xmobar ~/.config/xmobar/xmobarrc1" $ clickablePP (marshallPP (S 1) myXmobarPP) - ------------------------------------------------------------------------- --- Startup hook - --- Perform an arbitrary action each time xmonad starts or is restarted --- with mod-q. Used by, e.g., XMonad.Layout.PerWorkspace to initialize --- per-workspace layout choices. --- --- By default, do nothing. -myStartupHook :: X() -myStartupHook = do - -- spawnOnce "nitrogen --restore &" - -- spawnOnce "picom &" - spawnOnce "~/.dwm/xmonad.sh" - ------------------------------------------------------------------------- --- Now run xmonad with all the defaults we set up. - --- Run xmonad with the settings you specify. No need to modify this. --- main :: IO () -main = xmonad - . ewmhFullscreen - . ewmh - . withEasySB (mySBL <> mySBR) defToggleStrutsKey - $ myConfig - -myConfig = def - { - - -- simple stuff - terminal = myTerminal, - focusFollowsMouse = myFocusFollowsMouse, - clickJustFocuses = myClickJustFocuses, - borderWidth = myBorderWidth, - modMask = myModMask, - -- workspaces = myWorkspaces, - workspaces = withScreens 2 ["term", "web", "irc", "gfx", "vm", "code", "music", "x", "xx"], - normalBorderColor = myNormalBorderColor, - focusedBorderColor = myFocusedBorderColor, - - -- key bindings - keys = myKeys, - mouseBindings = myMouseBindings, - - -- hooks, layouts - layoutHook = myLayout, - manageHook = myManageHook, --- handleEventHook = myEventHook, --- logHook = myLogHook, - startupHook = myStartupHook - } - - --- | Finally, a copy of the default bindings in simple textual tabular format. -help :: String -help = unlines ["The default modifier key is 'alt'. Default keybindings:", - "", - "-- launching and killing programs", - "mod-Shift-Enter Launch xterminal", - "mod-p Launch dmenu", - "mod-Shift-p Launch gmrun", - "mod-Shift-c Close/kill the focused window", - "mod-Space Rotate through the available layout algorithms", - "mod-Shift-Space Reset the layouts on the current workSpace to default", - "mod-n Resize/refresh viewed windows to the correct size", - "", - "-- move focus up or down the window stack", - "mod-Tab Move focus to the next window", - "mod-Shift-Tab Move focus to the previous window", - "mod-j Move focus to the next window", - "mod-k Move focus to the previous window", - "mod-m Move focus to the master window", - "", - "-- modifying the window order", - "mod-Return Swap the focused window and the master window", - "mod-Shift-j Swap the focused window with the next window", - "mod-Shift-k Swap the focused window with the previous window", - "", - "-- resizing the master/slave ratio", - "mod-h Shrink the master area", - "mod-l Expand the master area", - "", - "-- floating layer support", - "mod-t Push window back into tiling; unfloat and re-tile it", - "", - "-- increase or decrease number of windows in the master area", - "mod-comma (mod-,) Increment the number of windows in the master area", - "mod-period (mod-.) Deincrement the number of windows in the master area", - "", - "-- quit, or restart", - "mod-Shift-q Quit xmonad", - "mod-q Restart xmonad", - "mod-[1..9] Switch to workSpace N", - "", - "-- Workspaces & screens", - "mod-Shift-[1..9] Move client to workspace N", - "mod-{w,e,r} Switch to physical/Xinerama screens 1, 2, or 3", - "mod-Shift-{w,e,r} Move client to screen 1, 2, or 3", - "", - "-- Mouse bindings: default actions bound to mouse events", - "mod-button1 Set the window to floating mode and move by dragging", - "mod-button2 Raise the window to the top of the stack", - "mod-button3 Set the window to floating mode and resize by dragging"] - +main = + do + xmonad + . ewmhFullscreen + . docks + . ewmh + -- . withEasySB (statusBarProp "xmobar -x 1 ~/.config/xmonad/xmobar/xmobar1.hs" (pure myXmobarPP)) defToggleStrutsKey + . withEasySB (statusBarProp "xmobar -x 0 ~/.config/xmonad/xmobar/xmobar.hs" (pure myXmobarPP)) defToggleStrutsKey + $ myConfig