-- Standart AwesomeWM kütüphaneleri
pcall(require, "luarocks.loader")
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
-- ------------------------------------------------------------------------------
-- HATA YAKALAMA (Çökmeleri Önlemek İçin)
-- ------------------------------------------------------------------------------
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Başlangıçta hata oluştu!",
text = awesome.startup_errors })
end
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Çalışma zamanı hatası!",
text = tostring(err) })
in_error = false
end)
end
-- ------------------------------------------------------------------------------
-- TEMA VE GÖRÜNÜM AYARLARI (Gruber-Darker & DWM Stili)
-- ------------------------------------------------------------------------------
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
beautiful.font = "Terminus 10" -- Varsayılan font
beautiful.bg_normal = "#000" -- Koyu arka plan
beautiful.bg_focus = "#ffdd33" -- Aktif sekme (Sarı)
beautiful.fg_normal = "#e4e4ef" -- Normal metin
beautiful.fg_focus = "#181818" -- Aktif sekmede koyu metin
beautiful.border_width = 3
beautiful.border_normal = "#282828" -- Pasif pencere kenarlığı
beautiful.border_focus = "#ffdd33" -- Aktif pencere kenarlığı
beautiful.useless_gap = 0 -- Boşluklar sıfır
beautiful.tasklist_disable_icon = true
-- ------------------------------------------------------------------------------
-- TEMEL DEĞİŞKENLER
-- ------------------------------------------------------------------------------
terminal = "st"
editor = os.getenv("EDITOR") or "hx"
editor_cmd = terminal .. " -e " .. editor
modkey = "Mod4" -- Super/Windows tuşu
awful.layout.layouts = {
awful.layout.suit.tile,
awful.layout.suit.magnifier,
awful.layout.suit.tile.bottom,
awful.layout.suit.fair,
awful.layout.suit.max,
awful.layout.suit.floating,
}
-- ------------------------------------------------------------------------------
-- ÜST BAR (WIBAR) YAPI TAŞLARI
-- ------------------------------------------------------------------------------
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({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
awful.screen.connect_for_each_screen(function(s)
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
s.mypromptbox = awful.widget.prompt()
s.mytasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = {
awful.button({ }, 1, function (c)
c:activate { context = "tasklist", action = "toggle_minimization" }
end),
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 150 } } end),
awful.button({ }, 4, function() awful.client.focus.byidx(-1) end),
awful.button({ }, 5, function() awful.client.focus.byidx( 1) end),
}
}
s.mytaglist = awful.widget.taglist {
screen = s,
filter = awful.widget.taglist.filter.all,
buttons = taglist_buttons,
style = {
shape = function(cr, width, height) gears.shape.rectangle(cr, width, height) end,
}
}
s.mywibox = awful.wibar({ position = "top", screen = s, height = 18, bg = "#000", fg = "#e4e4ef" })
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Sol
layout = wibox.layout.fixed.horizontal,
s.mytaglist,
s.mypromptbox,
},
layout = wibox.layout.align.horizontal,
{ -- Sol
layout = wibox.layout.fixed.horizontal,
s.mytasklist,
}, -- Orta boş
{ -- Sağ
layout = wibox.layout.fixed.horizontal,
wibox.widget.systray(),
wibox.widget.textclock(" %H:%M "),
},
}
end)
-- ------------------------------------------------------------------------------
-- FARE VE TUŞ KOMBİNASYONLARI
-- ------------------------------------------------------------------------------
local clientbuttons = gears.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize)
)
local globalkeys = gears.table.join(
-- Odaklanma ve Navigasyon
awful.key({modkey, }, "Tab",awful.tag.history.restore,{description="tag switch",group="tag"}),
awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) end),
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end),
-- Layout Manipülasyonu
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end),
-- Standart Programlar ve Sistem
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end),
awful.key({ modkey, "Shift" }, "r", awesome.restart),
awful.key({ modkey, "Shift" }, "q", awesome.quit),
--awful.key({ modkey, }, "r", function () awful.screen.focused().mypromptbox:run() end),
awful.key({ modkey }, "r", function ()
awful.spawn("rofi -show run -matching fuzzy -theme-str 'window {width: 30%; border: 2px; border-color: #ffdd33; padding: 10px;} * {background-color: #181818; text-color: #e4e4ef;} element selected {background-color: #ffdd33; text-color: #181818;}'")
end, {description = "Rofi başlat", group = "launcher"}),
-- THINKPAD X201 ÖZEL TUŞLARI (XF86 Keys)
-- ==========================================================================
-- Ses Kontrolleri (Özel Tuşlar)
awful.key({ }, "XF86AudioRaiseVolume", function () awful.spawn("amixer set Master 5%+") end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.spawn("amixer set Master 5%-") end),
awful.key({ }, "XF86AudioMute", function () awful.spawn("amixer set Master toggle") end),
awful.key({ }, "XF86AudioMicMute", function () awful.spawn("amixer set Capture toggle") end),
-- Parlaklık Kontrolleri (Fn + Home / Fn + End)
awful.key({ }, "XF86MonBrightnessUp", function () awful.spawn("brightnessctl set +5%") end),
awful.key({ }, "XF86MonBrightnessDown", function () awful.spawn("brightnessctl set 5%-") end),
-- Medya Kontrolleri (Fn + Yön Tuşları)
awful.key({ }, "XF86AudioPlay", function () awful.spawn("playerctl play-pause") end),
awful.key({ }, "XF86AudioStop", function () awful.spawn("playerctl stop") end),
awful.key({ }, "XF86AudioPrev", function () awful.spawn("playerctl previous") end),
awful.key({ }, "XF86AudioNext", function () awful.spawn("playerctl next") end),
-- ThinkVantage Tuşu (Mavi Tuş - İstediğin bir komutu atayabilirsin, şu an terminal açar)
awful.key({ }, "XF86Launch1", function () awful.spawn(terminal) end),
-- Diğer Fn Kombinasyonları
awful.key({ }, "XF86Sleep", function () awful.spawn("zzz") end), -- Fn + F4 (Uyku - Alpine zzz kullanır)
awful.key({ }, "XF86WLAN", function () awful.spawn("rfkill toggle wlan") end), -- Fn + F5 (Wi-Fi Aç/Kapat)
awful.key({ }, "XF86Display", function () awful.spawn("arandr") end), -- Fn + F7 (Ekran Yönetimi)
awful.key({ }, "XF86TouchpadToggle", function () awful.spawn("synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')") end) -- Fn + F8 (Touchpad)
)
local clientkeys = gears.table.join(
awful.key({ modkey, }, "q", function (c) c:kill() end), -- Pencere Kapat
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen; c:raise() end),
awful.key({ modkey, "Shift" }, "space", awful.client.floating.toggle ),
awful.key({ modkey, }, "m", function (c) c.maximized = not c.maximized; c:raise() end)
)
-- 1-9 arası tag geçişleri
for i = 1, 9 do
globalkeys = gears.table.join(globalkeys,
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then tag:view_only() end
end),
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)
)
end
root.keys(globalkeys)
-- ------------------------------------------------------------------------------
-- PENCERE KURALLARI
-- ------------------------------------------------------------------------------
awful.rules.rules = {
{ 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 }
},
}
-- ------------------------------------------------------------------------------
-- SİNYALLER (Titlebar İptali ve Odak Renkleri)
-- ------------------------------------------------------------------------------
client.connect_signal("manage", function (c)
if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
awful.placement.no_offscreen(c)
end
-- Titlebarları kesin olarak gizle
awful.titlebar.hide(c)
end)
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)0 views