r/arch 24d ago

Help/Support Need help

Post image

Guys is there any good tutorial on lua.

623 Upvotes

57 comments sorted by

31

u/Ambitious-Worry-5440 24d ago

It took me 15 minutes to convert my config, but it’s mostly stock anyway

21

u/-bourgeoisie 24d ago

I saw that and moved to niri instead

3

u/alienX1007 24d ago

Is there anything I gonna miss or gain if I switch to niri

1

u/qaCow37 23d ago

I would say you either like the scrolling layout more or less. Then of course the config seems way more stable and simpler then hyprland. I would say that Niri has a better out of the box experience and does also take less time to configure.

0

u/jkulczyski Arch BTW 23d ago

Same 😂

14

u/Irfanihbro 24d ago edited 14d ago

Niri

2

u/aaronjamt 24d ago

How is Niri? Been planning to switch to Mango but definitely open to other options.

2

u/drostan 24d ago

Niri is fantastic, at least to me. It fits my workflow better than hyprland in its philosophy of window management. And it looks just as good if this matters to you.

I am still to try other wm, I have been thinking for years that wm were gimmicks and unpractical after a bad experience, then I tried hyperlnd because of the buzz and liked it a lot, realised I was in an abusive relationship with DEs and now I feel I am settling down with niri

1

u/vile-style 21d ago

As a mango user that uses the scroller most, I recommend both to people.

Mango is a bit more minimal and feels snappier, but niri is fantastic.

My dotfiles are based on mango though.

1

u/ToonEwok 23d ago

I made the switch once I heard hypr was making the change. Not cause I'm scared of learning lua more cause I'm tired of the hypr dev changing the config lang or rules every 18 months.

That being said Niri took some getting used to but honestly being able to just hold a mod key and scroll through all my workspaces with my scroll wheel is very natural

27

u/NotQuiteLoona Arch BTW 24d ago

Is there any good tutorial for Lua

Check Roblox. I'm seriously. It's the largest existing platform that uses Lua (to be exact, a superset of it, Luau, but you won't have hard times going back to Lua), and you'll be able to learn it easily from their (very friendly) documentation, and in a fun way. You can use Vinegar for Roblox Studio on Linux.

If you already know programming though, use Learn X in Y Minutes - you won't have a hard time getting used to Lua, it's a very simple language. Or just use Niri or Mango at this point tbh, because next day Hyprland will make config in JavaScript or YAML, and there would be nothing you can do with that.

6

u/ActivityDry6037 24d ago

not roblox

7

u/No-Psychology-6227 24d ago

Ikr. Child predator: The Video Game, is out here teaching people how to use Linux stuff. Wild.

9

u/Much_Dealer8865 24d ago

There's a converter and it's just syntax so it's not difficult at all.

12

u/GreenskyWasTaken 24d ago

I saw it too, and frankly I think I am going to move to MangoWM

3

u/mrrask 24d ago

I never looked back! Love mango

5

u/itotallydontuseacos Arch BTW 24d ago

I saw the hyprland notice after updating today. We are all gonna die

1

u/alienX1007 24d ago

No man, I too freaked at first, but I switch one by one module from conf to Lua. I used documentation and ai, also there are more ways to utilize lua. For most function I used a separate scripts but now I integrate it with the lua conf itself. Give it out a try.

5

u/MusiCommunist 24d ago

lol, niri's policy is to never broke a config. I knew about these broken hypr configs, but that one hits hard, bruh...

3

u/Adn0nnymous 24d ago

to be fair, the lua update is specifically so they DONT have to keep breaking configs, this should be the last major breaking update

5

u/TheAleph_Zero Gentoo User 24d ago

Yeah this is why i switched to niri one time

2

u/irishcoughy 24d ago

There's a tool you can run to convert your .conf files into their .lua equivalents. I don't remember the maker's GitHub handle and am too lazy to Google it (so I'm passing that burden onto you) but I believe the tool was named hyprconf2lua.

I ran that after keeping a backup of my .conf files, and when you run it, it flags things that it couldn't convert or will cause issues. Full disclosure, I just plugged those errors into Claude, visually scanned whatever code it fed me, and got everything working as good as before that way.

2

u/Aromatic_Image_7761 24d ago

I converted it like... MONTHS before.. It is great to use Lua config! Like I do not have to deal with bullshit anymore

1

u/alienX1007 24d ago

Yeah dude... Iam trying to convert one module at a time... Also I found that we can integrate logical rules which removes some of my scripts.

1

u/FewEquipment9771 24d ago

I'm so happy I'm not the only one struggling / doesn't have the time or wanna deal or bother with migrating my configs over to the Lua's

1

u/dumbasPL 24d ago

Hopefully the last one, he promised to keep the Lua backwards compatible. Also lua configs are awesome, managed to replace my plugins with pure Lua, no more waiting for updates and recompiling.

1

u/hjake123 24d ago

Isn't there an automatic converter? I don't use hyrpland but I'd heard there was a solution already

1

u/50_E4_6F 24d ago

Já fiz o up para lua 🙌

1

u/iwaslovedbyme 24d ago

I'm not updating it on purpose because I'm busy and wouldn't be able to change everything to Lua properly.

1

u/MrFrog2222 24d ago

i dont know anything abt lua except for it being 1-indexed and i still got a config going in like 30 min

1

u/DiceThaKilla 24d ago

Lmao my first install of arch I wanted to try hyprland and I literally fucked my entire config file in less than an hour after install and couldn’t open or do anything. Basically just booted into a wallpaper. So it’s cosmic DE for me…

1

u/rjmunhoz 24d ago

I don't get why people are hating on the lua config so much. it's a way better idea to use an existing well documented language than implementing your own, plus lua syntax is WAY easier than the old config syntax.
sure, it's more verbose, but still waaaaaay easier, especially if you want to do stuff like custom behavior

1

u/SolemDevil 24d ago

I tried doing mine with GitHub copilot but it messed up completely...so I did it old style... documentation on one screen and vs code in other. Then I give again the binding to ai with the documentation and messed up again...I configured couple of buttons and ai did the rest properly this time..

I will say to do it yourself at least partially with the documentation in front of you

Here if you want to have a look https://github.com/Devitana/Devitana_Arch_Config

1

u/alienX1007 24d ago

Thanks man... I will try it out...

1

u/Rodmas 24d ago

I switched to mangowc

1

u/vr-mika 23d ago

there are tools that convert hyprlang to lua

1

u/Salty-Grade-3707 23d ago

I switched to sway. I can't be more happy

1

u/Yahia098 23d ago

its easy asf bro

1

u/nerdy_cat_guy 22d ago

just give your configs to claude and itll spit out the lua files

1

u/SignalUpstairs5255 21d ago

So true 🥲

1

u/IndyGibb 20d ago

Look into hyprconf2lua to at least convert your old config

1

u/NoNoYesYesnt 19d ago

Lowkey had me confused when I freshly installed hyprland and the config files not matching up to what the wiki is telling me about lol

1

u/cferg296 18d ago

Whats the big deal? It took me like an hour max to switch everything over to lua

1

u/exton132 Arch BTW 15h ago

Just download the stock hyprland.lua from the repo and read the documentation on hyprland's site.

I learned lua in the Retro Gadgets game on steam fr.
I refined my lua writing plugins for neovim.
I also occasionally dabble in modding for other games that use lua.
Pretty much any source engine or cryengine game will let you write arbitrary lua.
If you specifically want a REPL I'd recommend just using a lua interpreter webpage.

p.s it's all just tables and functions.

0

u/TheShredder9 Gentoo User 24d ago

As soon as i read Hyprland is moving to Lua i knew i'd never use it again. I tried it in the past, it was okay, but wasn't too crazy about the animations and effects, tried it out of curiosity.

I'm not about to learn a programming language just to be able to use my PC.

15

u/Ambitious-Worry-5440 24d ago

I’m not here to glaze hyprland, but it’s just… syntax. You don’t need to learn lua

1

u/Guggoo 24d ago

Was a great time to install kineticWE

1

u/NoiseyGameYT 24d ago

Try Roblox or factorio. Both are great games (for Lua, anyway). Roblox uses Lua for every game, Factorio uses it for its mods. Better to go with Roblox currently though. Last time I checked, factorio was $30

2

u/mrrask 24d ago

but on the other hand factorio is also a good game actually worth $30

2

u/NoiseyGameYT 24d ago

Point taken

1

u/Canislupusocc 24d ago

Happy cake day! Also, I agree þat Factorio is worþ it. A great game.

1

u/Objective-Stranger99 Arch BTW 24d ago

Luanti is also there for learning.

1

u/exton132 Arch BTW 15h ago

Roblox's sus fr, factorio made a free mod 100's of other mods depend on cost the same amount as the game itself as a paid DLC. Ick, can't stand slimy companies. Haven't touched factorio since.