Skip to content

Instantly share code, notes, and snippets.

@mjarkk
Last active November 5, 2023 00:40
Show Gist options
  • Star 45 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save mjarkk/eadcd2e793bb5baa0c77f7a539ee7a23 to your computer and use it in GitHub Desktop.
Save mjarkk/eadcd2e793bb5baa0c77f7a539ee7a23 to your computer and use it in GitHub Desktop.

NOT UP TO DATE!

Things in this document might not work or be broken nowadays

my laptop:

I'm writing this here because a few things in here are spesific to this model laptop.
Dell XPS 15 9560 (4k) touch screen

Some notes:

Most things after setup are not specific for this laptop
# = run as root
$ = run as normal user (you)

Install and On first boot

When grub shows up press e
Add the following to the boot parameter nouveau.modeset=0

To start the installer

Yes i know this is kinda stupid but for some reason sometimes the installer wont start
Do not touch the touchscreen after bootup!
Do not close the install screen!
Go to the upper left hot coner and click the install fedora.

When installed and first booted up

NOTE: Make sure to add the boot parameter to the first bootup

$ sudo su
# passwd
# dnf update
# dnf install nano -y
# nano /etc/default/grub

Add the following ot the GRUB_CMDLINE_LINUX parameter nouveau.modeset=0

# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
# shutdown 0 -rf

If the laptop makes it to the desktop it works

Install latest kernel

This is more of a personl preferment because fedora uses usually an onder kernel.

sudo dnf install kernel --enablerepo=updates-testing --best --allowerasing

Insatll nvidia drivers (only this laptop)

$ su
# dnf install fedora-workstation-repositories -y
# dnf config-manager --set-enabled rpmfusion-nonfree-nvidia-driver
# dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo

Reboot..
Open the software app. Click Add-ons > Hardware Drivers > NVIDIA Linux Graphics Driver > Install. (in the software center you will notice that there are 2 nvidia linux graphics driver chose the one where the source is NOT from rpmfusion.org this one is less bugy, but if it doesn't work out for you chose the other one)

Install Chrome, vlc, ffmpeg

$ su
# dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
# dnf install fedora-workstation-repositories
# dnf config-manager --set-enabled google-chrome
# dnf install google-chrome-beta ffmpeg vlc -y

Themes, icons and gnome extensions

i have quite a lot of icons and themes i like

$ cd ~/Downloads
$ git clone https://github.com/vinceliuice/vimix-gtk-themes && cd vimix-gtk-themes
$ ./Install
$ cd ..
$ rm -rf vimix-gtk-themes
$ git clone https://github.com/vinceliuice/Sierra-gtk-theme && cd Sierra-gtk-theme
$ ./install.sh
$ cd ..
$ rm -rf Sierra-gtk-theme
$ su
# dnf copr enable snwh/paper
# dnf makecache
# dnf install gtk-murrine-engine gtk2-engines gnome-tweak-tool chrome-gnome-shell arc-theme paper-icon-theme

Packages i usually install: user themes, dash to dock, block caribou, topicons Plus, caffeine Intel cpu power manager
Open tweak tools to set a theme to youre wish

Make the laptop more power efficent (might result in boot errors with other laptops)

While doing these steps UNPLUG the laptop from power

$ su 
# dnf install powertop tlp tuned-utils thermald -y
# systemctl start powertop
# systemctl enable powertop
# powertop --auto-tune
# nano /etc/default/tlp

In this file uncomment the CPU_SCALING_MAX_FREQ_.... lines and lower the value to make the cpu less power hungry

# systemctl enable tlp
# shutdown 0 -rf 

Install i8kutils a better fan curf (only dell)

$ su
# dnf install acpi
# dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/uriesk/i8kutils/repo/fedora-28/uriesk-i8kutils-fedora-28.repo
# dnf install i8kutils
# echo "i8k" >> /etc/modules
# echo "options i8k force=1" > /etc/modprobe.d/i8k.conf
# curl https://gist.githubusercontent.com/mjarkk/eadcd2e793bb5baa0c77f7a539ee7a23/raw/c01dda8f512a42037c446067eab33b4a62ebc0c6/Z-i8kmon.conf > /etc/i8kmon.conf
# curl https://gist.githubusercontent.com/mjarkk/eadcd2e793bb5baa0c77f7a539ee7a23/raw/c01dda8f512a42037c446067eab33b4a62ebc0c6/z-i8kmod.service > /usr/lib/systemd/system/i8kmod.service
# systemctl enable i8kmod

restart the laptop

Install watchdog to fix a job is running for...

I noticed a wired bug in fedora where when i press shutdown it waits for 150s because of a job is running for ...

$ su
# dnf install watchdog
# systemctl start watchdog
# systemctl enable watchdog

The programs i need for programming

Git

$ git config --global user.name "mjarkk"
$ git config --global user.email "mkopenga@gmail.com"
$ git config --global credential.helper cache
$ git config --global credential.helper 'cache --timeout=43200'

VScode

$ su
# rpm --import https://packages.microsoft.com/keys/microsoft.asc
# sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
# dnf update
# dnf install code -y
# exit
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
$ git config --global core.editor "code --wait"

my vscode settings

Nodejs

$ su
# curl -sL https://rpm.nodesource.com/setup_12.x | bash -
# dnf install nodejs
# exit
$ mkdir ~/.npm-packages
$ prefix = ${HOME}/.npm-packages
$ npm config set prefix '~/.npm-packages'
$ echo 'PATH=$PATH:$HOME/.npm-packages/bin' >> $HOME/.bashrc
$ source ~/.bashrc

Golang

DO NOT RUN THIS IN A ROOT SHELL ('#')

$ sudo dnf install golang
$ mkdir ~/go
$ echo 'export GOPATH=$HOME/go' >> ~/.bashrc && echo 'PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
$ source ~/.bashrc

Php (laravel)

As webserver i use a docker compose config: https://github.com/mjarkk/docker-lemp-config
For laravel devlopment i install:

$ sudo dnf install php php-common php-cli php-json php-pdo php-mbstring php-zip php-xml php-pdo_mysql php-pecl-redis

Install composer via: https://getcomposer.org/download/

$ composer global require "laravel/installer"
$ echo 'PATH=$PATH:$HOME/.config/composer/vendor/bin' >> $HOME/.bashrc

Other programs

pantheon files (the elementary file manager)

$ sudo dnf install pantheon-files

Discord

  1. Download and extract the zip.
  2. Open a terminal and cd to the discord-master directory.
  3. Run one of the following depending on the version you want to create a package for:
  • Discord Stable: ./create-package.sh stable
  • Discord PTB: ./create-package.sh ptb
  • Discord Canary: ./create-package.sh canary

Imgur screenshot

A easy way to upload pictures to imgur and share them with friends

$ su
# dnf copr enable valdikss/imgur-screenshot
# dnf install imgur-screenshot

Relevant dell xps laptop links and thanks to

[Unit]
Description=i8kmod auto fan
[Service]
Type=oneshot
ExecStart=/usr/bin/i8kmon
[Install]
WantedBy=multi-user.target
# Sample i8kmon configuration file (/etc/i8kmon.conf, ~/.i8kmon).
set config(i8kfan) /usr/bin/i8kfan
set config(verbose) 1
# set config(auto) 1
set config(timeout) 2
set config(t_high) 80
set config(0) {{0 0} -1 55 -1 60}
set config(1) {{1 1} 50 65 55 70}
set config(2) {{2 2} 60 75 65 80}
set config(3) {{2 2} 70 128 75 128}
set status(leftspeed) "1000 1400 1700 3000"
set status(rightspeed) "1000 1400 1700 3000"
# end of file
@sagidayan
Copy link

Thanks!
What version of fedora is this for?
Can you switch from dedicated to embedded graphics on the fly?

@mjarkk
Copy link
Author

mjarkk commented Aug 14, 2019

When i made this it i think that was fedora 27,
but I've used this recently to setup fedora 30 on my laptop.

Can you switch from dedicated to embedded graphics on the fly?

Never tested that, you can try taking a look into negativo17 documentation.
Till now i've always used the Nvidia GPU, the Intel driver is just to slow for a 4k screen.

@sagidayan
Copy link

One more thing - Battery life?

In any case, ill give it a go later today... really want to use fedora on my xps

@mjarkk
Copy link
Author

mjarkk commented Aug 14, 2019

I'm now running fedora for the 3th time,
After Elementry OS this is the most stable os i've ran on my laptop this far.

Battery life?

I've not yet have any Linux distro yet with the amazing battery life people talk about when using the dell xps, usually i survive the train ride back home what is 40 minutes and still have around 60% in the battery.
Till just a week ago i was running fedora on the Intel driver with wayland, what kinda worked but it was still to slow for what i want, if you want to try it out yourself follow this: https://medium.com/@alex285/how-to-enable-eglstreams-on-fedora-29-30-gnome-nvidia-wayland-fa28a67663bf

The problem i have with wayland is that i can't get it to work with the nvidia driver but this might be because i use the nvidia driver provided by negativo17 instaid of the driver provided by rpmfusion-nonfree-nvidia-driver

@wonrax
Copy link

wonrax commented Jul 27, 2021

Hi,
After I do this command grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg and reboot, the Fedora boot entry in grub disappears, the menu shows only Windows Boot Manager (I was going to dual boot Fedora and Windows).
How do I get the Fedora boot entry back? I can only boot to Windows now.

@mjarkk
Copy link
Author

mjarkk commented Jul 28, 2021

The last revision to this document was 2 years ago and since then i've not used fedora, guess you'll have to re-install fedora :(

@dguttierrez
Copy link

dguttierrez commented Aug 11, 2021

@wonrax: take a look at this - https://fedoraproject.org/wiki/GRUB_2

and be aware of this:

Refrain from using grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg going forward. This is a valid location on Fedora 33 and earlier. However on Fedora 34 and later, it is a small stub file that merely forwards to /boot/grub2/grub.cfg. See the Reinstalling GRUB section if you have accidentally overwritten this file.

@wonrax
Copy link

wonrax commented Nov 24, 2021

@mjarkk @dguttierrez thank you. But I ended up reinstalling the OS since it was newly installed and I hadn't made many changes to it anyway.

@louiscklaw
Copy link

I want to know is it possible to boot a fedora live iso from GURB2 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment