Setting up a fixed static IP address for WIFI that doesn’t change, on the Pi desktop GUI (Pixel, Jessie, Stretch), is really simple! But 1st, the back story!
I have been using a Pi Zero W setup headless with a USB sound card, to control the volume on a set of boosted external speakers I have connected to my TV. When I want to adjust the volume level, I just use an ssh client or the VNC app from my phone, to move the volume slider up and down. And, It works ok. Only problem really is when we have had a power outage, my router would assign a new IP address to the Pi and then I would have to connect the Pi Zero to an HDMI port on the TV to find the new address. I am sure there is probably a better way to get the address while running headless, like pinging it with Windows or something, but have not bothered to look it up yet (yes I tried using raspberrypi.local but I have more than one Pi running usually, and that doesn’t always work for some reason).
Anyway, here is how to do it!
Go to the WIFI icon on the task bar and right click it.
Then click on the Wireless & Wired Network Settings.
Under Network Preferences, choose “interface” in the 1st selection box on the left. Then click on the selection box on the right to show your WIFI connection.
Example: wlan0 usually is the default, unless you have more than one WIFI connection. I am using a Pi Zero W but with an additional USB wireless network dongle, so I show wlan0 and wlan1.
Then in the box labeled IPv4 Address, put in something similar to your current IP address but change the last 3 numbers to something not already associated with a device connected to your router and that is not likely to get auto assigned to any other device you connect to WiFi with (i.e. your phone). Then click Apply and close.
Now you should have a fixed static IP address to connect to the PI, via ssh or VNC, that won’t change when say like the router gets shut off or reset due to a loss of power or other reason.
Need to Change It Back?
Only problem is, unless you are setup with an additional connection (i.e through another WIFI dongle like I do, or with Ethernet), your Pi will not be connect to the internet. So, you will not be able to run an update or install other software with apt-get in the terminal, unless you remove the static IP. To do so, simply VNC into the Pi or connect it to a monitor again and go back to the wireless settings. Then click on the “clear” button at the bottom. This will remove the settings. Then click the “apply” and close button. Then reboot the Pi. Then you should be able connect to a regular WIFI signal and get online.
Anyway! I might not have the best way of doing this but it worked for me!